MythTV  master
mythinteropgpu.h
Go to the documentation of this file.
1 #ifndef MYTHINTEROPGPU_H
2 #define MYTHINTEROPGPU_H
3 
4 // Qt
5 #include <QSize>
6 #include <QObject>
7 
8 // MythTV
10 #include "mythframe.h"
11 
12 // Std
13 #include <vector>
14 
15 class MythRender;
16 class MythPlayerUI;
17 using FreeAVHWDeviceContext = void (*)(struct AVHWDeviceContext*);
18 static constexpr uint64_t DUMMY_INTEROP_ID { 1 };
19 
20 class MythInteropGPU : public QObject, public ReferenceCounter
21 {
22  Q_OBJECT
23 
24  public:
25  enum InteropType : std::uint8_t
26  {
39  // used for default free/user_opaque storage
41  };
42 
43  using InteropTypes = std::vector<InteropType>;
44  using InteropMap = std::map<VideoFrameType,InteropTypes>;
45  static InteropMap GetTypes(MythRender* Render);
46  static QString TypeToString(InteropType Type);
47  static QString TypesToString(const InteropMap& Types);
48  static MythInteropGPU* CreateDummy();
49 
50  MythInteropGPU(MythRender* Context, InteropType Type, MythPlayerUI* Player = nullptr);
51  ~MythInteropGPU() override;
52 
55  void SetDefaultFree (FreeAVHWDeviceContext FreeContext);
56  void SetDefaultUserOpaque (void* UserOpaque);
58  void* GetDefaultUserOpaque ();
59 
60  protected:
61  MythRender* m_context { nullptr };
63  uint64_t m_discontinuityCounter { 0 };
65  void* m_defaultUserOpaque { nullptr };
66  MythPlayerUI* m_player { nullptr };
68 };
69 
70 #endif
DUMMY_INTEROP_ID
static constexpr uint64_t DUMMY_INTEROP_ID
Definition: mythinteropgpu.h:18
MythInteropGPU::m_type
InteropType m_type
Definition: mythinteropgpu.h:67
MythInteropGPU::GetDefaultFree
FreeAVHWDeviceContext GetDefaultFree()
Definition: mythinteropgpu.cpp:94
MythInteropGPU::GL_VTB
@ GL_VTB
Definition: mythinteropgpu.h:31
MythInteropGPU::GetPlayer
MythPlayerUI * GetPlayer()
Definition: mythinteropgpu.cpp:79
MythInteropGPU::GL_VDPAU
@ GL_VDPAU
Definition: mythinteropgpu.h:34
MythInteropGPU::m_context
MythRender * m_context
Definition: mythinteropgpu.h:61
MythInteropGPU::m_defaultUserOpaque
void * m_defaultUserOpaque
Definition: mythinteropgpu.h:65
mythframe.h
MythInteropGPU::GetType
InteropType GetType()
Definition: mythinteropgpu.cpp:74
MythInteropGPU::GL_MEDIACODEC
@ GL_MEDIACODEC
Definition: mythinteropgpu.h:33
MythInteropGPU::TypeToString
static QString TypeToString(InteropType Type)
Definition: mythinteropgpu.cpp:22
MythInteropGPU::TypesToString
static QString TypesToString(const InteropMap &Types)
Definition: mythinteropgpu.cpp:39
MythInteropGPU::InteropMap
std::map< VideoFrameType, InteropTypes > InteropMap
Definition: mythinteropgpu.h:44
MythInteropGPU::GL_NVDEC
@ GL_NVDEC
Definition: mythinteropgpu.h:35
MythPlayerUI
Definition: mythplayerui.h:12
MythInteropGPU::GL_VAAPIEGLDRM
@ GL_VAAPIEGLDRM
Definition: mythinteropgpu.h:30
MythInteropGPU::DRM_DRMPRIME
@ DRM_DRMPRIME
Definition: mythinteropgpu.h:38
MythInteropGPU::InteropType
InteropType
Definition: mythinteropgpu.h:25
MythInteropGPU::m_defaultFree
FreeAVHWDeviceContext m_defaultFree
Definition: mythinteropgpu.h:64
MythInteropGPU::GL_DRMPRIME
@ GL_DRMPRIME
Definition: mythinteropgpu.h:37
MythInteropGPU::m_player
MythPlayerUI * m_player
Definition: mythinteropgpu.h:66
MythInteropGPU::DUMMY
@ DUMMY
Definition: mythinteropgpu.h:40
referencecounter.h
MythInteropGPU::GL_VTBSURFACE
@ GL_VTBSURFACE
Definition: mythinteropgpu.h:32
MythInteropGPU::CreateDummy
static MythInteropGPU * CreateDummy()
Definition: mythinteropgpu.cpp:49
FreeAVHWDeviceContext
void(*)(struct AVHWDeviceContext *) FreeAVHWDeviceContext
Definition: mythinteropgpu.h:17
MythInteropGPU::MythInteropGPU
MythInteropGPU(MythRender *Context, InteropType Type, MythPlayerUI *Player=nullptr)
Definition: mythinteropgpu.cpp:58
MythInteropGPU::Unsupported
@ Unsupported
Definition: mythinteropgpu.h:27
MythRender
Definition: mythrender_base.h:23
MythInteropGPU::GL_VAAPIGLXPIX
@ GL_VAAPIGLXPIX
Definition: mythinteropgpu.h:29
MythInteropGPU::m_discontinuityCounter
uint64_t m_discontinuityCounter
Definition: mythinteropgpu.h:63
MythInteropGPU::GetTypes
static InteropMap GetTypes(MythRender *Render)
Definition: mythinteropgpu.cpp:10
MythInteropGPU::GetDefaultUserOpaque
void * GetDefaultUserOpaque()
Definition: mythinteropgpu.cpp:99
MythInteropGPU::SetDefaultUserOpaque
void SetDefaultUserOpaque(void *UserOpaque)
Definition: mythinteropgpu.cpp:89
Player
Definition: zmliveplayer.h:34
MythInteropGPU::SetDefaultFree
void SetDefaultFree(FreeAVHWDeviceContext FreeContext)
Definition: mythinteropgpu.cpp:84
MythInteropGPU::GL_VAAPIGLXCOPY
@ GL_VAAPIGLXCOPY
Definition: mythinteropgpu.h:28
MythInteropGPU::m_textureSize
QSize m_textureSize
Definition: mythinteropgpu.h:62
MythInteropGPU::~MythInteropGPU
~MythInteropGPU() override
Definition: mythinteropgpu.cpp:68
MythInteropGPU::GL_MMAL
@ GL_MMAL
Definition: mythinteropgpu.h:36
ReferenceCounter
General purpose reference counter.
Definition: referencecounter.h:26
MythInteropGPU::InteropTypes
std::vector< InteropType > InteropTypes
Definition: mythinteropgpu.h:43
MythInteropGPU
Definition: mythinteropgpu.h:20