MythTV  master
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
VideoOutputD3D Class Reference

#include <videoout_d3d.h>

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

Public Member Functions

 VideoOutputD3D ()
 
 ~VideoOutputD3D ()
 
bool Init (const QSize &video_dim_buf, const QSize &video_dim_disp, float aspect, WId winid, const QRect &win_rect, MythCodecID codec_id) override
 
void PrepareFrame (VideoFrame *buffer, FrameScanType, OSD *osd) override
 
void ProcessFrame (VideoFrame *frame, OSD *osd, const PIPMap &pipPlayers, FrameScanType scan) override
 
void Show (FrameScanType) override
 
void WindowResized (const QSize &new_size) override
 
bool InputChanged (const QSize &video_dim_buf, const QSize &video_dim_disp, float aspect, MythCodecID av_codec_id, bool &aspect_only, MythMultiLocker *Locks) override
 
void UpdatePauseFrame (int64_t &disp_timecode) override
 
void EmbedInWidget (const QRect &rect) override
 Tells video output to embed video in an existing window. More...
 
void StopEmbedding (void) override
 
void ShowPIP (VideoFrame *frame, MythPlayer *pipplayer, PIPLocation loc) override
 
void RemovePIP (MythPlayer *pipplayer) override
 
bool IsPIPSupported (void) const override
 
MythPainterGetOSDPainter (void) override
 
bool CanVisualise (AudioPlayer *audio, MythRender *) override
 
bool SetupVisualisation (AudioPlayer *audio, MythRender *, const QString &name) override
 
- Public Member Functions inherited from MythVideoOutput
 MythVideoOutput ()
 
virtual ~MythVideoOutput ()
 
virtual bool Init (const QSize &VideoDim, const QSize &VideoDispDim, float VideoAspect, MythDisplay *Display, const QRect &WindowRect, MythCodecID CodecID)
 
virtual void SetVideoFrameRate (float)
 
virtual void SetDeinterlacing (bool Enable, bool DoubleRate, MythDeintType Force=DEINT_NONE)
 
void SetReferenceFrames (int ReferenceFrames)
 
VideoDisplayProfileGetProfile ()
 
virtual bool InputChanged (const QSize &VideoDim, const QSize &VideoDispDim, float VideoAspect, MythCodecID CodecID, bool &AspectChanged, MythMultiLocker *Locks, int ReferenceFrames, bool ForceChange)
 Tells video output to discard decoded frames and wait for new ones. More...
 
virtual void VideoAspectRatioChanged (float VideoAspect)
 
virtual void ResizeDisplayWindow (const QRect &Rect, bool SaveVisible)
 Resize Display Window. More...
 
bool IsEmbedding (void)
 Returns if videooutput is embedding. More...
 
virtual void ResizeForVideo (int Width=0, int Height=0)
 
virtual void Zoom (ZoomDirection Direction)
 
virtual void ToggleMoveBottomLine (void)
 
virtual void SaveBottomLine (void)
 
virtual void GetOSDBounds (QRect &Total, QRect &Visible, float &VisibleAspect, float &FontScaling, float ThemeAspect) const
 
QRect GetMHEGBounds (void)
 
virtual float GetDisplayAspect (void) const
 
AspectOverrideMode GetAspectOverride (void) const
 
virtual void ToggleAspectOverride (AspectOverrideMode AspectMode=kAspect_Toggle)
 
AdjustFillMode GetAdjustFill (void) const
 
virtual void ToggleAdjustFill (AdjustFillMode FillMode=kAdjustFill_Toggle)
 
QString GetZoomString (void) const
 
PictureAttributeSupported GetSupportedPictureAttributes (void)
 
int ChangePictureAttribute (PictureAttribute AttributeType, bool Direction)
 
virtual int SetPictureAttribute (PictureAttribute Attribute, int NewValue)
 
int GetPictureAttribute (PictureAttribute AttributeType)
 
virtual void InitPictureAttributes (void)
 
virtual bool IsPBPSupported (void) const
 
bool HasSoftwareFrames (void) const
 
virtual void SetFramesPlayed (long long FramesPlayed)
 
