MythTV  master
mythvideogpu.h
Go to the documentation of this file.
1 #ifndef MYTHVIDEOGPU_H
2 #define MYTHVIDEOGPU_H
3 
4 // Qt
5 #include <QRect>
6 #include <QObject>
7 
8 // MythTV
10 #include "mythframe.h"
11 #include "mythvideocolourspace.h"
12 
13 // Std
14 #include <memory>
15 
16 class MythVideoBounds;
17 class MythVideoProfile;
18 using MythVideoProfilePtr = std::shared_ptr<MythVideoProfile>;
19 
20 class MythVideoGPU : public QObject
21 {
22  Q_OBJECT
23 
24  public:
26  {
27  None = 0x000,
28  Deinterlacer = 0x001,
29  Sampling = 0x002,
30  Performance = 0x004,
31  Framebuffer = 0x008,
32  ToneMap = 0x010,
33  Bicubic = 0x020
34  };
35 
36  Q_DECLARE_FLAGS(VideoResizing, VideoResize)
37 
38  static QString VideoResizeToString(VideoResizing Resize);
39 
40  ~MythVideoGPU() override;
41 
42  virtual void StartFrame () = 0;
44  virtual void RenderFrame (MythVideoFrame* Frame, bool TopFieldFirst, FrameScanType Scan,
45  StereoscopicMode StereoOverride, bool DrawBorder = false) = 0;
46  virtual void EndFrame () = 0;
47  virtual void ResetFrameFormat ();
48  virtual void ResetTextures () = 0;
49  virtual QString GetProfile () const;
50 
51  bool IsValid () const;
52  void SetProfile (const QString& Profile);
53  void SetMasterViewport (QSize Size);
54  QSize GetVideoDim () const;
55 
56  signals:
57  void OutputChanged (QSize VideoDim, QSize VideoDispDim, float);
58 
59  public slots:
60  void UpdateColourSpace (bool PrimariesChanged);
61  void SetVideoDimensions(QSize VideoDim, QSize VideoDispDim);
62  void SetVideoRects (QRect DisplayVideoRect, QRect VideoRect);
63  void SetViewportRect (QRect DisplayVisibleRect);
64  void UpscalerChanged (const QString& Upscaler);
65 
66  protected:
67  // Protecting this function means its not possible to create an
68  // instance of this base class. Because ColourSpaceUpdate is a
69  // pure virtual all sub-classes must override this function, which
70  // should make it safe to quiet the cppcheck warning about the
71  // constructor calling ColourSpaceUpdate.
72  MythVideoGPU(MythRender* Render, MythVideoColourSpace* ColourSpace,
73  MythVideoBounds* Bounds, const MythVideoProfilePtr& VideoProfile, QString Profile);
74  // cppcheck-suppress pureVirtualCall
75  virtual void ColourSpaceUpdate (bool PrimariesChanged) = 0;
76 
77  MythRender* m_render { nullptr };
78  uint64_t m_discontinuityCounter { 0 };
79  QString m_profile;
83  QSize m_videoDim;
86  QRect m_videoRect;
89  VideoResizing m_resizing { None };
90  int m_lastRotation { 0 };
92  bool m_deinterlacer2x { false };
93  bool m_valid { false };
94  bool m_viewportControl { true };
95  uint m_lastStereo { 0 }; // AV_STEREO3D_2D
97  bool m_bicubicUpsize { false };
98 };
99 
100 #endif
MythVideoGPU::VideoResize
VideoResize
Definition: mythvideogpu.h:25
MythVideoGPU::m_discontinuityCounter
uint64_t m_discontinuityCounter
Definition: mythvideogpu.h:78
MythVideoGPU::MythVideoGPU
MythVideoGPU(MythRender *Render, MythVideoColourSpace *ColourSpace, MythVideoBounds *Bounds, const MythVideoProfilePtr &VideoProfile, QString Profile)
Definition: mythvideogpu.cpp:9
MythVideoGPU::m_lastStereo
uint m_lastStereo
Definition: mythvideogpu.h:95
MythVideoGPU::m_inputTextureSize
QSize m_inputTextureSize
Definition: mythvideogpu.h:88
MythVideoGPU::Sampling
@ Sampling
Definition: mythvideogpu.h:29
MythVideoGPU::RenderFrame
virtual void RenderFrame(MythVideoFrame *Frame, bool TopFieldFirst, FrameScanType Scan, StereoscopicMode StereoOverride, bool DrawBorder=false)=0
MythVideoGPU::~MythVideoGPU
~MythVideoGPU() override
Definition: mythvideogpu.cpp:50
MythVideoGPU::m_lastRotation
int m_lastRotation
Definition: mythvideogpu.h:90
MythVideoGPU::m_resizing
VideoResizing m_resizing
Definition: mythvideogpu.h:89
MythVideoGPU::IsValid
bool IsValid() const
Definition: mythvideogpu.cpp:73
Frame
Definition: zmdefines.h:93
DEINT_NONE
@ DEINT_NONE
Definition: mythframe.h:69
MythVideoGPU::m_videoColourSpace
MythVideoColourSpace * m_videoColourSpace
Definition: mythvideogpu.h:87
FrameScanType
FrameScanType
Definition: videoouttypes.h:94
MythVideoGPU::m_bicubicUpsize
bool m_bicubicUpsize
Definition: mythvideogpu.h:97
MythVideoGPU::ToneMap
@ ToneMap
Definition: mythvideogpu.h:32
mythframe.h
MythVideoGPU::m_videoDim
QSize m_videoDim
Definition: mythvideogpu.h:83
MythVideoGPU::StartFrame
virtual void StartFrame()=0
MythVideoProfile
Definition: mythvideoprofile.h:83
FMT_NONE
@ FMT_NONE
Definition: mythframe.h:22
MythVideoGPU
Definition: mythvideogpu.h:20
MythVideoGPU::ResetTextures
virtual void ResetTextures()=0
MythVideoGPU::PrepareFrame
virtual void PrepareFrame(MythVideoFrame *Frame, FrameScanType Scan=kScan_Progressive)=0
MythVideoGPU::ColourSpaceUpdate
virtual void ColourSpaceUpdate(bool PrimariesChanged)=0
mythrender_base.h
mythvideocolourspace.h
MythVideoGPU::m_profile
QString m_profile
Definition: mythvideogpu.h:79
MythVideoGPU::Bicubic
@ Bicubic
Definition: mythvideogpu.h:33
kScan_Progressive
@ kScan_Progressive
Definition: videoouttypes.h:100
MythVideoGPU::m_videoDispDim
QSize m_videoDispDim
Definition: mythvideogpu.h:82
MythVideoGPU::SetVideoRects
void SetVideoRects(QRect DisplayVideoRect, QRect VideoRect)
Definition: mythvideogpu.cpp:126
MythVideoGPU::SetViewportRect
void SetViewportRect(QRect DisplayVisibleRect)
Definition: mythvideogpu.cpp:132
MythVideoGPU::SetMasterViewport
void SetMasterViewport(QSize Size)
Definition: mythvideogpu.cpp:88
MythVideoGPU::VideoResizeToString
static QString VideoResizeToString(VideoResizing Resize)
Definition: mythvideogpu.cpp:108
MythVideoGPU::m_deinterlacer
MythDeintType m_deinterlacer
Definition: mythvideogpu.h:91
MythVideoGPU::m_outputType
VideoFrameType m_outputType
Definition: mythvideogpu.h:81
uint
unsigned int uint
Definition: compat.h:81
MythVideoGPU::m_videoRect
QRect m_videoRect
Definition: mythvideogpu.h:86
MythVideoGPU::EndFrame
virtual void EndFrame()=0
MythVideoGPU::Deinterlacer
@ Deinterlacer
Definition: mythvideogpu.h:28
MythVideoGPU::OutputChanged
void OutputChanged(QSize VideoDim, QSize VideoDispDim, float)
MythVideoGPU::m_stereoMode
StereoscopicMode m_stereoMode
Definition: mythvideogpu.h:96
MythVideoBounds
Definition: mythvideobounds.h:23
StereoscopicMode
StereoscopicMode
Definition: videoouttypes.h:134
MythVideoGPU::m_displayVideoRect
QRect m_displayVideoRect
Definition: mythvideogpu.h:85
MythVideoGPU::m_render
MythRender * m_render
Definition: mythvideogpu.h:77
MythVideoGPU::m_viewportControl
bool m_viewportControl
Definition: mythvideogpu.h:94
MythDeintType
MythDeintType
Definition: mythframe.h:67
MythVideoGPU::GetProfile
virtual QString GetProfile() const
Definition: mythvideogpu.cpp:83
MythRender
Definition: mythrender_base.h:23
MythVideoGPU::UpscalerChanged
void UpscalerChanged(const QString &Upscaler)
Definition: mythvideogpu.cpp:65
MythVideoGPU::SetProfile
void SetProfile(const QString &Profile)
Definition: mythvideogpu.cpp:78
MythVideoGPU::m_valid
bool m_valid
Definition: mythvideogpu.h:93
MythVideoGPU::ResetFrameFormat
virtual void ResetFrameFormat()
Definition: mythvideogpu.cpp:98
VideoFrameType
VideoFrameType
Definition: mythframe.h:20
MythVideoGPU::UpdateColourSpace
void UpdateColourSpace(bool PrimariesChanged)
Definition: mythvideogpu.cpp:60
MythVideoProfilePtr
std::shared_ptr< MythVideoProfile > MythVideoProfilePtr
Definition: mythvideogpu.h:18
MythVideoGPU::m_deinterlacer2x
bool m_deinterlacer2x
Definition: mythvideogpu.h:92
MythVideoGPU::None
@ None
Definition: mythvideogpu.h:27
MythVideoGPU::SetVideoDimensions
void SetVideoDimensions(QSize VideoDim, QSize VideoDispDim)
Definition: mythvideogpu.cpp:120
MythVideoFrame
Definition: mythframe.h:88
MythVideoGPU::m_masterViewportSize
QSize m_masterViewportSize
Definition: mythvideogpu.h:84
kStereoscopicModeSideBySideDiscard
@ kStereoscopicModeSideBySideDiscard
Definition: videoouttypes.h:138
MythVideoColourSpace
MythVideoColourSpace contains a QMatrix4x4 that can convert YCbCr data to RGB.
Definition: mythvideocolourspace.h:18
MythVideoGPU::m_inputType
VideoFrameType m_inputType
Definition: mythvideogpu.h:80
MythVideoGPU::Performance
@ Performance
Definition: mythvideogpu.h:30
MythVideoGPU::GetVideoDim
QSize GetVideoDim() const
Definition: mythvideogpu.cpp:93
MythVideoGPU::Framebuffer
@ Framebuffer
Definition: mythvideogpu.h:31