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