virtual long long GetFramesPlayed (void)
 
bool IsErrored () const
 
VideoErrorState GetError (void) const
 
void SetPrebuffering (bool Normal)
 Sets whether to use a normal number of buffers or fewer buffers. More...
 
virtual void ClearAfterSeek (void)
 Tells video output to toss decoded buffers due to a seek. More...
 
virtual int ValidVideoFrames (void) const
 Returns number of frames that are fully decoded. More...
 
int FreeVideoFrames (void)
 Returns number of frames available for decoding onto. More...
 
bool EnoughFreeFrames (void)
 Returns true iff enough frames are available to decode onto. More...
 
bool EnoughDecodedFrames (void)
 Returns true iff there are plenty of decoded frames ready for display. More...
 
virtual VideoFrameTypeDirectRenderFormats (void)
 
virtual VideoFrameGetNextFreeFrame (void)
 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 (void)
 Tell GetLastShownFrame() to return the next frame from the head of the queue of frames to display. More...
 
virtual void DoneDisplayingFrame (VideoFrame *Frame)
 Releases frame returned from GetLastShownFrame() onto the queue of frames ready for decoding onto. More...
 
virtual void DiscardFrame (VideoFrame *frame)
 Releases frame from any queue onto the queue of frames ready for decoding onto. More...
 
virtual void DiscardFrames (bool KeyFrame, bool)
 Releases all frames not being actively displayed from any queue onto the queue of frames ready for decoding onto. More...
 
virtual void CheckFrameStates (void)
 
virtual VideoFrameGetLastDecodedFrame (void)
 
virtual VideoFrameGetLastShownFrame (void)
 Returns frame from the head of the ready to be displayed queue, if StartDisplayingFrame has been called. More...
 
QString GetFrameStatus (void) const
 Returns string with status of each frame for debugging. More...
 
void SetVideoResize (const QRect &VideoRect)
 Tells the player to resize the video frame (used for ITV) More...
 
void SetVideoScalingAllowed (bool Allow)
 Disable or enable underscan/overscan. More...
 
virtual QRect GetPIPRect (PIPLocation Location, MythPlayer *PiPPlayer=nullptr, bool DoPixelAdj=true) const
 returns QRect of PIP based on PIPLocation More...
 
virtual void SetPIPState (PIPState Setting)
 
QRect GetImageRect (const QRect &Rect, QRect *DisplayRect=nullptr)
 translates caption/dvd button rectangle into 'screen' space More...
 
QRect GetSafeRect (void)
 Returns a QRect describing an area of the screen on which it is 'safe' to render the On Screen Display. More...
 
bool EnableVisualisation (AudioPlayer *Audio, bool Enable, const QString &Name=QString(""))
 
VideoVisualGetVisualisation (void)
 
QString GetVisualiserName (void)
 
virtual QStringList GetVisualiserList (void)
 
void DestroyVisualisation (void)
 
virtual bool StereoscopicModesAllowed (void) const
 
void SetStereoscopicMode (StereoscopicMode mode)
 
StereoscopicMode GetStereoscopicMode (void) const
 

Static Public Member Functions

static void GetRenderOptions (RenderOptions &Options)
 
static QStringList GetAllowedRenderers (MythCodecID myth_codec_id, const QSize &video_dim)
 
static MythCodecID GetBestSupportedCodec (uint width, uint height, const QString &decoder, uint stream_type, bool no_acceleration, AVPixelFormat &pix_fmt)
 
- 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, QString &Codec, int ReferenceFrames)
 Depending on compile-time configure settings and run-time renderer settings, create a relevant VideoOutput subclass. More...
 
static int CalcHueBase (const QString &AdaptorName)
 
static MythDeintType ParseDeinterlacer (const QString &Deinterlacer)
 

Private Member Functions

void TearDown (void)
 
bool SetupContext (void)
 
bool CreateBuffers (void)
 
bool InitBuffers (void)
 
bool CreatePauseFrame (void)
 
void SetProfile (void)
 
void DestroyContext (void)
 
void UpdateFrame (VideoFrame *frame, D3D9Image *img)
 
bool CreateDecoder (void)
 
