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
9 #include "mythrender_base.h"
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(MythRender* Render, MythVideoColourSpace* ColourSpace,
41  MythVideoBounds* Bounds, const MythVideoProfilePtr& VideoProfile, QString Profile);
42  ~MythVideoGPU() override;
43 
44  virtual void StartFrame () = 0;
46  virtual void RenderFrame (MythVideoFrame* Frame, bool TopFieldFirst, FrameScanType Scan,
47  StereoscopicMode StereoOverride, bool DrawBorder = false) = 0;
48  virtual void EndFrame () = 0;
49  virtual void ResetFrameFormat ();
50  virtual void ResetTextures () = 0;
51  virtual QString GetProfile () const;
52 
53  bool IsValid () const;
54  void SetProfile (const QString& Profile);
55  void SetMasterViewport (QSize Size);
56  QSize GetVideoDim () const;
57 
58  signals:
59  void OutputChanged (QSize VideoDim, QSize VideoDispDim, float);
60 
61  public slots:
62  void UpdateColourSpace (bool PrimariesChanged);
63  void SetVideoDimensions(QSize VideoDim, QSize VideoDispDim);
64  void SetVideoRects (QRect DisplayVideoRect, QRect VideoRect);
65  void SetViewportRect (QRect DisplayVisibleRect);
66  void UpscalerChanged (const QString& Upscaler);
67 
68  protected:
69  virtual void ColourSpaceUpdate (bool PrimariesChanged) = 0;
70 
71  MythRender* m_render { nullptr };
72  uint64_t m_discontinuityCounter { 0 };
73  QString m_profile;
77  QSize m_videoDim;
80  QRect m_videoRect;
83  VideoResizing m_resizing { None };
84  int m_lastRotation { 0 };
86  bool m_deinterlacer2x { false };
87  bool m_valid { false };
88  bool m_viewportControl { true };
89  uint m_lastStereo { 0 }; // AV_STEREO3D_2D
91  bool m_bicubicUpsize { false };
92 };
93 
94 #endif
MythVideoGPU::VideoResize
VideoResize
Definition: mythvideogpu.h:25
MythVideoGPU::m_discontinuityCounter
uint64_t m_discontinuityCounter
Definition: mythvideogpu.h:72
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:89
MythVideoGPU::m_inputTextureSize
QSize m_inputTextureSize
Definition: mythvideogpu.h:82
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:48
MythVideoGPU::m_lastRotation
int m_lastRotation
Definition: mythvideogpu.h:84
MythVideoGPU::m_resizing
VideoResizing m_resizing
Definition: mythvideogpu.h:83
MythVideoGPU::IsValid
bool IsValid() const
Definition: mythvideogpu.cpp:71
Frame
Definition: zmdefines.h:93
DEINT_NONE
@ DEINT_NONE
Definition: mythframe.h:69
MythVideoGPU::m_videoColourSpace
MythVideoColourSpace * m_videoColourSpace
Definition: mythvideogpu.h:81
FrameScanType
FrameScanType
Definition: videoouttypes.h:94
MythVideoGPU::m_bicubicUpsize
bool m_bicubicUpsize
Definition: mythvideogpu.h:91
MythVideoGPU::ToneMap
@ ToneMap
Definition: mythvideogpu.h:32
mythframe.h
MythVideoGPU::m_videoDim
QSize m_videoDim
Definition: mythvideogpu.h:77
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:73
MythVideoGPU::Bicubic
@ Bicubic
Definition: mythvideogpu.h:33
kScan_Progressive
@ kScan_Progressive
Definition: videoouttypes.h:100
MythVideoGPU::m_videoDispDim
QSize m_videoDispDim
Definition: mythvideogpu.h:76
MythVideoGPU::SetVideoRects
void SetVideoRects(QRect DisplayVideoRect, QRect VideoRect)
Definition: mythvideogpu.cpp:124
MythVideoGPU::SetViewportRect
void SetViewportRect(QRect DisplayVisibleRect)
Definition: mythvideogpu.cpp:130
MythVideoGPU::SetMasterViewport
void SetMasterViewport(QSize Size)
Definition: mythvideogpu.cpp:86
MythVideoGPU::VideoResizeToString
static QString VideoResizeToString(VideoResizing Resize)
Definition: mythvideogpu.cpp:106
MythVideoGPU::m_deinterlacer
MythDeintType m_deinterlacer
Definition: mythvideogpu.h:85
MythVideoGPU::m_outputType
VideoFrameType m_outputType
Definition: mythvideogpu.h:75
uint
unsigned int uint
Definition: compat.h:140
MythVideoGPU::m_videoRect
QRect m_videoRect
Definition: mythvideogpu.h:80
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:90
MythVideoBounds
Definition: mythvideobounds.h:23
StereoscopicMode
StereoscopicMode
Definition: videoouttypes.h:134
MythVideoGPU::m_displayVideoRect
QRect m_displayVideoRect
Definition: mythvideogpu.h:79
MythVideoGPU::m_render
MythRender * m_render
Definition: mythvideogpu.h:71
MythVideoGPU::m_viewportControl
bool m_viewportControl
Definition: mythvideogpu.h:88
MythDeintType
MythDeintType
Definition: mythframe.h:67
MythVideoGPU::GetProfile
virtual QString GetProfile() const
Definition: mythvideogpu.cpp:81
MythRender
Definition: mythrender_base.h:23
MythVideoGPU::UpscalerChanged
void UpscalerChanged(const QString &Upscaler)
Definition: mythvideogpu.cpp:63
MythVideoGPU::SetProfile
void SetProfile(const QString &Profile)
Definition: mythvideogpu.cpp:76
MythVideoGPU::m_valid
bool m_valid
Definition: mythvideogpu.h:87
MythVideoGPU::ResetFrameFormat
virtual void ResetFrameFormat()
Definition: mythvideogpu.cpp:96
VideoFrameType
VideoFrameType
Definition: mythframe.h:20
MythVideoGPU::UpdateColourSpace
void UpdateColourSpace(bool PrimariesChanged)
Definition: mythvideogpu.cpp:58
MythVideoProfilePtr
std::shared_ptr< MythVideoProfile > MythVideoProfilePtr
Definition: mythvideogpu.h:18
MythVideoGPU::m_deinterlacer2x
bool m_deinterlacer2x
Definition: mythvideogpu.h:86
MythVideoGPU::None
@ None
Definition: mythvideogpu.h:27
MythVideoGPU::SetVideoDimensions
void SetVideoDimensions(QSize VideoDim, QSize VideoDispDim)
Definition: mythvideogpu.cpp:118
MythVideoFrame
Definition: mythframe.h:88
MythVideoGPU::m_masterViewportSize
QSize m_masterViewportSize
Definition: mythvideogpu.h:78
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:74
MythVideoGPU::Performance
@ Performance
Definition: mythvideogpu.h:30
MythVideoGPU::GetVideoDim
QSize GetVideoDim() const
Definition: mythvideogpu.cpp:91
MythVideoGPU::Framebuffer
@ Framebuffer
Definition: mythvideogpu.h:31