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 video_aspect, WId winid, const QRect &win_rect, MythCodecID codec_id) override
 
void RenderFrame (MythVideoFrame *buffer, FrameScanType, OSD *osd) override
 
void PrepareFrame (MythVideoFrame *frame, const PIPMap &pipPlayers, FrameScanType scan) override
 
void EndFrame () override
 
void WindowResized (const QSize &new_size) override
 
bool InputChanged (const QSize &video_dim_buf, const QSize &video_dim_disp, float video_aspect, MythCodecID av_codec_id, bool &aspect_only, MythMultiLocker *Locks) override
 
void UpdatePauseFrame (std::chrono::milliseconds &disp_timecode, FrameScanType Scan=kScan_Progressive) override
 
void EmbedInWidget (const QRect &rect) override
 
void StopEmbedding (void) override
 
void ShowPIP (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 () 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 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
 
- 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 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, MythRender *Render)
 

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 (MythVideoFrame *frame, D3D9Image *img)
 
bool CreateDecoder (void)
 
void DeleteDecoder (void)
 

Private Attributes

MythVideoFrame m_pauseFrame
 
QRecursiveMutex m_lock
 
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

- 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)
 
- Protected Member Functions inherited from MythVideoOutput
 MythVideoOutput ()
 
QRect GetVisibleOSDBounds (float &VisibleAspect, float &FontScaling, float ThemeAspect) const
 Returns visible portions of total OSD bounds. More...
 
- Protected Attributes inherited from MythVideoOutput
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}
 

Detailed Description

Definition at line 15 of file videoout_d3d.h.

Constructor & Destructor Documentation

◆ VideoOutputD3D()

VideoOutputD3D::VideoOutputD3D ( )

Definition at line 47 of file videoout_d3d.cpp.

◆ ~VideoOutputD3D()

VideoOutputD3D::~VideoOutputD3D ( )

Definition at line 53 of file videoout_d3d.cpp.

Member Function Documentation

◆ GetRenderOptions()

void VideoOutputD3D::GetRenderOptions ( RenderOptions Options)
static

Definition at line 32 of file videoout_d3d.cpp.

◆ Init()

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

Definition at line 193 of file videoout_d3d.cpp.

Referenced by InputChanged().

◆ RenderFrame()

void VideoOutputD3D::RenderFrame ( MythVideoFrame buffer,
FrameScanType  t,
OSD osd 
)
override

Definition at line 307 of file videoout_d3d.cpp.

◆ PrepareFrame()

void VideoOutputD3D::PrepareFrame ( MythVideoFrame frame,
const PIPMap &  pipPlayers,
FrameScanType  scan 
)
override

Definition at line 461 of file videoout_d3d.cpp.

◆ EndFrame()

void VideoOutputD3D::EndFrame ( )
overridevirtual

Implements MythVideoOutput.

Definition at line 378 of file videoout_d3d.cpp.

◆ WindowResized()

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

Definition at line 112 of file videoout_d3d.cpp.

◆ InputChanged()

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

Definition at line 125 of file videoout_d3d.cpp.

◆ UpdatePauseFrame()

void VideoOutputD3D::UpdatePauseFrame ( std::chrono::milliseconds &  disp_timecode,
FrameScanType  Scan = kScan_Progressive 
)
overridevirtual

Reimplemented from MythVideoOutput.

Definition at line 412 of file videoout_d3d.cpp.

◆ EmbedInWidget()

void VideoOutputD3D::EmbedInWidget ( const QRect &  rect)
override

Definition at line 395 of file videoout_d3d.cpp.

◆ StopEmbedding()

void VideoOutputD3D::StopEmbedding ( void  )
override

Definition at line 404 of file videoout_d3d.cpp.

◆ GetAllowedRenderers()

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

Definition at line 605 of file videoout_d3d.cpp.

◆ GetBestSupportedCodec()

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

Definition at line 622 of file videoout_d3d.cpp.

Referenced by MythCodecContext::FindDecoder().

◆ ShowPIP()

void VideoOutputD3D::ShowPIP ( MythPlayer pipplayer,
PIPLocation  loc 
)
override

Definition at line 528 of file videoout_d3d.cpp.

◆ RemovePIP()

void VideoOutputD3D::RemovePIP ( MythPlayer pipplayer)
override

Definition at line 591 of file videoout_d3d.cpp.

◆ IsPIPSupported()

bool VideoOutputD3D::IsPIPSupported ( void  ) const
inlineoverride

