MythTV  master
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
MythVideoOutputOpenGL Class Reference

#include <mythvideooutopengl.h>

Inheritance diagram for MythVideoOutputOpenGL:
Inheritance graph
Collaboration diagram for MythVideoOutputOpenGL:
Collaboration graph

Public Types

enum  TextureFormats { AllFormats = 0, LegacyFormats = 1 }

Public Member Functions

 MythVideoOutputOpenGL (QString &Profile)
 ~MythVideoOutputOpenGL () override
bool Init (const QSize &VideoDim, const QSize &VideoDispDim, float Aspect, const QRect &DisplayVisibleRect, MythCodecID CodecId) override
void PrepareFrame (VideoFrame *Frame, const PIPMap &PiPPlayers, FrameScanType Scan) override
void RenderFrame (VideoFrame *Frame, FrameScanType Scan, OSD *Osd) override
void EndFrame () override
- Public Member Functions inherited from MythVideoOutputGPU
 MythVideoOutputGPU (MythRender *Render, QString &Profile)
 ~MythVideoOutputGPU () override
MythPainterGetOSDPainter () override
void InitPictureAttributes () override
void WindowResized (const QSize &Size) override
void SetVideoFrameRate (float NewRate) override
void DiscardFrames (bool KeyFrame, bool Flushed) override
 Discard video frames. More...
void DoneDisplayingFrame (VideoFrame *Frame) override
 Release a video frame back into the decoder pool. More...
void UpdatePauseFrame (int64_t &DisplayTimecode, FrameScanType Scan=kScan_Progressive) override
bool InputChanged (const QSize &VideoDim, const QSize &VideoDispDim, float Aspect, MythCodecID CodecId, bool &AspectOnly, MythMultiLocker *Locks, int ReferenceFrames, bool ForceChange) override
 Tells video output to discard decoded frames and wait for new ones. More...
void ClearAfterSeek () override
 Tells video output to toss decoded buffers due to a seek. More...
bool IsPIPSupported () const override
void ShowPIPs (const PIPMap &PiPPlayers) override
void ShowPIP (MythPlayer *PiPPlayer, PIPLocation Location) override
void RemovePIP (MythPlayer *PiPPlayer) override
bool EnableVisualisation (AudioPlayer *Audio, bool Enable, const QString &Name=QString("")) override
bool CanVisualise (AudioPlayer *Audio) override
bool SetupVisualisation (AudioPlayer *Audio, const QString &Name) override
VideoVisualGetVisualisation () override
QString GetVisualiserName () override
QStringList GetVisualiserList () override
void DestroyVisualisation () override
bool StereoscopicModesAllowed () const override
void ResizeForVideo (QSize Size=QSize()) override
- Public Member Functions inherited from MythVideoOutput
 MythVideoOutput (bool CreateDisplay=false)
 ~MythVideoOutput () override
virtual void SetDeinterlacing (bool Enable, bool DoubleRate, MythDeintType Force=DEINT_NONE)
void SetReferenceFrames (int ReferenceFrames)
VideoDisplayProfileGetProfile ()
virtual void GetOSDBounds (QRect &Total, QRect &Visible, float &VisibleAspect, float &FontScaling, float ThemeAspect) const
PictureAttributeSupported GetSupportedPictureAttributes ()
int ChangePictureAttribute (PictureAttribute AttributeType, bool Direction)
virtual int SetPictureAttribute (PictureAttribute Attribute, int NewValue)
int GetPictureAttribute (PictureAttribute AttributeType)
bool HasSoftwareFrames () const
virtual void SetFramesPlayed (long long FramesPlayed)
virtual long long GetFramesPlayed ()
bool IsErrored () const
VideoErrorState GetError () const
void SetPrebuffering (bool Normal)
 Sets whether to use a normal number of buffers or fewer buffers. More...
virtual int ValidVideoFrames () const
 Returns number of frames that are fully decoded. More...
int FreeVideoFrames ()
 Returns number of frames available for decoding onto. More...
bool EnoughFreeFrames ()
 Returns true iff enough frames are available to decode onto. More...
bool EnoughDecodedFrames ()
 Returns true iff there are plenty of decoded frames ready for display. More...
const VideoFrameTypeVecDirectRenderFormats () const
virtual VideoFrameGetNextFreeFrame ()
 Blocks until it is possible to return a frame for decoding onto. More...
virtual void ReleaseFrame (VideoFrame *Frame)
 Releases a frame from the ready for decoding queue onto the queue of frames ready for display. More...
virtual void DeLimboFrame (VideoFrame *Frame)
 Releases a frame for reuse if it is in limbo. More...
