21#define LOC QString("VidOutGL: ")
32 safe <<
"opengl" <<
"opengl-yv12";
36 if (Options.
decoders->contains(
"ffmpeg"))
38 if (Options.
decoders->contains(
"mediacodec-dec"))
40 if (Options.
decoders->contains(
"vaapi-dec"))
42 if (Options.
decoders->contains(
"vdpau-dec"))
44 if (Options.
decoders->contains(
"nvdec-dec"))
46 if (Options.
decoders->contains(
"vtb-dec"))
48 if (Options.
decoders->contains(
"v4l2-dec"))
50 if (Options.
decoders->contains(
"mmal-dec"))
61#if CONFIG_VAAPI || CONFIG_VIDEOTOOLBOX || CONFIG_MEDIACODEC || CONFIG_VDPAU || CONFIG_NVDEC || CONFIG_MMAL || CONFIG_V4L2PRIME || CONFIG_EGL
67 if (Options.
decoders->contains(
"vaapi"))
70#if CONFIG_VIDEOTOOLBOX
71 if (Options.
decoders->contains(
"vtb"))
75 if (Options.
decoders->contains(
"mediacodec"))
79 if (Options.
decoders->contains(
"vdpau"))
83 if (Options.
decoders->contains(
"nvdec"))
87 if (Options.
decoders->contains(
"mmal"))
91 if (Options.
decoders->contains(
"v4l2"))
95 if (Options.
decoders->contains(
"drmprime"))
107 m_openglRender(Render)
128 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No OpenGL context");
154 if (!qobject_cast<MythOpenGLPainter*>(
m_painter))
155 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No OpenGL painter");
164 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed to create valid OpenGL video");
182 float Aspect,
const QRect DisplayVisibleRect,
MythCodecID CodecId)
186 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Fatal error");
192 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Cannot initialise OpenGL video from this thread");
218 dvr = QRect(QPoint(0, 0), size);
224 if (dvr.height() < size.height())
225 dvr.setTop(dvr.top() - size.height() + dvr.height());
231 if (dvr.width() < size.width())
232 dvr.setWidth(size.width());
313 for (
const auto& rect : std::as_const(toclear))
380 allowed <<
"opengl" <<
"opengl-yv12";
388 allowed <<
"opengl-hw";
std::map< VideoFrameType, InteropTypes > InteropMap
static void GetTypes(MythRender *Render, MythInteropGPU::InteropMap &Types)
A simple overload of QOpenGLTimeMonitor to record and log OpenGL execution intervals.
int GetTimersRunning(void) const
MythOpenGLVideo is responsible for displaying video frames on screen using OpenGL.
void ClearRect(QOpenGLFramebufferObject *Target, QRect Area, int Color, int Alpha)
An optimised method to clear a QRect to the given color.
void ClearFramebuffer(void)
void BindFramebuffer(QOpenGLFramebufferObject *Framebuffer)
void logDebugMarker(const QString &Message)
void SetBackground(uint8_t Red, uint8_t Green, uint8_t Blue, uint8_t Alpha)
int GetExtraFeatures(void) const
bool IsEmbedding(void) const
bool VideoIsFullScreen(void) const
Check whether the video display rect covers the entire window/framebuffer.
QRect GetDisplayVisibleRect(void) const
QRegion GetBoundingRegion(void) const
Return the region of DisplayVisibleRect that lies outside of DisplayVideoRect.
QRect GetWindowRect(void) const
void SetViewportRect(QRect DisplayVisibleRect)
Common code shared between GPU accelerated sub-classes (e.g. OpenGL)
MythMainWindow * m_mainWindow
void PrepareFrame(MythVideoFrame *Frame, FrameScanType Scan) override
MythPainterGPU * m_painter
static VideoFrameType FrameTypeForCodec(MythCodecID CodecId)
bool Init(QSize VideoDim, QSize VideoDispDim, float Aspect, QRect DisplayVisibleRect, MythCodecID CodecId) override
void RenderFrame(MythVideoFrame *Frame, FrameScanType Scan) override
bool Init(QSize VideoDim, QSize VideoDispDim, float Aspect, QRect DisplayVisibleRect, MythCodecID CodecId) override
~MythVideoOutputOpenGL() override
void PrepareFrame(MythVideoFrame *Frame, FrameScanType Scan) override
void RenderEnd() override
MythRenderOpenGL * m_openglRender
MythVideoOutputOpenGL(MythMainWindow *MainWindow, MythRenderOpenGL *Render, MythOpenGLPainter *Painter, MythDisplay *Display, const MythVideoProfilePtr &VideoProfile, QString &Profile)
void RenderFrame(MythVideoFrame *Frame, FrameScanType Scan) override
QRect GetDisplayVisibleRectAdj() override
Adjust the display rectangle for OpenGL coordinates in some cases.
static void GetRenderOptions(RenderOptions &Options)
Generate the list of available OpenGL profiles.
static QStringList GetAllowedRenderers(MythRenderOpenGL *Render, MythCodecID CodecId, QSize VideoDim)
Generate a list of supported OpenGL profiles.
MythOpenGLPerf * m_openGLPerf
MythVideoColourSpace m_videoColourSpace
MythVideoProfilePtr m_videoProfile
const VideoFrameTypes * m_renderFormats
static bool codec_sw_copy(MythCodecID id)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
std::vector< VideoFrameType > VideoFrameTypes
static bool VERBOSE_LEVEL_CHECK(uint64_t mask, LogLevel_t level)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
std::shared_ptr< MythVideoProfile > MythVideoProfilePtr
QMap< QString, QStringList > * safe_renderers
QMap< QString, uint > * priorities