MythTV  master
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MythVideoOutput Class Referenceabstract

#include <mythvideoout.h>

Inheritance diagram for MythVideoOutput:
Inheritance graph
[legend]
Collaboration diagram for MythVideoOutput:
Collaboration graph
[legend]

Public Member Functions

 ~MythVideoOutput () override=default
 
virtual bool Init (QSize VideoDim, QSize VideoDispDim, float VideoAspect, QRect WindowRect, MythCodecID CodecID)
 
virtual void SetVideoFrameRate (float VideoFrameRate)
 
virtual void SetDeinterlacing (bool Enable, bool DoubleRate, MythDeintType Force=DEINT_NONE)
 
virtual void PrepareFrame (MythVideoFrame *Frame, FrameScanType Scan=kScan_Ignore)=0
 
virtual void RenderFrame (MythVideoFrame *Frame, FrameScanType)=0
 
virtual void RenderEnd ()=0
 
virtual void EndFrame ()=0
 
virtual bool InputChanged (QSize VideoDim, QSize VideoDispDim, float VideoAspect, MythCodecID CodecID, bool &AspectChanged, int ReferenceFrames, bool ForceChange)
 Tells video output to discard decoded frames and wait for new ones. More...
 
virtual void GetOSDBounds (QRect &Total, QRect &Visible, float &VisibleAspect, float &FontScaling, float ThemeAspect) 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 void ClearAfterSeek ()
 Tells video output to toss decoded buffers due to a seek. 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...
 
virtual MythVideoFrameGetNextFreeFrame ()
 Blocks until it is possible to return a frame for decoding onto. More...
 
virtual void ReleaseFrame (MythVideoFrame *Frame)
 Releases a frame from the ready for decoding queue onto the queue of frames ready for display. More...
 