virtual void StartDisplayingFrame ()
 Tell GetLastShownFrame() to return the next frame from the head of the queue of frames to display. More...
virtual void DiscardFrame (VideoFrame *frame)
 Releases frame from any queue onto the queue of frames ready for decoding onto. More...
virtual void CheckFrameStates ()
virtual VideoFrameGetLastDecodedFrame ()
virtual VideoFrameGetLastShownFrame ()
 Returns frame from the head of the ready to be displayed queue, if StartDisplayingFrame has been called. More...
QString GetFrameStatus () const
 Returns string with status of each frame for debugging. More...
QRect GetImageRect (const QRect &Rect, QRect *DisplayRect=nullptr)
 translates caption/dvd button rectangle into 'screen' space More...
QRect GetSafeRect ()
 Returns a QRect describing an area of the screen on which it is 'safe' to render the On Screen Display. More...
virtual bool IsPBPSupported () const
- Public Member Functions inherited from MythVideoBounds
 MythVideoBounds (bool CreateDisplay)
 ~MythVideoBounds () override
bool InitBounds (const QSize &VideoDim, const QSize &VideoDispDim, float Aspect, const QRect &WindowRect)
bool IsEmbedding (void) const
bool IsEmbeddingAndHidden () const
QSize GetVideoDim (void) const
QSize GetVideoDispDim (void) const
PIPState GetPIPState (void) const
float GetOverridenVideoAspect (void) const
QRect GetDisplayVisibleRect (void) const
QRect GetWindowRect (void) const
QRect GetRawWindowRect (void) const
QRect GetVideoRect (void) const
QRect GetDisplayVideoRect (void) const
QRect GetEmbeddingRect (void) const
bool UsingGuiSize (void) const
QString GetZoomString (void) const
AspectOverrideMode GetAspectOverride (void) const
AdjustFillMode GetAdjustFill (void) const
float GetVideoAspect (void) const
float GetDisplayAspect (void) const
QRect GetPIPRect (PIPLocation Location, MythPlayer *PiPPlayer=nullptr, bool DoPixelAdjustment=true) const
bool VideoIsFullScreen (void) const
 Check whether the video display rect covers the entire window/framebuffer. More...
QRegion GetBoundingRegion (void) const
 Return the region of DisplayVisibleRect that lies outside of DisplayVideoRect. More...
StereoscopicMode GetStereoscopicMode () const

Static Public Member Functions

static void GetRenderOptions (RenderOptions &Options)
 Generate the list of available OpenGL profiles. More...
static QStringList GetAllowedRenderers (MythCodecID CodecId, const QSize &VideoDim)
 Generate a list of supported OpenGL profiles. More...
- Static Public Member Functions inherited from MythVideoOutput
static void GetRenderOptions (RenderOptions &Options)
static MythVideoOutputCreate (const QString &Decoder, MythCodecID CodecID, PIPState PiPState, const QSize &VideoDim, const QSize &VideoDispDim, float VideoAspect, QWidget *ParentWidget, const QRect &EmbedRect, float FrameRate, uint PlayerFlags, const QString &Codec, int ReferenceFrames)
 Depending on compile-time configure settings and run-time renderer settings, create a relevant VideoOutput subclass. More...
static MythDeintType ParseDeinterlacer (const QString &Deinterlacer)

Static Public Attributes

static VideoFrameTypeVec s_openglFrameTypes
static VideoFrameTypeVec s_openglFrameTypesLegacy
- Static Public Attributes inherited from MythVideoOutput
static VideoFrameTypeVec s_defaultFrameTypes = { FMT_YV12 }

Protected Member Functions

QRect GetDisplayVisibleRectAdj () override
 Adjust the display rectangle for OpenGL coordinates in some cases. More...
- Protected Member Functions inherited from MythVideoOutputGPU
bool CreateBuffers (MythCodecID CodecID, QSize Size)
void DestroyBuffers ()
bool ProcessInputChange ()
void InitDisplayMeasurements ()
 Initialise display measurement. More...
- Protected Member Functions inherited from MythVideoOutput
QRect GetVisibleOSDBounds (float &VisibleAspect, float &FontScaling, float ThemeAspect) const
 Returns visible portions of total OSD bounds. More...
QRect GetTotalOSDBounds () const

Private Member Functions

MythVideoGPUCreateSecondaryVideo (const QSize &VideoDim, const QSize &VideoDispDim, const QRect &DisplayVisibleRect, const QRect &DisplayVideoRect, const QRect &VideoRect) override

Private Attributes

MythRenderOpenGLm_openglRender { nullptr }
MythOpenGLPerfm_openGLPerf { nullptr }

Additional Inherited Members

