12#if CONFIG_VIDEOTOOLBOX
31#define LOC QString("OpenGLInterop: ")
59#if CONFIG_VIDEOTOOLBOX
68std::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)
130std::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 VideoFrameType PixelFormatToFrameType(AVPixelFormat Fmt)
static void GetDRMTypes(MythRenderOpenGL *Render, MythInteropGPU::InteropMap &Types)
std::map< VideoFrameType, InteropTypes > InteropMap
static void GetMMALTypes(MythRenderOpenGL *Render, MythInteropGPU::InteropMap &Types)
static void GetNVDECTypes(MythRenderOpenGL *Render, MythInteropGPU::InteropMap &Types)
MythOpenGLInterop(MythRenderOpenGL *Context, InteropType Type, MythPlayerUI *Player=nullptr)
virtual void DeleteTextures()
static void GetTypes(MythRender *Render, MythInteropGPU::InteropMap &Types)
~MythOpenGLInterop() override
virtual std::vector< MythVideoTextureOpenGL * > Acquire(MythRenderOpenGL *Context, MythVideoColourSpace *ColourSpace, MythVideoFrame *Frame, FrameScanType Scan)
static std::vector< MythVideoTextureOpenGL * > Retrieve(MythRenderOpenGL *Context, MythVideoColourSpace *ColourSpace, MythVideoFrame *Frame, FrameScanType Scan)
MythRenderOpenGL * m_openglContext
QHash< unsigned long long, std::vector< MythVideoTextureOpenGL * > > m_openglTextures
static void GetVAAPITypes(MythRenderOpenGL *Context, MythInteropGPU::InteropMap &Types)
Return a list of interops that are supported by the current render device.
static void GetVDPAUTypes(MythRenderOpenGL *Render, MythInteropGPU::InteropMap &Types)
static void GetVTBTypes(MythRenderOpenGL *Render, MythInteropGPU::InteropMap &Types)
MythVideoColourSpace contains a QMatrix4x4 that can convert YCbCr data to RGB.
static bool HardwareFormat(VideoFrameType Type)
static void DeleteTexture(MythRenderOpenGL *Context, MythVideoTextureOpenGL *Texture)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)