Go to the documentation of this file.
15 #ifdef USING_MEDIACODEC
31 #define LOC QString("OpenGLInterop: ")
39 #ifdef USING_MEDIACODEC
68 std::vector<MythVideoTextureOpenGL*>
74 std::vector<MythVideoTextureOpenGL*> result;
75 if (!(Context &&
Frame))
81 LOG(VB_GENERAL, LOG_WARNING,
LOC +
"Not a valid hardware frame");
94 auto* buffer =
reinterpret_cast<AVBufferRef*
>(
Frame->m_priv[1]);
95 if (!buffer || !buffer->data)
99 auto* context =
reinterpret_cast<AVHWDeviceContext*
>(buffer->data);
100 if (!context || !context->user_opaque)
106 auto* frames =
reinterpret_cast<AVHWFramesContext*
>(buffer->data);
107 if (!frames || !frames->user_opaque)
114 return interop->
Acquire(Context, ColourSpace,
Frame, Scan);
115 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No OpenGL interop found");
121 m_openglContext(Context)
130 std::vector<MythVideoTextureOpenGL*>
146 std::vector<MythVideoTextureOpenGL*> textures = it.value();
147 for (
auto & texture : textures)
149 if (texture->m_textureId)
156 LOG(VB_GENERAL, LOG_INFO,
LOC + QString(
"Deleted %1 textures in %2 groups")
static void GetNVDECTypes(MythRenderOpenGL *Render, MythInteropGPU::InteropMap &Types)
static void GetDRMTypes(MythRenderOpenGL *Render, MythInteropGPU::InteropMap &Types)
static void GetVAAPITypes(MythRenderOpenGL *Context, MythInteropGPU::InteropMap &Types)
Return a list of interops that are supported by the current render device.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
static bool HardwareFormat(VideoFrameType Type)
~MythOpenGLInterop() override
std::map< VideoFrameType, InteropTypes > InteropMap
static void GetVTBTypes(MythRenderOpenGL *Render, MythInteropGPU::InteropMap &Types)
static void GetMMALTypes(MythRenderOpenGL *Render, MythInteropGPU::InteropMap &Types)
MythRenderOpenGL * m_openglContext
static void DeleteTexture(MythRenderOpenGL *Context, MythVideoTextureOpenGL *Texture)
static VideoFrameType PixelFormatToFrameType(AVPixelFormat Fmt)
QHash< unsigned long long, std::vector< MythVideoTextureOpenGL * > > m_openglTextures
MythOpenGLInterop(MythRenderOpenGL *Context, InteropType Type, MythPlayerUI *Player=nullptr)
virtual void DeleteTextures()
virtual std::vector< MythVideoTextureOpenGL * > Acquire(MythRenderOpenGL *Context, MythVideoColourSpace *ColourSpace, MythVideoFrame *Frame, FrameScanType Scan)
MythVideoColourSpace contains a QMatrix4x4 that can convert YCbCr data to RGB.
static std::vector< MythVideoTextureOpenGL * > Retrieve(MythRenderOpenGL *Context, MythVideoColourSpace *ColourSpace, MythVideoFrame *Frame, FrameScanType Scan)
static void GetTypes(MythRender *Render, MythInteropGPU::InteropMap &Types)
static void GetVDPAUTypes(MythRenderOpenGL *Render, MythInteropGPU::InteropMap &Types)