MythTV  master
videoout_d3d.h
Go to the documentation of this file.
1 // -*- Mode: c++ -*-
2 
3 #ifndef VIDEOOUT_D3D_H_
4 #define VIDEOOUT_D3D_H_
5 
6 // MythTV headers
7 #include "mythvideoout.h"
8 #include "mythrender_d3d9.h"
9 #include "mythpainter_d3d9.h"
10 
11 #ifdef USING_DXVA2
12 #include "dxva2decoder.h"
13 #endif
14 
16 {
17  public:
18  static void GetRenderOptions(RenderOptions &Options);
21 
22  bool Init(const QSize &video_dim_buf, const QSize &video_dim_disp, float aspect,
23  WId winid, const QRect &win_rect, MythCodecID codec_id) override; // VideoOutput
24  void RenderFrame(MythVideoFrame *buffer, FrameScanType, OSD *osd) override; // VideoOutput
25  void PrepareFrame(MythVideoFrame *frame, const PIPMap &pipPlayers, FrameScanType scan) override; // VideoOutput
26  void EndFrame() override;
27  void WindowResized(const QSize &new_size) override; // VideoOutput
28  bool InputChanged(const QSize &video_dim_buf,
29  const QSize &video_dim_disp,
30  float aspect,
31  MythCodecID av_codec_id,
32  bool &aspect_only,
33  MythMultiLocker *Locks) override; // VideoOutput
34  void UpdatePauseFrame(std::chrono::milliseconds &disp_timecode, FrameScanType Scan = kScan_Progressive) override; // VideoOutput
35  void EmbedInWidget(const QRect &rect) override; // VideoOutput
36  void StopEmbedding(void) override; // VideoOutput
37  static QStringList GetAllowedRenderers(MythCodecID myth_codec_id,
38  const QSize &video_dim);
39  static MythCodecID GetBestSupportedCodec(uint width, uint height,
40  const QString &decoder,
41  uint stream_type,
42  bool no_acceleration,
43  AVPixelFormat &pix_fmt);
44 
45  void ShowPIP(MythPlayer *pipplayer, PIPLocation loc) override; // VideoOutput
46  void RemovePIP(MythPlayer *pipplayer) override; // VideoOutput
47  bool IsPIPSupported(void) const override // VideoOutput
48  { return true; }
49  MythPainter *GetOSDPainter(void) override; // VideoOutput
50 
51  bool CanVisualise(AudioPlayer *audio, MythRender */*render*/) override // VideoOutput
52  { return MythVideoOutput::CanVisualise(audio, (MythRender*)m_render); }
53  bool SetupVisualisation(AudioPlayer *audio, MythRender */*render*/,
54  const QString &name) override // VideoOutput
55  { return MythVideoOutput::SetupVisualisation(audio, (MythRender*)m_render, name); }
56 
57  private:
58  void TearDown(void);
59  bool SetupContext(void);
60  bool CreateBuffers(void);
61  bool InitBuffers(void);
62  bool CreatePauseFrame(void);
63  void SetProfile(void);
64  void DestroyContext(void);
65  void UpdateFrame(MythVideoFrame *frame, D3D9Image *img);
66 
67  private:
69 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
70  QMutex m_lock {QMutex::Recursive};
71 #else
72  QRecursiveMutex m_lock;
73 #endif
74  HWND m_hWnd {nullptr};
75  HWND m_hEmbedWnd {nullptr};
77  D3D9Image *m_video {nullptr};
78  bool m_renderValid {false};
79  bool m_renderReset {false};
80 
81  QMap<MythPlayer*,D3D9Image*> m_pips;
82  QMap<MythPlayer*,bool> m_pipReady {nullptr};
83  D3D9Image *m_pipActive {nullptr};
84 
86 
87  bool CreateDecoder(void);
88  void DeleteDecoder(void);
89 #ifdef USING_DXVA2
90  DXVA2Decoder *m_decoder {nullptr};
91 #endif
92  void *m_pauseSurface {nullptr};
93 };
94 
95 #endif
mythpainter_d3d9.h
VideoOutputD3D::CreateDecoder
bool CreateDecoder(void)
Definition: videoout_d3d.cpp:639
VideoOutputD3D::InitBuffers
bool InitBuffers(void)
Definition: videoout_d3d.cpp:268
VideoOutputD3D::PrepareFrame
void PrepareFrame(MythVideoFrame *frame, const PIPMap &pipPlayers, FrameScanType scan) override
Definition: videoout_d3d.cpp:461
MythVideoOutput
Definition: mythvideoout.h:35
mythvideoout.h
VideoOutputD3D::WindowResized
void WindowResized(const QSize &new_size) override
Definition: videoout_d3d.cpp:112
VideoOutputD3D::GetRenderOptions
static void GetRenderOptions(RenderOptions &Options)
Definition: videoout_d3d.cpp:32
AudioPlayer
Definition: audioplayer.h:28
VideoOutputD3D::m_hWnd
HWND m_hWnd
Definition: videoout_d3d.h:74
VideoOutputD3D::IsPIPSupported
bool IsPIPSupported(void) const override
Definition: videoout_d3d.h:47
VideoOutputD3D::GetOSDPainter
MythPainter * GetOSDPainter(void) override
Definition: videoout_d3d.cpp:617
VideoOutputD3D::VideoOutputD3D
VideoOutputD3D()
Definition: videoout_d3d.cpp:47
VideoOutputD3D::m_osdPainter
MythD3D9Painter * m_osdPainter
Definition: videoout_d3d.h:85
FrameScanType
FrameScanType
Definition: videoouttypes.h:94
VideoOutputD3D::m_hEmbedWnd
HWND m_hEmbedWnd
Definition: videoout_d3d.h:75
VideoOutputD3D::TearDown
void TearDown(void)
Definition: videoout_d3d.cpp:58
MythPlayer
Definition: mythplayer.h:86
dxva2decoder.h
VideoOutputD3D::CreatePauseFrame
bool CreatePauseFrame(void)
Definition: videoout_d3d.cpp:292
VideoOutputD3D::UpdatePauseFrame
void UpdatePauseFrame(std::chrono::milliseconds &disp_timecode, FrameScanType Scan=kScan_Progressive) override
Definition: videoout_d3d.cpp:412
VideoOutputD3D::m_render
MythRenderD3D9 * m_render
Definition: videoout_d3d.h:76
hardwareprofile.scan.scan
def scan(profile, smoonURL, gate)
Definition: scan.py:57
VideoOutputD3D::EndFrame
void EndFrame() override
Definition: videoout_d3d.cpp:378
VideoOutputD3D::m_pauseFrame
MythVideoFrame m_pauseFrame
Definition: videoout_d3d.h:68
MythCodecID
MythCodecID
Definition: mythcodecid.h:10
RenderOptions
Definition: mythvideoprofile.h:45
DXVA2Decoder
Definition: dxva2decoder.h:15
VideoOutputD3D::Init
bool Init(const QSize &video_dim_buf, const QSize &video_dim_disp, float aspect, WId winid, const QRect &win_rect, MythCodecID codec_id) override
Definition: videoout_d3d.cpp:193
kScan_Progressive
@ kScan_Progressive
Definition: videoouttypes.h:100
VideoOutputD3D::GetBestSupportedCodec
static MythCodecID GetBestSupportedCodec(uint width, uint height, const QString &decoder, uint stream_type, bool no_acceleration, AVPixelFormat &pix_fmt)
Definition: videoout_d3d.cpp:622
VideoOutputD3D::SetupContext
bool SetupContext(void)
Definition: videoout_d3d.cpp:173
D3D9Image
Definition: mythrender_d3d9.h:23
VideoOutputD3D::m_pipActive
D3D9Image * m_pipActive
Definition: videoout_d3d.h:83
VideoOutputD3D::DestroyContext
void DestroyContext(void)
Definition: videoout_d3d.cpp:86
VideoOutputD3D::m_lock
QRecursiveMutex m_lock
Definition: videoout_d3d.h:72
VideoOutputD3D::CanVisualise
bool CanVisualise(AudioPlayer *audio, MythRender *) override
Definition: videoout_d3d.h:51
MythRenderD3D9
Definition: mythrender_d3d9.h:62
VideoOutputD3D::CreateBuffers
bool CreateBuffers(void)
Definition: videoout_d3d.cpp:252
VideoOutputD3D::m_pauseSurface
void * m_pauseSurface
Definition: videoout_d3d.h:92
VideoOutputD3D::RemovePIP
void RemovePIP(MythPlayer *pipplayer) override
Definition: videoout_d3d.cpp:591
uint
unsigned int uint
Definition: compat.h:144
VideoOutputD3D::ShowPIP
void ShowPIP(MythPlayer *pipplayer, PIPLocation loc) override
Definition: videoout_d3d.cpp:528
VideoOutputD3D::m_pips
QMap< MythPlayer *, D3D9Image * > m_pips
Definition: videoout_d3d.h:81
VideoOutputD3D::m_decoder
DXVA2Decoder * m_decoder
Definition: videoout_d3d.h:90
MythRender
Definition: mythrender_base.h:23
MythPainter
Definition: mythpainter.h:32
MythD3D9Painter
Definition: mythpainter_d3d9.h:13
VideoOutputD3D::DeleteDecoder
void DeleteDecoder(void)
Definition: videoout_d3d.cpp:654
mythrender_d3d9.h
VideoOutputD3D::EmbedInWidget
void EmbedInWidget(const QRect &rect) override
Definition: videoout_d3d.cpp:395
VideoOutputD3D::RenderFrame
void RenderFrame(MythVideoFrame *buffer, FrameScanType, OSD *osd) override
Definition: videoout_d3d.cpp:307
VideoOutputD3D::m_renderReset
bool m_renderReset
Definition: videoout_d3d.h:79
VideoOutputD3D::StopEmbedding
void StopEmbedding(void) override
Definition: videoout_d3d.cpp:404
VideoOutputD3D::~VideoOutputD3D
~VideoOutputD3D()
Definition: videoout_d3d.cpp:53
VideoOutputD3D::m_video
D3D9Image * m_video
Definition: videoout_d3d.h:77
VideoOutputD3D::m_pipReady
QMap< MythPlayer *, bool > m_pipReady
Definition: videoout_d3d.h:82
MythVideoFrame
Definition: mythframe.h:88
VideoOutputD3D
Definition: videoout_d3d.h:15
VideoOutputD3D::UpdateFrame
void UpdateFrame(MythVideoFrame *frame, D3D9Image *img)
Definition: videoout_d3d.cpp:436
VideoOutputD3D::SetupVisualisation
bool SetupVisualisation(AudioPlayer *audio, MythRender *, const QString &name) override
Definition: videoout_d3d.h:53
VideoOutputD3D::m_renderValid
bool m_renderValid
Definition: videoout_d3d.h:78
VideoOutputD3D::InputChanged
bool InputChanged(const QSize &video_dim_buf, const QSize &video_dim_disp, float aspect, MythCodecID av_codec_id, bool &aspect_only, MythMultiLocker *Locks) override
Definition: videoout_d3d.cpp:125
OSD
Definition: osd.h:94
VideoOutputD3D::SetProfile
void SetProfile(void)
Definition: videoout_d3d.cpp:246
VideoOutputD3D::GetAllowedRenderers
static QStringList GetAllowedRenderers(MythCodecID myth_codec_id, const QSize &video_dim)
Definition: videoout_d3d.cpp:605