void DeleteDecoder (void)
 

Private Attributes

VideoFrame m_pauseFrame
 
QMutex m_lock {QMutex::Recursive}
 
HWND m_hWnd {nullptr}
 
HWND m_hEmbedWnd {nullptr}
 
MythRenderD3D9m_render {nullptr}
 
D3D9Imagem_video {nullptr}
 
bool m_renderValid {false}
 
bool m_renderReset {false}
 
QMap< MythPlayer *, D3D9Image * > m_pips
 
QMap< MythPlayer *, boolm_pipReady {nullptr}
 
D3D9Imagem_pipActive {nullptr}
 
MythD3D9Painterm_osdPainter {nullptr}
 
DXVA2Decoderm_decoder {nullptr}
 
void * m_pauseSurface {nullptr}
 

Additional Inherited Members

- Protected Member Functions inherited from MythVideoOutput
virtual void MoveResize (void)
 
void InitDisplayMeasurements (void)
 Init display measurements based on database settings and actual screen parameters. More...
 
virtual void ShowPIPs (VideoFrame *Frame, const PIPMap &PiPPlayers)
 
QRect GetVisibleOSDBounds (float &VisibleAspect, float &FontScaling, float ThemeAspect) const
 Returns visible portions of total OSD bounds. More...
 
QRect GetTotalOSDBounds (void) const
 
- Static Protected Member Functions inherited from MythVideoOutput
static void CopyFrame (VideoFrame *To, const VideoFrame *From)
 
- Protected Attributes inherited from MythVideoOutput
MythDisplaym_display {nullptr}
 
VideoOutWindow m_window
 
QSize m_dbDisplayDimensionsMM {0,0}
 
VideoColourSpace m_videoColourSpace
 
AspectOverrideMode m_dbAspectOverride {kAspect_Off}
 
AdjustFillMode m_dbAdjustFill {kAdjustFill_Off}
 
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}
 
QSize m_monitorSize {640,480}
 
QSize m_monitorDimensions {400,300}
 
VideoVisualm_visual {nullptr}
 
StereoscopicMode m_stereo {kStereoscopicModeNone}
 
MythAVCopy m_copyFrame
 
MythDeinterlacer m_deinterlacer
 

Detailed Description

Definition at line 15 of file videoout_d3d.h.

Constructor & Destructor Documentation

◆ VideoOutputD3D()

VideoOutputD3D::VideoOutputD3D ( void  )

Definition at line 48 of file videoout_d3d.cpp.

◆ ~VideoOutputD3D()

VideoOutputD3D::~VideoOutputD3D ( )

Definition at line 54 of file videoout_d3d.cpp.

Member Function Documentation

◆ GetRenderOptions()

void VideoOutputD3D::GetRenderOptions ( RenderOptions Options)
static

Definition at line 33 of file videoout_d3d.cpp.

Referenced by MythVideoOutput::GetRenderOptions().

◆ Init()

bool VideoOutputD3D::Init ( const QSize &  video_dim_buf,
const QSize &  video_dim_disp,
float  aspect,
WId  winid,
const QRect &  win_rect,
MythCodecID  codec_id 
)
override

Definition at line 194 of file videoout_d3d.cpp.

Referenced by InputChanged().

◆ PrepareFrame()

void VideoOutputD3D::PrepareFrame ( VideoFrame buffer,
FrameScanType  t,
OSD osd 
)
overridevirtual

Implements MythVideoOutput.

Definition at line 308 of file videoout_d3d.cpp.

◆ ProcessFrame()

void VideoOutputD3D::ProcessFrame ( VideoFrame frame,
OSD osd,
const PIPMap pipPlayers,
FrameScanType  scan 
)
overridevirtual

Implements MythVideoOutput.

Definition at line 463 of file videoout_d3d.cpp.

◆ Show()

void VideoOutputD3D::Show ( FrameScanType  )
overridevirtual

Implements MythVideoOutput.

Definition at line 380 of file videoout_d3d.cpp.

◆ WindowResized()

void VideoOutputD3D::WindowResized ( const QSize &  new_size)
overridevirtual

Reimplemented from MythVideoOutput.

