MythTV  master
mythopenglinterop.h
Go to the documentation of this file.
1 #ifndef MYTHOPENGLINTEROP_H
2 #define MYTHOPENGLINTEROP_H
3 
4 // Qt
5 #include <QObject>
6 
7 // MythTV
9 #include "referencecounter.h"
10 #include "videoouttypes.h"
11 #include "mythframe.h"
12 #include "mythvideotexture.h"
13 
14 // Std
15 #include "vector"
16 using std::vector;
17 
18 class MythPlayer;
19 class VideoColourSpace;
20 using FreeAVHWDeviceContext = void (*)(struct AVHWDeviceContext*);
21 #define DUMMY_INTEROP_ID 1
22 
23 class MythOpenGLInterop : public QObject, public ReferenceCounter
24 {
25  Q_OBJECT
26 
27  public:
28 
29  enum Type
30  {
42  DUMMY // used for default free/user_opaque storage
43  };
44 
45  static QStringList GetAllowedRenderers (VideoFrameType Format);
47  static void GetInteropTypeCallback(void *Wait, void *Format, void* Result);
48  static vector<MythVideoTexture*> Retrieve(MythRenderOpenGL *Context,
49  VideoColourSpace *ColourSpace,
51  FrameScanType Scan);
52  static QString TypeToString (Type InteropType);
53  static MythOpenGLInterop* CreateDummy (void);
54 
55  ~MythOpenGLInterop() override;
56  virtual vector<MythVideoTexture*> Acquire(MythRenderOpenGL *Context,
57  VideoColourSpace *ColourSpace,
59 
60  Type GetType (void);
61  MythPlayer* GetPlayer (void);
62  void SetPlayer (MythPlayer *Player);
63  void SetDefaultFree (FreeAVHWDeviceContext FreeContext);
64  void SetDefaultUserOpaque (void* UserOpaque);
66  void* GetDefaultUserOpaque (void);
67 
68  protected:
69  explicit MythOpenGLInterop (MythRenderOpenGL *Context, Type InteropType);
70  virtual void DeleteTextures (void);
71 
72  protected:
75  QHash<unsigned long long, vector<MythVideoTexture*> > m_openglTextures;
77  long long m_discontinuityCounter { 0 };
79  void *m_defaultUserOpaque { nullptr };
80  MythPlayer *m_player { nullptr };
81 };
82 
83 #endif // MYTHOPENGLINTEROP_H
MythOpenGLInterop::GetPlayer
MythPlayer * GetPlayer(void)
Definition: mythopenglinterop.cpp:275
MythOpenGLInterop::CreateDummy
static MythOpenGLInterop * CreateDummy(void)
Definition: mythopenglinterop.cpp:230
MythOpenGLInterop::m_player
MythPlayer * m_player
Definition: mythopenglinterop.h:80
MythOpenGLInterop::m_defaultUserOpaque
void * m_defaultUserOpaque
Definition: mythopenglinterop.h:79
MythOpenGLInterop::GetType
Type GetType(void)
Definition: mythopenglinterop.cpp:270
MythOpenGLInterop::SetDefaultFree
void SetDefaultFree(FreeAVHWDeviceContext FreeContext)
Definition: mythopenglinterop.cpp:285
Frame
Definition: zmdefines.h:93
MythOpenGLInterop::Acquire
virtual vector< MythVideoTexture * > Acquire(MythRenderOpenGL *Context, VideoColourSpace *ColourSpace, VideoFrame *Frame, FrameScanType Scan)
Definition: mythopenglinterop.cpp:239
FrameScanType
FrameScanType
Definition: videoouttypes.h:78
MythOpenGLInterop::SetPlayer
void SetPlayer(MythPlayer *Player)
Definition: mythopenglinterop.cpp:280
Context
QHash< QString, Action * > Context
Definition: action.h:77
MythDate::Format
Format
Definition: mythdate.h:12
mythframe.h
mythvideotexture.h
MythPlayer
Definition: mythplayer.h:164
VideoFrame
Definition: mythframe.h:137
MythOpenGLInterop::SetDefaultUserOpaque
void SetDefaultUserOpaque(void *UserOpaque)
Definition: mythopenglinterop.cpp:290
MythOpenGLInterop::DUMMY
@ DUMMY
Definition: mythopenglinterop.h:42
MythOpenGLInterop::~MythOpenGLInterop
~MythOpenGLInterop() override
Definition: mythopenglinterop.cpp:223
MythOpenGLInterop::m_type
Type m_type
Definition: mythopenglinterop.h:74
MythOpenGLInterop::VDPAU
@ VDPAU
Definition: mythopenglinterop.h:38
MythOpenGLInterop::m_discontinuityCounter
long long m_discontinuityCounter
Definition: mythopenglinterop.h:77
mythrenderopengl.h
MythOpenGLInterop
Definition: mythopenglinterop.h:23
videoouttypes.h
MythOpenGLInterop::Unsupported
@ Unsupported
Definition: mythopenglinterop.h:31
MythOpenGLInterop::MMAL
@ MMAL
Definition: mythopenglinterop.h:40
MythOpenGLInterop::NVDEC
@ NVDEC
Definition: mythopenglinterop.h:39
MythOpenGLInterop::GetAllowedRenderers
static QStringList GetAllowedRenderers(VideoFrameType Format)
Definition: mythopenglinterop.cpp:51
MythOpenGLInterop::GetInteropTypeCallback
static void GetInteropTypeCallback(void *Wait, void *Format, void *Result)
Definition: mythopenglinterop.cpp:59
MythOpenGLInterop::MythOpenGLInterop
MythOpenGLInterop(MythRenderOpenGL *Context, Type InteropType)
Definition: mythopenglinterop.cpp:214
MythOpenGLInterop::GetDefaultFree
FreeAVHWDeviceContext GetDefaultFree(void)
Definition: mythopenglinterop.cpp:295
MythOpenGLInterop::MEDIACODEC
@ MEDIACODEC
Definition: mythopenglinterop.h:37
MythOpenGLInterop::m_context
MythRenderOpenGL * m_context
Definition: mythopenglinterop.h:73
MythOpenGLInterop::VAAPIGLXCOPY
@ VAAPIGLXCOPY
Definition: mythopenglinterop.h:32
MythOpenGLInterop::Type
Type
Definition: mythopenglinterop.h:29
referencecounter.h
MythOpenGLInterop::DRMPRIME
@ DRMPRIME
Definition: mythopenglinterop.h:41
MythOpenGLInterop::VTBOPENGL
@ VTBOPENGL
Definition: mythopenglinterop.h:35
MythOpenGLInterop::VAAPIGLXPIX
@ VAAPIGLXPIX
Definition: mythopenglinterop.h:33
MythOpenGLInterop::VTBSURFACE
@ VTBSURFACE
Definition: mythopenglinterop.h:36
MythRenderOpenGL
Definition: mythrenderopengl.h:86
VideoColourSpace
VideoColourSpace contains a QMatrix4x4 that can convert YCbCr data to RGB.
Definition: videocolourspace.h:17
MythOpenGLInterop::Retrieve
static vector< MythVideoTexture * > Retrieve(MythRenderOpenGL *Context, VideoColourSpace *ColourSpace, VideoFrame *Frame, FrameScanType Scan)
Definition: mythopenglinterop.cpp:164
MythOpenGLInterop::VAAPIEGLDRM
@ VAAPIEGLDRM
Definition: mythopenglinterop.h:34
MythOpenGLInterop::m_defaultFree
FreeAVHWDeviceContext m_defaultFree
Definition: mythopenglinterop.h:78
FreeAVHWDeviceContext
void(*)(struct AVHWDeviceContext *) FreeAVHWDeviceContext
Definition: mythopenglinterop.h:20
MythOpenGLInterop::TypeToString
static QString TypeToString(Type InteropType)
Definition: mythopenglinterop.cpp:35
VideoFrameType
VideoFrameType
Definition: mythframe.h:24
Player
Definition: zmliveplayer.h:35
MythOpenGLInterop::DeleteTextures
virtual void DeleteTextures(void)
Definition: mythopenglinterop.cpp:246
MythOpenGLInterop::GetInteropType
static Type GetInteropType(VideoFrameType Format, MythPlayer *Player)
Check whether we support direct rendering for the given VideoFrameType.
Definition: mythopenglinterop.cpp:77
MythOpenGLInterop::m_openglTextures
QHash< unsigned long long, vector< MythVideoTexture * > > m_openglTextures
Definition: mythopenglinterop.h:75
MythOpenGLInterop::GetDefaultUserOpaque
void * GetDefaultUserOpaque(void)
Definition: mythopenglinterop.cpp:300
MythOpenGLInterop::m_openglTextureSize
QSize m_openglTextureSize
Definition: mythopenglinterop.h:76
ReferenceCounter
General purpose reference counter.
Definition: referencecounter.h:26