virtual void DeLimboFrame (MythVideoFrame *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 DoneDisplayingFrame (MythVideoFrame *Frame)
 Releases frame returned from GetLastShownFrame() onto the queue of frames ready for decoding onto. More...
 
virtual void DiscardFrame (MythVideoFrame *Frame)
 Releases frame from any queue onto the queue of frames ready for decoding onto. More...
 
virtual void DiscardFrames (bool KeyFrame, bool Flushed)
 Releases all frames not being actively displayed from any queue onto the queue of frames ready for decoding onto. More...
 
virtual void CheckFrameStates ()
 
virtual MythVideoFrameGetLastDecodedFrame ()
 
virtual MythVideoFrameGetLastShownFrame ()
 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 (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...
 
PictureAttributeSupported GetSupportedPictureAttributes ()
 
virtual void InitPictureAttributes ()
 
bool HasSoftwareFrames () const
 
virtual void UpdatePauseFrame (std::chrono::milliseconds &, FrameScanType=kScan_Progressive)
 
- Public Member Functions inherited from MythVideoBounds
 MythVideoBounds ()
 
 ~MythVideoBounds () override=default
 
bool InitBounds (QSize VideoDim, QSize VideoDispDim, float Aspect, QRect WindowRect)
 
void SetDisplay (MythDisplay *mDisplay)
 
bool IsEmbedding (void) const
 
bool IsEmbeddingAndHidden () const
 
QSize GetVideoDim (void) const
 
QSize GetVideoDispDim (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
 
AdjustFillMode GetAdjustFill (void) const
 
float GetVideoAspect (void) const
 
float GetDisplayAspect (void) const
 
StereoscopicMode GetStereoOverride () 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...
 

Static Public Member Functions

static void GetRenderOptions (RenderOptions &Options, MythRender *Render)
 

Protected Member Functions

 MythVideoOutput ()
 
QRect GetVisibleOSDBounds (float &VisibleAspect, float &FontScaling, float ThemeAspect) const
 Returns visible portions of total OSD bounds. More...
 

Protected Attributes

MythVideoColourSpace m_videoColourSpace
 
LetterBoxColour m_dbLetterboxColour { kLetterBoxColour_Black }
 
uint8_t m_clearColor { 0 }
 
uint8_t m_clearAlpha { 255 }
 
MythCodecID m_videoCodecID { kCodec_NONE }
 
int m_maxReferenceFrames { 16 }
 
MythVideoProfilePtr m_videoProfile { nullptr }
 
VideoBuffers m_videoBuffers
 
VideoErrorState m_errorState { kError_None }
 
long long m_framesPlayed { 0 }
 
MythAVCopy m_copyFrame
 
MythDeinterlacer m_deinterlacer
 
const VideoFrameTypesm_renderFormats { &MythVideoFrame::kDefaultRenderFormats }
 
bool m_deinterlacing { false }
 
bool m_deinterlacing2X { false }
 
MythDeintType m_forcedDeinterlacer { DEINT_NONE }
 
- Protected Attributes inherited from MythVideoBounds
MythDisplaym_display {nullptr}
 

Additional Inherited Members

- Public Slots inherited from MythVideoBounds
void RefreshVideoBoundsState ()
 Send out latest state to listeners. More...
 
void ScreenChanged (QScreen *screen)
 
void PhysicalDPIChanged (qreal)
 
void SourceChanged (QSize VideoDim, 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 EmbedPlayback (bool Embed, QRect Rect)
 
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 (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 SetWindowSize (QSize Size)
 
void SetITVResize (QRect Rect)
 
void SetRotation (int Rotation)
 Set the rotation in degrees. More...
 
void SetStereoOverride (StereoscopicMode Mode)
 
- Signals inherited from MythVideoBounds
void UpdateOSDMessage (const QString &Message)
 
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)
 
void VideoBoundsStateChanged (MythVideoBoundsState VideoState)
 

Detailed Description

Definition at line 35 of file mythvideoout.h.

Constructor & Destructor Documentation

◆ ~MythVideoOutput()

MythVideoOutput::~MythVideoOutput ( )
overridedefault

◆ MythVideoOutput()

MythVideoOutput::MythVideoOutput ( )
protected

Definition at line 99 of file mythvideoout.cpp.

Member Function Documentation

◆ GetRenderOptions()

void MythVideoOutput::GetRenderOptions ( RenderOptions Options,
MythRender Render 
)
static

Definition at line 24 of file mythvideoout.cpp.

Referenced by MythVideoProfile::InitStatics().

◆ Init()

bool MythVideoOutput::Init ( QSize  VideoDim,
QSize  VideoDispDim,
float  VideoAspect,
QRect  WindowRect,
MythCodecID  CodecID 
)
virtual

◆ SetVideoFrameRate()

void MythVideoOutput::SetVideoFrameRate ( float  VideoFrameRate)
virtual

Reimplemented in MythVideoOutputGPU.

Definition at line 135 of file mythvideoout.cpp.

Referenced by MythPlayer::ChangeSpeed(), and MythPlayer::ReinitVideo().

◆ SetDeinterlacing()

void MythVideoOutput::SetDeinterlacing ( bool  Enable,
bool  DoubleRate,
MythDeintType  Force = DEINT_NONE 
)
virtual

◆ PrepareFrame()

virtual void MythVideoOutput::PrepareFrame ( MythVideoFrame Frame,
FrameScanType  Scan = kScan_Ignore 
)
pure virtual

◆ RenderFrame()

virtual void MythVideoOutput::RenderFrame ( MythVideoFrame Frame,
FrameScanType   
)
pure virtual

◆ RenderEnd()

virtual void MythVideoOutput::RenderEnd ( )
pure virtual

◆ EndFrame()

virtual void MythVideoOutput::EndFrame ( )
pure virtual

◆ InputChanged()

bool MythVideoOutput::InputChanged ( QSize  VideoDim,
QSize  VideoDispDim,
float  VideoAspect,
MythCodecID  CodecID,
bool AspectChanged,
int  ReferenceFrames,
bool  ForceChange 
)
virtual

Tells video output to discard decoded frames and wait for new ones.

Bug:
We set the new width height and aspect ratio here, but we should do this based on the new video frames in Show().

Reimplemented in MythVideoOutputGPU, MythVideoOutputNull, and VideoOutputD3D.

Definition at line 187 of file mythvideoout.cpp.

Referenced by MythVideoOutputNull::InputChanged(), and MythPlayer::ReinitVideo().

◆ GetOSDBounds()

void MythVideoOutput::GetOSDBounds ( QRect &  Total,
QRect &  Visible,
float &  VisibleAspect,
float &  FontScaling,
float  ThemeAspect 
) const
virtual

◆ SetFramesPlayed()

void MythVideoOutput::SetFramesPlayed ( long long  FramesPlayed)
virtual

◆ GetFramesPlayed()

long long MythVideoOutput::GetFramesPlayed ( )
virtual

Definition at line 250 of file mythvideoout.cpp.

Referenced by MythPlayer::Pause(), and MythPlayerUI::VideoLoop().

◆ IsErrored()

bool MythVideoOutput::IsErrored ( ) const

◆ GetError()

VideoErrorState MythVideoOutput::GetError ( ) const

Definition at line 260 of file mythvideoout.cpp.

Referenced by MythPlayer::SetErrored().

◆ SetPrebuffering()

void MythVideoOutput::SetPrebuffering ( bool  Normal)

Sets whether to use a normal number of buffers or fewer buffers.

Definition at line 266 of file mythvideoout.cpp.

Referenced by MythPlayer::ChangeSpeed().

◆ ClearAfterSeek()

void MythVideoOutput::ClearAfterSeek ( )
virtual

Tells video output to toss decoded buffers due to a seek.

Reimplemented in MythVideoOutputGPU.

Definition at line 272 of file mythvideoout.cpp.

Referenced by MythVideoOutputGPU::ClearAfterSeek(), and MythPlayer::ClearAfterSeek().

◆ ValidVideoFrames()

int MythVideoOutput::ValidVideoFrames ( ) const
virtual

◆ FreeVideoFrames()

int MythVideoOutput::FreeVideoFrames ( )

Returns number of frames available for decoding onto.

Definition at line 284 of file mythvideoout.cpp.

Referenced by MythPlayer::GetFreeVideoFrames(), and MythPlayerUI::GetPlaybackData().

◆ EnoughFreeFrames()

bool MythVideoOutput::EnoughFreeFrames ( )

Returns true iff enough frames are available to decode onto.

Definition at line 290 of file mythvideoout.cpp.

Referenced by MythPlayer::DecoderGetFrame(), MythPlayer::PrebufferEnoughFrames(), and MythDVDPlayer::VideoLoop().

◆ EnoughDecodedFrames()

bool MythVideoOutput::EnoughDecodedFrames ( )

Returns true iff there are plenty of decoded frames ready for display.

Definition at line 297 of file mythvideoout.cpp.

Referenced by MythPlayer::PrebufferEnoughFrames().

◆ GetNextFreeFrame()

MythVideoFrame * MythVideoOutput::GetNextFreeFrame ( )
virtual

Blocks until it is possible to return a frame for decoding onto.

Definition at line 390 of file mythvideoout.cpp.

Referenced by MythPlayer::GetNextVideoFrame().

◆ ReleaseFrame()

void MythVideoOutput::ReleaseFrame ( MythVideoFrame Frame)
virtual

Releases a frame from the ready for decoding queue onto the queue of frames ready for display.

Definition at line 397 of file mythvideoout.cpp.

Referenced by MythPlayer::ReleaseNextVideoFrame().

◆ DeLimboFrame()

void MythVideoOutput::DeLimboFrame ( MythVideoFrame Frame)
virtual

Releases a frame for reuse if it is in limbo.

Definition at line 403 of file mythvideoout.cpp.

Referenced by MythPlayer::DeLimboFrame().

◆ StartDisplayingFrame()

void MythVideoOutput::StartDisplayingFrame ( )
virtual

Tell GetLastShownFrame() to return the next frame from the head of the queue of frames to display.

Definition at line 410 of file mythvideoout.cpp.

Referenced by MythPlayerUI::DisplayNormalFrame(), MythCommFlagPlayer::GetRawVideoFrame(), MythCCExtractorPlayer::OnGotNewFrame(), and VideoPerformanceTest::Test().

◆ DoneDisplayingFrame()

void MythVideoOutput::DoneDisplayingFrame ( MythVideoFrame Frame)
virtual

Releases frame returned from GetLastShownFrame() onto the queue of frames ready for decoding onto.

Reimplemented in MythVideoOutputGPU.

Definition at line 417 of file mythvideoout.cpp.

Referenced by MythPlayerUI::DisplayNormalFrame(), MythCCExtractorPlayer::OnGotNewFrame(), VideoPerformanceTest::Test(), and Transcode::TranscodeFile().

◆ DiscardFrame()

void MythVideoOutput::DiscardFrame ( MythVideoFrame Frame)
virtual

Releases frame from any queue onto the queue of frames ready for decoding onto.

Definition at line 424 of file mythvideoout.cpp.

Referenced by MythPlayer::DiscardVideoFrame().

◆ DiscardFrames()

void MythVideoOutput::DiscardFrames ( bool  KeyFrame,
bool  Flushed 
)
virtual

Releases all frames not being actively displayed from any queue onto the queue of frames ready for decoding onto.

Reimplemented in MythVideoOutputGPU.

Definition at line 431 of file mythvideoout.cpp.

Referenced by MythVideoOutputGPU::DiscardFrames(), MythPlayer::DiscardVideoFrames(), and InputChanged().

◆ CheckFrameStates()

virtual void MythVideoOutput::CheckFrameStates ( )
inlinevirtual

Definition at line 76 of file mythvideoout.h.

◆ GetLastDecodedFrame()

MythVideoFrame * MythVideoOutput::GetLastDecodedFrame ( )
virtual

◆ GetLastShownFrame()

MythVideoFrame * MythVideoOutput::GetLastShownFrame ( )
virtual

◆ GetFrameStatus()

QString MythVideoOutput::GetFrameStatus ( ) const

Returns string with status of each frame for debugging.

Definition at line 309 of file mythvideoout.cpp.

Referenced by MythPlayer::PrebufferEnoughFrames().

◆ GetImageRect()

QRect MythVideoOutput::GetImageRect ( QRect  Rect,
QRect *  DisplayRect = nullptr 
)

translates caption/dvd button rectangle into 'screen' space

Definition at line 322 of file mythvideoout.cpp.

Referenced by SubtitleScreen::AddScaledImage(), MythBDOverlayScreen::DisplayBDOverlay(), and SubtitleScreen::DisplayScaledAVSubtitles().

◆ GetSafeRect()

QRect MythVideoOutput::GetSafeRect ( )

Returns a QRect describing an area of the screen on which it is 'safe' to render the On Screen Display.

For 'fullscreen' OSDs this will still translate to a subset of the video frame area to ensure consistency of presentation for subtitling etc.

Definition at line 376 of file mythvideoout.cpp.

Referenced by SubtitleScreen::DisplayCC608Subtitles(), SubtitleScreen::DisplayCC708Subtitles(), SubtitleScreen::DisplayRawTextSubtitles(), and TeletextScreen::Pulse().

◆ GetSupportedPictureAttributes()

PictureAttributeSupported MythVideoOutput::GetSupportedPictureAttributes ( )

Definition at line 240 of file mythvideoout.cpp.

◆ InitPictureAttributes()

virtual void MythVideoOutput::InitPictureAttributes ( )
inlinevirtual

Reimplemented in MythVideoOutputGPU.

Definition at line 85 of file mythvideoout.h.

◆ HasSoftwareFrames()

bool MythVideoOutput::HasSoftwareFrames ( ) const
inline

Definition at line 86 of file mythvideoout.h.

Referenced by TV::PlaybackMenuInit().

◆ UpdatePauseFrame()

virtual void MythVideoOutput::UpdatePauseFrame ( std::chrono::milliseconds &  ,
FrameScanType  = kScan_Progressive 
)
inlinevirtual

◆ GetVisibleOSDBounds()

QRect MythVideoOutput::GetVisibleOSDBounds ( float &  VisibleAspect,
float &  FontScaling,
float  ThemeAspect 
) const
protected

Returns visible portions of total OSD bounds.

Parameters
VisibleAspectphysical aspect ratio of bounds returned
FontScalingscaling to apply to fonts
ThemeAspectaspect ration of the theme

Definition at line 222 of file mythvideoout.cpp.

Referenced by GetOSDBounds(), and GetSafeRect().

Member Data Documentation

◆ m_videoColourSpace

MythVideoColourSpace MythVideoOutput::m_videoColourSpace
protected

◆ m_dbLetterboxColour

LetterBoxColour MythVideoOutput::m_dbLetterboxColour { kLetterBoxColour_Black }
protected

Definition at line 95 of file mythvideoout.h.

Referenced by MythVideoOutput().

◆ m_clearColor

uint8_t MythVideoOutput::m_clearColor { 0 }
protected

Definition at line 96 of file mythvideoout.h.

Referenced by MythVideoOutput(), and MythVideoOutputOpenGL::RenderFrame().

◆ m_clearAlpha

uint8_t MythVideoOutput::m_clearAlpha { 255 }
protected

◆ m_videoCodecID

MythCodecID MythVideoOutput::m_videoCodecID { kCodec_NONE }
protected

◆ m_maxReferenceFrames

int MythVideoOutput::m_maxReferenceFrames { 16 }
protected

◆ m_videoProfile

MythVideoProfilePtr MythVideoOutput::m_videoProfile { nullptr }
protected

◆ m_videoBuffers

VideoBuffers MythVideoOutput::m_videoBuffers
protected

◆ m_errorState

VideoErrorState MythVideoOutput::m_errorState { kError_None }
protected

◆ m_framesPlayed

long long MythVideoOutput::m_framesPlayed { 0 }
protected

◆ m_copyFrame

MythAVCopy MythVideoOutput::m_copyFrame
protected

Definition at line 104 of file mythvideoout.h.

Referenced by VideoOutputD3D::UpdateFrame().

◆ m_deinterlacer

MythDeinterlacer MythVideoOutput::m_deinterlacer
protected

◆ m_renderFormats

const VideoFrameTypes* MythVideoOutput::m_renderFormats { &MythVideoFrame::kDefaultRenderFormats }
protected

◆ m_deinterlacing

bool MythVideoOutput::m_deinterlacing { false }
protected

◆ m_deinterlacing2X

bool MythVideoOutput::m_deinterlacing2X { false }
protected

◆ m_forcedDeinterlacer

MythDeintType MythVideoOutput::m_forcedDeinterlacer { DEINT_NONE }
protected

The documentation for this class was generated from the following files: