MythTV master
mythinteropgpu.cpp
Go to the documentation of this file.
1// MythTV
2#include "libmythbase/mythconfig.h"
5#include "mythinteropgpu.h"
6
7#if CONFIG_OPENGL
9#endif
10
12{
13 InteropMap result;
15 return result;
16
17#if CONFIG_OPENGL
18 MythOpenGLInterop::GetTypes(Render, result);
19#endif
20 return result;
21}
22
24{
25 if (Type == GL_VAAPIEGLDRM) return "GL-VAAPI-DRM";
26 if (Type == GL_VAAPIGLXPIX) return "GL-VAAPI-GLX-Pixmap";
27 if (Type == GL_VAAPIGLXCOPY) return "GL-VAAPI-GLX-Copy";
28 if (Type == GL_VTB) return "GL-VTB";
29 if (Type == GL_VTBSURFACE) return "GL-VTB-IOSurface";
30 if (Type == GL_MEDIACODEC) return "GL-MediaCodec-Surface";
31 if (Type == GL_VDPAU) return "GL-VDPAU";
32 if (Type == GL_NVDEC) return "GL-NVDEC";
33 if (Type == GL_MMAL) return "GL-MMAL";
34 if (Type == GL_DRMPRIME) return "GL-DRM-PRIME";
35 if (Type == DRM_DRMPRIME) return "DRM-DRM-PRIME";
36 if (Type == DUMMY) return "DUMMY";
37 return "Unsupported";
38}
39
41{
42 QStringList result;
43 for (const auto & types : Types)
44 for (auto type : types.second)
45 result << TypeToString(type);
46 result.removeDuplicates();
47 return result.isEmpty() ? "None" : result.join(",");
48}
49
51{
52 // This is used to store AVHWDeviceContext free and user_opaque when
53 // set by the decoder in use. This usually applies to VAAPI and VDPAU
54 // and we do not always want or need to use MythRenderOpenGL e.g. when
55 // checking functionality only.
56 return new MythInteropGPU(nullptr, DUMMY);
57}
58
60 : ReferenceCounter(TypeToString(Type), true),
61 m_context(Context),
62 m_player(Player),
63 m_type(Type)
64{
65 if (m_context)
67}
68
70{
71 if (m_context)
73}
74
76{
77 return m_type;
78}
79
81{
82 return m_player;
83}
84
86{
87 m_defaultFree = FreeContext;
88}
89
91{
92 m_defaultUserOpaque = UserOpaque;
93}
94
96{
97 return m_defaultFree;
98}
99
101{
102 return m_defaultUserOpaque;
103}
104
void * GetDefaultUserOpaque()
void SetDefaultFree(FreeAVHWDeviceContext FreeContext)
~MythInteropGPU() override
InteropType GetType()
FreeAVHWDeviceContext m_defaultFree
static QString TypesToString(const InteropMap &Types)
MythPlayerUI * m_player
MythInteropGPU(MythRender *Context, InteropType Type, MythPlayerUI *Player=nullptr)
static QString TypeToString(InteropType Type)
FreeAVHWDeviceContext GetDefaultFree()
void SetDefaultUserOpaque(void *UserOpaque)
InteropType m_type
std::map< VideoFrameType, InteropTypes > InteropMap
MythRender * m_context
static MythInteropGPU * CreateDummy()
static InteropMap GetTypes(MythRender *Render)
MythPlayerUI * GetPlayer()
void * m_defaultUserOpaque
static void GetTypes(MythRender *Render, MythInteropGPU::InteropMap &Types)
General purpose reference counter.
virtual int DecrRef(void)
Decrements reference count and deletes on 0.
virtual int IncrRef(void)
Increments reference count.
static const struct wl_interface * types[]
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
void(*)(struct AVHWDeviceContext *) FreeAVHWDeviceContext
VERBOSE_PREAMBLE Most true
Definition: verbosedefs.h:95