5#include "libmythbase/mythconfig.h"
22#define LOC QString("VidOutGL: ")
33 safe <<
"opengl" <<
"opengl-yv12";
37 if (Options.
decoders->contains(
"ffmpeg"))
39 if (Options.
decoders->contains(
"mediacodec-dec"))
41 if (Options.
decoders->contains(
"vaapi-dec"))
43 if (Options.
decoders->contains(
"vdpau-dec"))
45 if (Options.
decoders->contains(
"nvdec-dec"))
47 if (Options.
decoders->contains(
"vtb-dec"))
49 if (Options.
decoders->contains(
"v4l2-dec"))
51 if (Options.
decoders->contains(
"mmal-dec"))
62#if CONFIG_VAAPI || CONFIG_VIDEOTOOLBOX || CONFIG_MEDIACODEC || CONFIG_VDPAU || CONFIG_NVDEC || CONFIG_MMAL || CONFIG_V4L2PRIME || CONFIG_EGL
68 if (Options.
decoders->contains(
"vaapi"))
71#if CONFIG_VIDEOTOOLBOX
72 if (Options.
decoders->contains(
"vtb"))
76 if (Options.
decoders->contains(
"mediacodec"))
80 if (Options.
decoders->contains(
"vdpau"))
84 if (Options.
decoders->contains(
"nvdec"))
88 if (Options.
decoders->contains(
"mmal"))
92 if (Options.
decoders->contains(
"v4l2"))
96 if (Options.
decoders->contains(
"drmprime"))
108 m_openglRender(Render)
129 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No OpenGL context");
155 if (!qobject_cast<MythOpenGLPainter*>(
m_painter))
156 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No OpenGL painter");
165 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed to create valid OpenGL video");
183 float Aspect,
const QRect DisplayVisibleRect,
MythCodecID CodecId)
187 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Fatal error");
193 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Cannot initialise OpenGL video from this thread");
219 dvr = QRect(QPoint(0, 0), size);
225 if (dvr.height() < size.height())
226 dvr.setTop(dvr.top() - size.height() + dvr.height());
232 if (dvr.width() < size.width())
233 dvr.setWidth(size.width());
314 for (
const auto& rect : std::as_const(toclear))
381 allowed <<
"opengl" <<
"opengl-yv12";
389 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