Definition at line 47 of file videoout_d3d.h.

◆ GetOSDPainter()

MythPainter * VideoOutputD3D::GetOSDPainter ( void  )
override

Definition at line 617 of file videoout_d3d.cpp.

◆ CanVisualise()

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

Definition at line 51 of file videoout_d3d.h.

◆ SetupVisualisation()

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

Definition at line 53 of file videoout_d3d.h.

◆ TearDown()

void VideoOutputD3D::TearDown ( void  )
private

Definition at line 58 of file videoout_d3d.cpp.

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

◆ SetupContext()

bool VideoOutputD3D::SetupContext ( void  )
private

Definition at line 173 of file videoout_d3d.cpp.

Referenced by Init(), and PrepareFrame().

◆ CreateBuffers()

bool VideoOutputD3D::CreateBuffers ( void  )
private

Definition at line 252 of file videoout_d3d.cpp.

Referenced by Init().

◆ InitBuffers()

bool VideoOutputD3D::InitBuffers ( void  )
private

Definition at line 268 of file videoout_d3d.cpp.

Referenced by Init().

◆ CreatePauseFrame()

bool VideoOutputD3D::CreatePauseFrame ( void  )
private

Definition at line 292 of file videoout_d3d.cpp.

Referenced by Init().

◆ SetProfile()

void VideoOutputD3D::SetProfile ( void  )
private

Definition at line 246 of file videoout_d3d.cpp.

Referenced by Init().

◆ DestroyContext()

void VideoOutputD3D::DestroyContext ( void  )
private

Definition at line 86 of file videoout_d3d.cpp.

Referenced by SetupContext(), and TearDown().

◆ UpdateFrame()

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

Definition at line 436 of file videoout_d3d.cpp.

Referenced by PrepareFrame(), and ShowPIP().

◆ CreateDecoder()

bool VideoOutputD3D::CreateDecoder ( void  )
private

Definition at line 639 of file videoout_d3d.cpp.

Referenced by Init(), and PrepareFrame().

◆ DeleteDecoder()

void VideoOutputD3D::DeleteDecoder ( void  )
private

Definition at line 654 of file videoout_d3d.cpp.

Referenced by CreateDecoder(), and TearDown().

Member Data Documentation

◆ m_pauseFrame

MythVideoFrame VideoOutputD3D::m_pauseFrame
private

◆ m_lock

QRecursiveMutex VideoOutputD3D::m_lock
private

◆ m_hWnd

HWND VideoOutputD3D::m_hWnd {nullptr}
private

Definition at line 74 of file videoout_d3d.h.

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

◆ m_hEmbedWnd

HWND VideoOutputD3D::m_hEmbedWnd {nullptr}
private

Definition at line 75 of file videoout_d3d.h.

Referenced by EndFrame().

◆ m_render

MythRenderD3D9* VideoOutputD3D::m_render {nullptr}
private

◆ m_video

D3D9Image* VideoOutputD3D::m_video {nullptr}
private

Definition at line 77 of file videoout_d3d.h.

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

◆ m_renderValid

bool VideoOutputD3D::m_renderValid {false}
private

Definition at line 78 of file videoout_d3d.h.

Referenced by DestroyContext(), EndFrame(), PrepareFrame(), RenderFrame(), and SetupContext().

◆ m_renderReset

bool VideoOutputD3D::m_renderReset {false}
private

Definition at line 79 of file videoout_d3d.h.

Referenced by DestroyContext(), EndFrame(), PrepareFrame(), and RenderFrame().

◆ m_pips

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

Definition at line 81 of file videoout_d3d.h.

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

◆ m_pipReady

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

Definition at line 82 of file videoout_d3d.h.

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

◆ m_pipActive

D3D9Image* VideoOutputD3D::m_pipActive {nullptr}
private

Definition at line 83 of file videoout_d3d.h.

Referenced by RenderFrame(), and ShowPIP().

◆ m_osdPainter

MythD3D9Painter* VideoOutputD3D::m_osdPainter {nullptr}
private

Definition at line 85 of file videoout_d3d.h.

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

◆ m_decoder

DXVA2Decoder* VideoOutputD3D::m_decoder {nullptr}
private

Definition at line 90 of file videoout_d3d.h.

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

◆ m_pauseSurface

void* VideoOutputD3D::m_pauseSurface {nullptr}
private

Definition at line 92 of file videoout_d3d.h.

Referenced by PrepareFrame(), and UpdatePauseFrame().


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