Definition at line 113 of file videoout_d3d.cpp.

◆ InputChanged()

bool VideoOutputD3D::InputChanged ( const QSize &  video_dim_buf,
const QSize &  video_dim_disp,
float  aspect,
MythCodecID  av_codec_id,
bool aspect_only,
MythMultiLocker Locks 
)
override

Definition at line 126 of file videoout_d3d.cpp.

◆ UpdatePauseFrame()

void VideoOutputD3D::UpdatePauseFrame ( int64_t &  disp_timecode)
overridevirtual

Implements MythVideoOutput.

Definition at line 414 of file videoout_d3d.cpp.

◆ EmbedInWidget()

void VideoOutputD3D::EmbedInWidget ( const QRect &  EmbedRect)
overridevirtual

Tells video output to embed video in an existing window.

See also
StopEmbedding()

Reimplemented from MythVideoOutput.

Definition at line 397 of file videoout_d3d.cpp.

◆ StopEmbedding()

void VideoOutputD3D::StopEmbedding ( void  )
overridevirtual

Reimplemented from MythVideoOutput.

Definition at line 406 of file videoout_d3d.cpp.

◆ GetAllowedRenderers()

QStringList VideoOutputD3D::GetAllowedRenderers ( MythCodecID  myth_codec_id,
const QSize &  video_dim 
)
static

Definition at line 612 of file videoout_d3d.cpp.

Referenced by MythVideoOutput::Create().

◆ GetBestSupportedCodec()

MythCodecID VideoOutputD3D::GetBestSupportedCodec ( uint  width,
uint  height,
const QString &  decoder,
uint  stream_type,
bool  no_acceleration,
AVPixelFormat &  pix_fmt 
)
static

Definition at line 629 of file videoout_d3d.cpp.

Referenced by MythCodecContext::FindDecoder().

◆ ShowPIP()

void VideoOutputD3D::ShowPIP ( VideoFrame frame,
MythPlayer pipplayer,
PIPLocation  loc 
)
overridevirtual

Reimplemented from MythVideoOutput.

Definition at line 533 of file videoout_d3d.cpp.

◆ RemovePIP()

void VideoOutputD3D::RemovePIP ( MythPlayer pipplayer)
overridevirtual

Reimplemented from MythVideoOutput.

Definition at line 598 of file videoout_d3d.cpp.

◆ IsPIPSupported()

bool VideoOutputD3D::IsPIPSupported ( void  ) const
inlineoverridevirtual

Reimplemented from MythVideoOutput.

Definition at line 53 of file videoout_d3d.h.

◆ GetOSDPainter()

MythPainter * VideoOutputD3D::GetOSDPainter ( void  )
overridevirtual

Reimplemented from MythVideoOutput.

Definition at line 624 of file videoout_d3d.cpp.

◆ CanVisualise()

bool VideoOutputD3D::CanVisualise ( AudioPlayer audio,
MythRender  
)
inlineoverridevirtual

Reimplemented from MythVideoOutput.

Definition at line 57 of file videoout_d3d.h.

◆ SetupVisualisation()

bool VideoOutputD3D::SetupVisualisation ( AudioPlayer audio,
MythRender ,
const QString &  name 
)
inlineoverridevirtual

Reimplemented from MythVideoOutput.

Definition at line 59 of file videoout_d3d.h.

◆ TearDown()

void VideoOutputD3D::TearDown ( void  )
private

Definition at line 59 of file videoout_d3d.cpp.

Referenced by Init(), InputChanged(), and ~VideoOutputD3D().

◆ SetupContext()

bool VideoOutputD3D::SetupContext ( void  )
private

Definition at line 174 of file videoout_d3d.cpp.

Referenced by Init(), and ProcessFrame().

◆ CreateBuffers()

bool VideoOutputD3D::CreateBuffers ( void  )
private

Definition at line 253 of file videoout_d3d.cpp.

Referenced by Init().

◆ InitBuffers()

bool VideoOutputD3D::InitBuffers ( void  )
private

Definition at line 269 of file videoout_d3d.cpp.

Referenced by Init().

◆ CreatePauseFrame()