- Public Slots inherited from MythVideoBounds
void ScreenChanged (QScreen *screen)
void PhysicalDPIChanged (qreal)
void SourceChanged (const QSize &VideoDim, const QSize &VideoDispDim, float Aspect)
 Update for new source video dimensions and aspect ratio. More...
void VideoAspectRatioChanged (float Aspect)
 Calls SetVideoAspectRatio(float aspect), then calls MoveResize() to apply changes. More...
virtual void EmbedInWidget (const QRect &Rect)
 Tells video output to embed video in an existing window. More...
virtual void StopEmbedding (void)
 Tells video output to stop embedding video in an existing window. More...
void ToggleAdjustFill (AdjustFillMode AdjustFillMode=kAdjustFill_Toggle)
 Sets up letterboxing for various standard video frame and monitor dimensions, then calls MoveResize() to apply them. More...
void ToggleAspectOverride (AspectOverrideMode AspectMode=kAspect_Toggle)
 Enforce different aspect ratio than detected, then calls VideoAspectRatioChanged(float) to apply them. More...
void ResizeDisplayWindow (const QRect &Rect, bool SaveVisibleRect)
 Resize Display Window. More...
void MoveResize (void)
 performs all the calculations for video framing and any resizing. More...
void Zoom (ZoomDirection Direction)
 Sets up zooming into to different parts of the video. More...
void ToggleMoveBottomLine (void)
void SaveBottomLine (void)
void SetVideoScalingAllowed (bool Change)
 Disable or enable underscan/overscan. More...
void SetDisplayAspect (float DisplayAspect)
void SetPIPState (PIPState Setting)
void SetWindowSize (QSize Size)
void SetITVResize (QRect Rect)
void SetRotation (int Rotation)
 Set the rotation in degrees. More...
void SetStereoscopicMode (StereoscopicMode Mode)
- Signals inherited from MythVideoBounds
void VideoSizeChanged (const QSize &VideoDim, const QSize &VideoDispDim)
void VideoRectsChanged (const QRect &DisplayVideoRect, const QRect &VideoRect)
void VisibleRectChanged (const QRect &DisplayVisibleRect)
void WindowRectChanged (const QRect &WindowRect)
- Static Protected Member Functions inherited from MythVideoOutput
static void CopyFrame (VideoFrame *To, const VideoFrame *From)
- Protected Attributes inherited from MythVideoOutputGPU
MythRenderm_render { nullptr }
MythVideoGPUm_video { nullptr }
MythPainterGPUm_painter { nullptr }
MythCodecID m_newCodecId { kCodec_NONE }
QSize m_newVideoDim { 0, 0 }
QSize m_newVideoDispDim { 0, 0 }
float m_newAspect { 0.0F }
bool m_newFrameRate { false }
bool m_buffersCreated { false }
QString m_profile
VideoVisualm_visual { nullptr }
QMap< MythPlayer *, MythVideoGPU * > m_pxpVideos
QMap< MythPlayer *, boolm_pxpVideosReady
MythVideoGPUm_pxpVideoActive { nullptr }
- Protected Attributes inherited from MythVideoOutput
MythVideoColourSpace m_videoColourSpace
LetterBoxColour m_dbLetterboxColour { kLetterBoxColour_Black }
MythCodecID m_videoCodecID { kCodec_NONE }
int m_maxReferenceFrames { 16 }
VideoDisplayProfilem_dbDisplayProfile { nullptr }
VideoBuffers m_videoBuffers
VideoErrorState m_errorState { kError_None }
long long m_framesPlayed { 0 }
MythAVCopy m_copyFrame
MythDeinterlacer m_deinterlacer
VideoFrameTypeVecm_renderFrameTypes { &s_defaultFrameTypes }
bool m_deinterlacing { false }
bool m_deinterlacing2X { false }
MythDeintType m_forcedDeinterlacer { DEINT_NONE }
- Protected Attributes inherited from MythVideoBounds
MythDisplaym_display {nullptr}

Detailed Description

Definition at line 12 of file mythvideooutopengl.h.

Member Enumeration Documentation

◆ TextureFormats


Definition at line 15 of file mythvideooutopengl.h.

Constructor & Destructor Documentation

◆ MythVideoOutputOpenGL()

MythVideoOutputOpenGL::MythVideoOutputOpenGL ( QString &  Profile)

Definition at line 114 of file mythvideooutopengl.cpp.

◆ ~MythVideoOutputOpenGL()

MythVideoOutputOpenGL::~MythVideoOutputOpenGL ( )

Definition at line 164 of file mythvideooutopengl.cpp.

Member Function Documentation

◆ GetRenderOptions()

