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#include "libmythbase/mythconfig.h"
7
8// MythTV headers
9#include "mythvideooutgpu.h"
12
13#if CONFIG_DXVA2
14#include "dxva2decoder.h"
15#endif
16
18{
19 public:
20 static void GetRenderOptions(RenderOptions &Options);
21 VideoOutputD3D(MythMainWindow* MainWindow, MythRenderD3D9* Render,
22 MythD3D9Painter* Painter, MythDisplay* Display,
23 const MythVideoProfilePtr& VideoProfile, QString& Profile);
25
26 bool Init(QSize video_dim_buf, QSize video_dim_disp, float video_aspect,
27 QRect win_rect, MythCodecID codec_id) override; // VideoOutput
28 void RenderFrame(MythVideoFrame *buffer, FrameScanType) override; // VideoOutput
29 void RenderEnd() override; // VideoOutput
30 void PrepareFrame(MythVideoFrame *frame, FrameScanType scan) override; // VideoOutput
31 void EndFrame() override;
32 bool InputChanged(QSize video_dim_buf,
33 QSize video_dim_disp,
34 float video_aspect,
35 MythCodecID av_codec_id,
36 bool &aspect_only,
37 int reference_frames,
38 bool force_change) override; // VideoOutput
39 void UpdatePauseFrame(std::chrono::milliseconds &disp_timecode, FrameScanType Scan = kScan_Progressive) override; // VideoOutput
40 static QStringList GetAllowedRenderers(MythCodecID myth_codec_id,
41 const QSize &video_dim);
42 static MythCodecID GetSupportedCodec(AVCodecContext **Context,
43 const AVCodec ** Codec,
44 const QString &decoder,
45 uint stream_type);
46
47 private:
48 void TearDown(void);
49 bool SetupContext(void);
50 bool CreateBuffers(void);
51 bool InitBuffers(void);
52 void SetProfile(void);
53 void DestroyContext(void);
54 void UpdateFrame(MythVideoFrame *frame, D3D9Image *img);
55
56 private:
58 QRecursiveMutex m_lock;
59 HWND m_hWnd {nullptr};
61 D3D9Image *m_video {nullptr};
62 bool m_renderValid {false};
63 bool m_renderReset {false};
64
65 bool CreateDecoder(void);
66 void DeleteDecoder(void);
67#if CONFIG_DXVA2
68 DXVA2Decoder *m_decoder {nullptr};
69#endif
70 void *m_pauseSurface {nullptr};
71};
72
73#endif
Common code shared between GPU accelerated sub-classes (e.g. OpenGL)
void UpdateFrame(MythVideoFrame *frame, D3D9Image *img)
bool Init(QSize video_dim_buf, QSize video_dim_disp, float video_aspect, QRect win_rect, MythCodecID codec_id) override
D3D9Image * m_video
Definition: videoout_d3d.h:61
static void GetRenderOptions(RenderOptions &Options)
bool CreateDecoder(void)
void SetProfile(void)
MythRenderD3D9 * m_render
Definition: videoout_d3d.h:60
MythVideoFrame m_pauseFrame
Definition: videoout_d3d.h:57
static MythCodecID GetSupportedCodec(AVCodecContext **Context, const AVCodec **Codec, const QString &decoder, uint stream_type)
void PrepareFrame(MythVideoFrame *frame, FrameScanType scan) override
static QStringList GetAllowedRenderers(MythCodecID myth_codec_id, const QSize &video_dim)
void DestroyContext(void)
void EndFrame() override
void UpdatePauseFrame(std::chrono::milliseconds &disp_timecode, FrameScanType Scan=kScan_Progressive) override
bool InitBuffers(void)
bool SetupContext(void)
void RenderEnd() override
bool CreateBuffers(void)
VideoOutputD3D(MythMainWindow *MainWindow, MythRenderD3D9 *Render, MythD3D9Painter *Painter, MythDisplay *Display, const MythVideoProfilePtr &VideoProfile, QString &Profile)
void DeleteDecoder(void)
void TearDown(void)
bool InputChanged(QSize video_dim_buf, QSize video_dim_disp, float video_aspect, MythCodecID av_codec_id, bool &aspect_only, int reference_frames, bool force_change) override
Tells video output to discard decoded frames and wait for new ones.
void RenderFrame(MythVideoFrame *buffer, FrameScanType) override
void * m_pauseSurface
Definition: videoout_d3d.h:70
QRecursiveMutex m_lock
Definition: videoout_d3d.h:58
unsigned int uint
Definition: freesurround.h:24
MythCodecID
Definition: mythcodecid.h:14
std::shared_ptr< MythVideoProfile > MythVideoProfilePtr
Definition: mythvideogpu.h:18
def scan(profile, smoonURL, gate)
Definition: scan.py:54
FrameScanType
Definition: videoouttypes.h:95
@ kScan_Progressive