MythTV  master
mythvideooutgpu.h
Go to the documentation of this file.
1 #ifndef MYTHVIDEOOUTGPU_H
2 #define MYTHVIDEOOUTGPU_H
3 
4 // MythTV
5 #include "mythvideoout.h"
6 
7 class MythMainWindow;
8 class MythVideoGPU;
9 class MythPainterGPU;
10 
12 {
13  Q_OBJECT
14 
15  public:
16  static void GetRenderOptions(RenderOptions& Options, MythRender* Render);
17  static MythVideoOutputGPU* Create(MythMainWindow* MainWindow, MythRender* Render,
18  MythPainter* Painter, MythDisplay* Display,
19  const QString& Decoder,
20  MythCodecID CodecID, QSize VideoDim,
21  QSize VideoDispDim, float VideoAspect,
22  float FrameRate, uint PlayerFlags,
23  const QString& Codec, int ReferenceFrames,
24  const VideoFrameTypes*& RenderFormats);
26  ~MythVideoOutputGPU() override;
27 
28  signals:
29  void ChangePictureAttribute(PictureAttribute Attribute, bool Direction, int Value);
30  void PictureAttributeChanged(PictureAttribute Attribute, int Value);
32  void PictureAttributesUpdated(const std::map<PictureAttribute,int>& Values);
33  void RefreshState();
34  void DoRefreshState();
35 
36  public slots:
37  void WindowResized (QSize Size);
38  void ResizeForVideo (QSize Size = QSize());
39 
40  public:
41  void InitPictureAttributes () override;
42  void SetVideoFrameRate (float NewRate) override;
43  void DiscardFrames (bool KeyFrame, bool Flushed) override;
44  void DoneDisplayingFrame (MythVideoFrame* Frame) override;
45  void UpdatePauseFrame (int64_t& DisplayTimecode, FrameScanType Scan = kScan_Progressive) override;
46  bool InputChanged (QSize VideoDim, QSize VideoDispDim,
47  float Aspect, MythCodecID CodecId, bool& AspectOnly,
48  int ReferenceFrames, bool ForceChange) override;
49  void EndFrame () override;
50  void ClearAfterSeek () override;
51 
52  protected:
53  MythVideoOutputGPU(MythMainWindow* MainWindow, MythRender* Render,
54  MythPainterGPU* Painter, MythDisplay* Display,
55  MythVideoProfilePtr VideoProfile, QString& Profile);
56  virtual QRect GetDisplayVisibleRectAdj();
57  bool Init (QSize VideoDim, QSize VideoDispDim, float Aspect,
58  QRect DisplayVisibleRect, MythCodecID CodecId) override;
59  void PrepareFrame (MythVideoFrame* Frame, FrameScanType Scan) override;
60  void RenderFrame (MythVideoFrame* Frame, FrameScanType Scan) override;
61  void RenderOverlays (OSD& Osd) override;
62  bool CreateBuffers (MythCodecID CodecID, QSize Size);
63  void DestroyBuffers ();
64  bool ProcessInputChange ();
66  void SetReferenceFrames (int ReferenceFrames);
67 
69  MythRender* m_render { nullptr };
70  MythVideoGPU* m_video { nullptr };
71  MythPainterGPU* m_painter { nullptr };
73  QSize m_newVideoDim { 0, 0 };
74  QSize m_newVideoDispDim { 0, 0 };
75  float m_newAspect { 0.0F };
76  bool m_newFrameRate { false };
77  bool m_buffersCreated { false };
78  QString m_profile;
79  bool m_needFullClear { false };
80 
81  private:
82  Q_DISABLE_COPY(MythVideoOutputGPU)
83 };
84 
85 #endif
MythVideoOutputGPU::InitPictureAttributes
void InitPictureAttributes() override
Definition: mythvideooutgpu.cpp:254
PictureAttributeSupported
PictureAttributeSupported
Definition: videoouttypes.h:116
MythVideoOutputGPU::DiscardFrames
void DiscardFrames(bool KeyFrame, bool Flushed) override
Discard video frames.
Definition: mythvideooutgpu.cpp:332
MythVideoOutputGPU::SetVideoFrameRate
void SetVideoFrameRate(float NewRate) override
Definition: mythvideooutgpu.cpp:265
MythVideoOutput
Definition: mythvideoout.h:35
mythvideoout.h
MythVideoOutputGPU::RefreshState
void RefreshState()
MythVideoOutputGPU::InitDisplayMeasurements
void InitDisplayMeasurements()
Initialise display measurement.
Definition: mythvideooutgpu.cpp:543
MythVideoOutputGPU::DestroyBuffers
void DestroyBuffers()
Definition: mythvideooutgpu.cpp:414
kCodec_NONE
@ kCodec_NONE
Definition: mythcodecid.h:14
MythVideoOutputGPU::InputChanged
bool InputChanged(QSize VideoDim, QSize VideoDispDim, float Aspect, MythCodecID CodecId, bool &AspectOnly, int ReferenceFrames, bool ForceChange) override
Tells video output to discard decoded frames and wait for new ones.
Definition: mythvideooutgpu.cpp:426
Frame
Definition: zmdefines.h:93
MythVideoOutputGPU::m_render
MythRender * m_render
Definition: mythvideooutgpu.h:69
MythVideoOutputGPU::PictureAttributesUpdated
void PictureAttributesUpdated(const std::map< PictureAttribute, int > &Values)
FrameScanType
FrameScanType
Definition: videoouttypes.h:94
MythVideoOutputGPU::m_profile
QString m_profile
Definition: mythvideooutgpu.h:78
MythVideoOutputGPU::ClearAfterSeek
void ClearAfterSeek() override
Tells video output to toss decoded buffers due to a seek.
Definition: mythvideooutgpu.cpp:681
PlayerFlags
PlayerFlags
Definition: mythplayer.h:62
MythVideoOutputGPU::ResizeForVideo
void ResizeForVideo(QSize Size=QSize())
Definition: mythvideooutgpu.cpp:701
MythVideoOutputGPU::Init
bool Init(QSize VideoDim, QSize VideoDispDim, float Aspect, QRect DisplayVisibleRect, MythCodecID CodecId) override
Definition: mythvideooutgpu.cpp:279
MythVideoOutputGPU::m_newVideoDispDim
QSize m_newVideoDispDim
Definition: mythvideooutgpu.h:74
MythVideoOutputGPU::GetRenderOptions
static void GetRenderOptions(RenderOptions &Options, MythRender *Render)
Definition: mythvideooutgpu.cpp:20
MythVideoGPU
Definition: mythvideogpu.h:20
MythVideoOutputGPU::DoneDisplayingFrame
void DoneDisplayingFrame(MythVideoFrame *Frame) override
Release a video frame back into the decoder pool.
Definition: mythvideooutgpu.cpp:353
MythCodecID
MythCodecID
Definition: mythcodecid.h:10
MythVideoOutputGPU::m_mainWindow
MythMainWindow * m_mainWindow
Definition: mythvideooutgpu.h:68
Decoder
Definition: decoder.h:65
RenderOptions
Definition: mythvideoprofile.h:41
kScan_Progressive
@ kScan_Progressive
Definition: videoouttypes.h:100
MythVideoOutputGPU::RenderOverlays
void RenderOverlays(OSD &Osd) override
Definition: mythvideooutgpu.cpp:640
VideoFrameTypes
std::vector< VideoFrameType > VideoFrameTypes
Definition: mythframe.h:82
MythVideoOutputGPU::PictureAttributeChanged
void PictureAttributeChanged(PictureAttribute Attribute, int Value)
MythVideoOutputGPU::m_newCodecId
MythCodecID m_newCodecId
Definition: mythvideooutgpu.h:72
MythVideoOutputGPU::m_newFrameRate
bool m_newFrameRate
Definition: mythvideooutgpu.h:76
FrameRate
Definition: recorderbase.h:36
MythVideoOutputGPU::UpdatePauseFrame
void UpdatePauseFrame(int64_t &DisplayTimecode, FrameScanType Scan=kScan_Progressive) override
Definition: mythvideooutgpu.cpp:646
MythVideoOutputGPU::Create
static MythVideoOutputGPU * Create(MythMainWindow *MainWindow, MythRender *Render, MythPainter *Painter, MythDisplay *Display, const QString &Decoder, MythCodecID CodecID, QSize VideoDim, QSize VideoDispDim, float VideoAspect, float FrameRate, uint PlayerFlags, const QString &Codec, int ReferenceFrames, const VideoFrameTypes *&RenderFormats)
Definition: mythvideooutgpu.cpp:33
MythVideoOutputGPU::m_buffersCreated
bool m_buffersCreated
Definition: mythvideooutgpu.h:77
MythVideoOutputGPU::m_newVideoDim
QSize m_newVideoDim
Definition: mythvideooutgpu.h:73
uint
unsigned int uint
Definition: compat.h:141
MythVideoOutputGPU::m_newAspect
float m_newAspect
Definition: mythvideooutgpu.h:75
MythVideoOutputGPU::SetReferenceFrames
void SetReferenceFrames(int ReferenceFrames)
Definition: mythvideooutgpu.cpp:421
MythDisplay
Definition: mythdisplay.h:21
MythVideoOutputGPU::PrepareFrame
void PrepareFrame(MythVideoFrame *Frame, FrameScanType Scan) override
Definition: mythvideooutgpu.cpp:578
MythVideoOutputGPU::m_needFullClear
bool m_needFullClear
Definition: mythvideooutgpu.h:79
MythVideoOutputGPU::FrameTypeForCodec
static VideoFrameType FrameTypeForCodec(MythCodecID CodecId)
Definition: mythvideooutgpu.cpp:173
MythVideoOutputGPU::ProcessInputChange
bool ProcessInputChange()
Definition: mythvideooutgpu.cpp:483
PictureAttribute
PictureAttribute
Definition: videoouttypes.h:103
MythVideoOutputGPU::ChangePictureAttribute
void ChangePictureAttribute(PictureAttribute Attribute, bool Direction, int Value)
MythRender
Definition: mythrender_base.h:23
MythPainter
Definition: mythpainter.h:32
MythVideoOutputGPU::MythVideoOutputGPU
MythVideoOutputGPU(MythMainWindow *MainWindow, MythRender *Render, MythPainterGPU *Painter, MythDisplay *Display, MythVideoProfilePtr VideoProfile, QString &Profile)
Definition: mythvideooutgpu.cpp:197
MythVideoOutputGPU::RenderFrame
void RenderFrame(MythVideoFrame *Frame, FrameScanType Scan) override
Definition: mythvideooutgpu.cpp:599
MythVideoOutputGPU::CreateBuffers
bool CreateBuffers(MythCodecID CodecID, QSize Size)
Definition: mythvideooutgpu.cpp:385
MythVideoOutputGPU::DoRefreshState
void DoRefreshState()
MythVideoOutputGPU
Common code shared between GPU accelerated sub-classes (e.g. OpenGL)
Definition: mythvideooutgpu.h:11
MythVideoOutputGPU::SupportedAttributesChanged
void SupportedAttributesChanged(PictureAttributeSupported Supported)
VideoFrameType
VideoFrameType
Definition: mythframe.h:19
MythVideoOutputGPU::m_video
MythVideoGPU * m_video
Definition: mythvideooutgpu.h:70
MythVideoOutputGPU::GetDisplayVisibleRectAdj
virtual QRect GetDisplayVisibleRectAdj()
Definition: mythvideooutgpu.cpp:249
MythVideoProfilePtr
std::shared_ptr< MythVideoProfile > MythVideoProfilePtr
Definition: mythvideogpu.h:18
MythVideoOutputGPU::m_painter
MythPainterGPU * m_painter
Definition: mythvideooutgpu.h:71
MythVideoFrame
Definition: mythframe.h:87
MythVideoOutputGPU::~MythVideoOutputGPU
~MythVideoOutputGPU() override
Definition: mythvideooutgpu.cpp:239
MythVideoOutputGPU::EndFrame
void EndFrame() override
Definition: mythvideooutgpu.cpp:676
OSD
Definition: osd.h:94
MythMainWindow
Definition: mythmainwindow.h:34
MythPainterGPU
Definition: mythpaintergpu.h:11
MythVideoOutputGPU::WindowResized
void WindowResized(QSize Size)
Definition: mythvideooutgpu.cpp:259