bool VideoOutputD3D::CreatePauseFrame ( void  )
private

Definition at line 293 of file videoout_d3d.cpp.

Referenced by Init().

◆ SetProfile()

void VideoOutputD3D::SetProfile ( void  )
private

Definition at line 247 of file videoout_d3d.cpp.

Referenced by Init().

◆ DestroyContext()

void VideoOutputD3D::DestroyContext ( void  )
private

Definition at line 87 of file videoout_d3d.cpp.

Referenced by SetupContext(), and TearDown().

◆ UpdateFrame()

void VideoOutputD3D::UpdateFrame ( VideoFrame frame,
D3D9Image img 
)
private

Definition at line 438 of file videoout_d3d.cpp.

Referenced by ProcessFrame(), and ShowPIP().

◆ CreateDecoder()

bool VideoOutputD3D::CreateDecoder ( void  )
private

Definition at line 646 of file videoout_d3d.cpp.

Referenced by Init(), and ProcessFrame().

◆ DeleteDecoder()

void VideoOutputD3D::DeleteDecoder ( void  )
private

Definition at line 661 of file videoout_d3d.cpp.

Referenced by CreateDecoder(), and TearDown().

Member Data Documentation

◆ m_pauseFrame

VideoFrame VideoOutputD3D::m_pauseFrame
private

◆ m_lock

QMutex VideoOutputD3D::m_lock {QMutex::Recursive}
private

◆ m_hWnd

HWND VideoOutputD3D::m_hWnd {nullptr}
private

Definition at line 76 of file videoout_d3d.h.

Referenced by Init(), InputChanged(), and SetupContext().

◆ m_hEmbedWnd

HWND VideoOutputD3D::m_hEmbedWnd {nullptr}
private

Definition at line 77 of file videoout_d3d.h.

Referenced by Show().

◆ m_render

MythRenderD3D9* VideoOutputD3D::m_render {nullptr}
private

◆ m_video

D3D9Image* VideoOutputD3D::m_video {nullptr}
private

Definition at line 79 of file videoout_d3d.h.

Referenced by DestroyContext(), PrepareFrame(), ProcessFrame(), and SetupContext().

◆ m_renderValid

bool VideoOutputD3D::m_renderValid {false}
private

Definition at line 80 of file videoout_d3d.h.

Referenced by DestroyContext(), PrepareFrame(), ProcessFrame(), SetupContext(), and Show().

◆ m_renderReset

bool VideoOutputD3D::m_renderReset {false}
private

Definition at line 81 of file videoout_d3d.h.

Referenced by DestroyContext(), PrepareFrame(), ProcessFrame(), and Show().

◆ m_pips

QMap<MythPlayer*,D3D9Image*> VideoOutputD3D::m_pips
private

Definition at line 83 of file videoout_d3d.h.

Referenced by DestroyContext(), PrepareFrame(), RemovePIP(), and ShowPIP().

◆ m_pipReady

QMap<MythPlayer*,bool> VideoOutputD3D::m_pipReady {nullptr}
private

Definition at line 84 of file videoout_d3d.h.

Referenced by DestroyContext(), PrepareFrame(), RemovePIP(), and ShowPIP().

◆ m_pipActive

D3D9Image* VideoOutputD3D::m_pipActive {nullptr}
private

Definition at line 85 of file videoout_d3d.h.

Referenced by PrepareFrame(), and ShowPIP().

◆ m_osdPainter

MythD3D9Painter* VideoOutputD3D::m_osdPainter {nullptr}
private

Definition at line 87 of file videoout_d3d.h.

Referenced by GetOSDPainter(), Init(), PrepareFrame(), and TearDown().

◆ m_decoder

DXVA2Decoder* VideoOutputD3D::m_decoder {nullptr}
private

Definition at line 92 of file videoout_d3d.h.

Referenced by CreateDecoder(), DeleteDecoder(), and InitBuffers().

◆ m_pauseSurface

void* VideoOutputD3D::m_pauseSurface {nullptr}
private

Definition at line 94 of file videoout_d3d.h.

Referenced by ProcessFrame(), and UpdatePauseFrame().


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