void MythVideoOutputOpenGL::GetRenderOptions ( RenderOptions Options)

Generate the list of available OpenGL profiles.

This could be improved by eliminating unsupported profiles at run time - but it is currently called statically and hence options would be fixed and unable to reflect changes in UI render device.

Definition at line 43 of file mythvideooutopengl.cpp.

Referenced by MythVideoOutput::GetRenderOptions().

◆ GetAllowedRenderers()

QStringList MythVideoOutputOpenGL::GetAllowedRenderers ( MythCodecID  CodecId,
const QSize &  VideoDim 

Generate a list of supported OpenGL profiles.

Definition at line 367 of file mythvideooutopengl.cpp.

Referenced by MythVideoOutput::Create().

◆ Init()

bool MythVideoOutputOpenGL::Init ( const QSize &  VideoDim,
const QSize &  VideoDispDim,
float  Aspect,
const QRect &  DisplayVisibleRect,
MythCodecID  CodecId 

Reimplemented from MythVideoOutputGPU.

Definition at line 174 of file mythvideooutopengl.cpp.

◆ PrepareFrame()

void MythVideoOutputOpenGL::PrepareFrame ( VideoFrame Frame,
const PIPMap PiPPlayers,
FrameScanType  Scan 

Reimplemented from MythVideoOutputGPU.

Definition at line 231 of file mythvideooutopengl.cpp.

◆ RenderFrame()

void MythVideoOutputOpenGL::RenderFrame ( VideoFrame Frame,
FrameScanType  Scan,
OSD Osd 

Reimplemented from MythVideoOutputGPU.

Definition at line 257 of file mythvideooutopengl.cpp.

◆ EndFrame()

void MythVideoOutputOpenGL::EndFrame ( )

Reimplemented from MythVideoOutputGPU.

Definition at line 339 of file mythvideooutopengl.cpp.

◆ GetDisplayVisibleRectAdj()

QRect MythVideoOutputOpenGL::GetDisplayVisibleRectAdj ( )

Adjust the display rectangle for OpenGL coordinates in some cases.

Reimplemented from MythVideoOutputGPU.

Definition at line 201 of file mythvideooutopengl.cpp.

Referenced by MythVideoOutputOpenGL().

◆ CreateSecondaryVideo()

MythVideoGPU * MythVideoOutputOpenGL::CreateSecondaryVideo ( const QSize &  VideoDim,
const QSize &  VideoDispDim,
const QRect &  DisplayVisibleRect,
const QRect &  DisplayVideoRect,
const QRect &  VideoRect 

Implements MythVideoOutputGPU.

Definition at line 403 of file mythvideooutopengl.cpp.

Member Data Documentation

◆ s_openglFrameTypes

VideoFrameTypeVec MythVideoOutputOpenGL::s_openglFrameTypes

◆ s_openglFrameTypesLegacy

VideoFrameTypeVec MythVideoOutputOpenGL::s_openglFrameTypesLegacy
Initial value:

Definition at line 27 of file mythvideooutopengl.h.

Referenced by MythVideoOutputOpenGL().

◆ m_openglRender

MythRenderOpenGL* MythVideoOutputOpenGL::m_openglRender { nullptr }

◆ m_openGLPerf

MythOpenGLPerf* MythVideoOutputOpenGL::m_openGLPerf { nullptr }

The documentation for this class was generated from the following files:
@ FMT_YUV420P10
Definition: mythframe.h:24
@ FMT_YUV420P16
Definition: mythframe.h:27
@ FMT_YUV420P14
Definition: mythframe.h:26
@ FMT_YUV444P10
Definition: mythframe.h:44
@ FMT_YUV422P14
Definition: mythframe.h:39
@ FMT_P010
Definition: mythframe.h:52
Definition: mythframe.h:35
@ FMT_YUV444P14
Definition: mythframe.h:46
Definition: mythframe.h:42
@ FMT_YUV444P9
Definition: mythframe.h:43
@ FMT_YV12
Definition: mythframe.h:22
@ FMT_YUV422P10
Definition: mythframe.h:37
@ FMT_YUV444P16
Definition: mythframe.h:47
@ FMT_YUV420P12
Definition: mythframe.h:25
@ FMT_YUV444P12
Definition: mythframe.h:45
@ FMT_YUV422P9
Definition: mythframe.h:36
@ FMT_YUV420P9
Definition: mythframe.h:23
@ FMT_YUV422P16
Definition: mythframe.h:40
@ FMT_YUV422P12
Definition: mythframe.h:38
@ FMT_NV12
Definition: mythframe.h:51
@ FMT_P016
Definition: mythframe.h:53