MythTV  master
Public Member Functions | Static Public Member Functions | Static Public Attributes | 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
 
virtual bool Init (QSize VideoDim, QSize VideoDispDim, float VideoAspect, QRect WindowRect, MythCodecID CodecID)
 
virtual void SetVideoFrameRate (float playback_fps)
 
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...
 
const VideoFrameTypesDirectRenderFormats () const
 
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...
 
virtual void ResizeForVideo (QSize=QSize())
 
PictureAttributeSupported GetSupportedPictureAttributes ()
 
int GetPictureAttribute (PictureAttribute AttributeType)
 
virtual void InitPictureAttributes ()
 
bool HasSoftwareFrames () const
 
virtual void RenderOverlays (OSD &)
 
virtual void UpdatePauseFrame (int64_t &, 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)
 

Static Public Attributes

static VideoFrameTypes s_defaultFrameTypes = { FMT_YV12 }
 

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 }
 
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
 
VideoFrameTypesm_renderFrameTypes { &s_defaultFrameTypes }
 
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 30 of file mythvideoout.h.

Constructor & Destructor Documentation

◆ ~MythVideoOutput()

MythVideoOutput::~MythVideoOutput ( )
override

Definition at line 132 of file mythvideoout.cpp.

◆ MythVideoOutput()

MythVideoOutput::MythVideoOutput ( )
protected

Definition at line 123 of file mythvideoout.cpp.

Member Function Documentation

◆ GetRenderOptions()

void MythVideoOutput::GetRenderOptions ( RenderOptions Options)
static

Definition at line 37 of file mythvideoout.cpp.

Referenced by VideoDisplayProfile::InitStatics().

◆ Init()

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

◆ SetVideoFrameRate()

void MythVideoOutput::SetVideoFrameRate ( float  playback_fps)
virtual

Reimplemented in MythVideoOutputGPU.

Definition at line 167 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 MythVideoOutputNull, and MythVideoOutputGPU.

Definition at line 217 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 ( void  )
virtual

Definition at line 285 of file mythvideoout.cpp.

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

◆ IsErrored()

bool MythVideoOutput::IsErrored ( void  ) const

◆ GetError()

VideoErrorState MythVideoOutput::GetError ( void  ) const

Definition at line 295 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 301 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 307 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 319 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 325 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 332 of file mythvideoout.cpp.

Referenced by MythPlayer::PrebufferEnoughFrames().

◆ DirectRenderFormats()

const VideoFrameTypes * MythVideoOutput::DirectRenderFormats ( void  ) const

Definition at line 422 of file mythvideoout.cpp.

Referenced by MythPlayer::DirectRenderFormats().

◆ GetNextFreeFrame()

MythVideoFrame * MythVideoOutput::GetNextFreeFrame ( )
virtual

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

Definition at line 430 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 437 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 443 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 450 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 457 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 464 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 471 of file mythvideoout.cpp.

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

◆ CheckFrameStates()

virtual void MythVideoOutput::CheckFrameStates ( )
inlinevirtual

Definition at line 73 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 344 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 357 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 411 of file mythvideoout.cpp.

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

◆ ResizeForVideo()

virtual void MythVideoOutput::ResizeForVideo ( QSize  = QSize())
inlinevirtual

Reimplemented in MythVideoOutputGPU.

Definition at line 81 of file mythvideoout.h.

Referenced by TV::Embed().

◆ GetSupportedPictureAttributes()

PictureAttributeSupported MythVideoOutput::GetSupportedPictureAttributes ( )

◆ GetPictureAttribute()

int MythVideoOutput::GetPictureAttribute ( PictureAttribute  AttributeType)

Definition at line 275 of file mythvideoout.cpp.

Referenced by TV::DoTogglePictureAttribute(), and TV::GetStatus().

◆ InitPictureAttributes()

virtual void MythVideoOutput::InitPictureAttributes ( )
inlinevirtual

Reimplemented in MythVideoOutputGPU.

Definition at line 84 of file mythvideoout.h.

◆ HasSoftwareFrames()

bool MythVideoOutput::HasSoftwareFrames ( ) const
inline

Definition at line 85 of file mythvideoout.h.

Referenced by TV::PlaybackMenuInit().

◆ RenderOverlays()

virtual void MythVideoOutput::RenderOverlays ( OSD )
inlinevirtual

Reimplemented in MythVideoOutputGPU, and MythVideoOutputNull.

Definition at line 86 of file mythvideoout.h.

Referenced by MythPlayerUI::RenderVideoFrame().

◆ UpdatePauseFrame()

virtual void MythVideoOutput::UpdatePauseFrame ( int64_t &  ,
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 252 of file mythvideoout.cpp.

Referenced by GetOSDBounds(), and GetSafeRect().

Member Data Documentation

◆ s_defaultFrameTypes

VideoFrameTypes MythVideoOutput::s_defaultFrameTypes = { FMT_YV12 }
static

Definition at line 36 of file mythvideoout.h.

Referenced by MythPlayer::DirectRenderFormats().

◆ 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(), and MythVideoOutputOpenGL::RenderFrame().

◆ m_videoCodecID

MythCodecID MythVideoOutput::m_videoCodecID { kCodec_NONE }
protected

◆ m_maxReferenceFrames

int MythVideoOutput::m_maxReferenceFrames { 16 }
protected

◆ m_dbDisplayProfile

VideoDisplayProfile* MythVideoOutput::m_dbDisplayProfile { 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 102 of file mythvideoout.h.

Referenced by VideoOutputD3D::UpdateFrame().

◆ m_deinterlacer

MythDeinterlacer MythVideoOutput::m_deinterlacer
protected

◆ m_renderFrameTypes

VideoFrameTypes* MythVideoOutput::m_renderFrameTypes { &s_defaultFrameTypes }
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: