Go to the documentation of this file.
20 #define LOC QString("VidOutGL: ")
31 safe <<
"opengl" <<
"opengl-yv12";
35 if (Options.
decoders->contains(
"ffmpeg"))
37 if (Options.
decoders->contains(
"mediacodec-dec"))
39 if (Options.
decoders->contains(
"vaapi-dec"))
41 if (Options.
decoders->contains(
"vdpau-dec"))
43 if (Options.
decoders->contains(
"nvdec-dec"))
45 if (Options.
decoders->contains(
"vtb-dec"))
47 if (Options.
decoders->contains(
"v4l2-dec"))
49 if (Options.
decoders->contains(
"mmal-dec"))
60 #if defined(USING_VAAPI) || defined (USING_VTB) || defined (USING_MEDIACODEC) || defined (USING_VDPAU) || defined (USING_NVDEC) || defined (USING_MMAL) || defined (USING_V4L2PRIME) || defined (USING_EGL)
66 if (Options.
decoders->contains(
"vaapi"))
70 if (Options.
decoders->contains(
"vtb"))
73 #ifdef USING_MEDIACODEC
74 if (Options.
decoders->contains(
"mediacodec"))
78 if (Options.
decoders->contains(
"vdpau"))
82 if (Options.
decoders->contains(
"nvdec"))
86 if (Options.
decoders->contains(
"mmal"))
89 #ifdef USING_V4L2PRIME
90 if (Options.
decoders->contains(
"v4l2"))
94 if (Options.
decoders->contains(
"drmprime"))
106 m_openglRender(Render)
127 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No OpenGL context");
153 if (!qobject_cast<MythOpenGLPainter*>(
m_painter))
154 LOG(VB_GENERAL, LOG_ERR,
LOC +
"No OpenGL painter");
163 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Failed to create valid OpenGL video");
181 float Aspect,
const QRect DisplayVisibleRect,
MythCodecID CodecId)
185 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Fatal error");
191 LOG(VB_GENERAL, LOG_ERR,
LOC +
"Cannot initialise OpenGL video from this thread");
217 dvr = QRect(QPoint(0, 0), size);
223 if (dvr.height() < size.height())
224 dvr.setTop(dvr.top() - size.height() + dvr.height());
230 if (dvr.width() < size.width())
231 dvr.setWidth(size.width());
312 for (
const auto& rect : qAsConst(toclear))
379 allowed <<
"opengl" <<
"opengl-yv12";
387 allowed <<
"opengl-hw";
bool IsEmbedding(void) const
void SetBackground(uint8_t Red, uint8_t Green, uint8_t Blue, uint8_t Alpha)
void ClearFramebuffer(void)
void ClearRect(QOpenGLFramebufferObject *Target, QRect Area, int Color, int Alpha)
An optimised method to clear a QRect to the given color.
QRect GetDisplayVisibleRect(void) const
bool Init(QSize VideoDim, QSize VideoDispDim, float Aspect, QRect DisplayVisibleRect, MythCodecID CodecId) override
void logDebugMarker(const QString &Message)
static bool VERBOSE_LEVEL_CHECK(uint64_t mask, LogLevel_t level)
int GetTimersRunning(void) const
static void GetRenderOptions(RenderOptions &Options)
Generate the list of available OpenGL profiles.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
MythRenderOpenGL * m_openglRender
static bool codec_sw_copy(MythCodecID id)
static QStringList GetAllowedRenderers(MythRenderOpenGL *Render, MythCodecID CodecId, QSize VideoDim)
Generate a list of supported OpenGL profiles.
bool Init(QSize VideoDim, QSize VideoDispDim, float Aspect, QRect DisplayVisibleRect, MythCodecID CodecId) override
std::map< VideoFrameType, InteropTypes > InteropMap
QRect GetDisplayVisibleRectAdj() override
Adjust the display rectangle for OpenGL coordinates in some cases.
MythMainWindow * m_mainWindow
MythOpenGLPerf * m_openGLPerf
std::vector< VideoFrameType > VideoFrameTypes
MythVideoProfilePtr m_videoProfile
void SetViewportRect(QRect DisplayVisibleRect)
QMap< QString, QStringList > * safe_renderers
int GetExtraFeatures(void) const
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
void PrepareFrame(MythVideoFrame *Frame, FrameScanType Scan) override
A simple overload of QOpenGLTimeMonitor to record and log OpenGL execution intervals.
static VideoFrameType FrameTypeForCodec(MythCodecID CodecId)
void PrepareFrame(MythVideoFrame *Frame, FrameScanType Scan) override
const VideoFrameTypes * m_renderFormats
void BindFramebuffer(QOpenGLFramebufferObject *Framebuffer)
QRegion GetBoundingRegion(void) const
Return the region of DisplayVisibleRect that lies outside of DisplayVideoRect.
void RenderFrame(MythVideoFrame *Frame, FrameScanType Scan) override
void RenderFrame(MythVideoFrame *Frame, FrameScanType Scan) override
~MythVideoOutputOpenGL() override
Common code shared between GPU accelerated sub-classes (e.g. OpenGL)
MythVideoOutputOpenGL(MythMainWindow *MainWindow, MythRenderOpenGL *Render, MythOpenGLPainter *Painter, MythDisplay *Display, const MythVideoProfilePtr &VideoProfile, QString &Profile)
std::shared_ptr< MythVideoProfile > MythVideoProfilePtr
MythPainterGPU * m_painter
QRect GetWindowRect(void) const
bool VideoIsFullScreen(void) const
Check whether the video display rect covers the entire window/framebuffer.
void RenderEnd() override
static void GetTypes(MythRender *Render, MythInteropGPU::InteropMap &Types)
MythVideoColourSpace m_videoColourSpace
QMap< QString, uint > * priorities