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"
12
13// Std
14#include <memory>
15
16class MythVideoBounds;
18using MythVideoProfilePtr = std::shared_ptr<MythVideoProfile>;
19
20class MythVideoGPU : public QObject
21{
22 Q_OBJECT
23
24 public:
25 enum VideoResize : std::uint8_t
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;
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
MythVideoColourSpace contains a QMatrix4x4 that can convert YCbCr data to RGB.
virtual void RenderFrame(MythVideoFrame *Frame, bool TopFieldFirst, FrameScanType Scan, StereoscopicMode StereoOverride, bool DrawBorder=false)=0
VideoResizing m_resizing
Definition: mythvideogpu.h:89
bool IsValid() const
bool m_viewportControl
Definition: mythvideogpu.h:94
~MythVideoGPU() override
virtual void PrepareFrame(MythVideoFrame *Frame, FrameScanType Scan=kScan_Progressive)=0
int m_lastRotation
Definition: mythvideogpu.h:90
uint m_lastStereo
Definition: mythvideogpu.h:95
virtual void StartFrame()=0
QSize GetVideoDim() const
MythVideoGPU(MythRender *Render, MythVideoColourSpace *ColourSpace, MythVideoBounds *Bounds, const MythVideoProfilePtr &VideoProfile, QString Profile)
VideoFrameType m_inputType
Definition: mythvideogpu.h:80
void SetViewportRect(QRect DisplayVisibleRect)
QSize m_inputTextureSize
Definition: mythvideogpu.h:88
QRect m_videoRect
Definition: mythvideogpu.h:86
StereoscopicMode m_stereoMode
Definition: mythvideogpu.h:96
uint64_t m_discontinuityCounter
Definition: mythvideogpu.h:78
QString m_profile
Definition: mythvideogpu.h:79
void SetVideoDimensions(QSize VideoDim, QSize VideoDispDim)
bool m_bicubicUpsize
Definition: mythvideogpu.h:97
virtual QString GetProfile() const
virtual void EndFrame()=0
QSize m_videoDim
Definition: mythvideogpu.h:83
QRect m_displayVideoRect
Definition: mythvideogpu.h:85
MythVideoColourSpace * m_videoColourSpace
Definition: mythvideogpu.h:87
QSize m_masterViewportSize
Definition: mythvideogpu.h:84
VideoFrameType m_outputType
Definition: mythvideogpu.h:81
void OutputChanged(QSize VideoDim, QSize VideoDispDim, float)
static QString VideoResizeToString(VideoResizing Resize)
virtual void ResetTextures()=0
void UpscalerChanged(const QString &Upscaler)
void UpdateColourSpace(bool PrimariesChanged)
virtual void ResetFrameFormat()
QSize m_videoDispDim
Definition: mythvideogpu.h:82
void SetVideoRects(QRect DisplayVideoRect, QRect VideoRect)
virtual void ColourSpaceUpdate(bool PrimariesChanged)=0
void SetProfile(const QString &Profile)
void SetMasterViewport(QSize Size)
MythRender * m_render
Definition: mythvideogpu.h:77
bool m_deinterlacer2x
Definition: mythvideogpu.h:92
MythDeintType m_deinterlacer
Definition: mythvideogpu.h:91
unsigned int uint
Definition: freesurround.h:24
MythDeintType
Definition: mythframe.h:67
@ DEINT_NONE
Definition: mythframe.h:68
VideoFrameType
Definition: mythframe.h:20
@ FMT_NONE
Definition: mythframe.h:21
std::shared_ptr< MythVideoProfile > MythVideoProfilePtr
Definition: mythvideogpu.h:18
FrameScanType
Definition: videoouttypes.h:95
@ kScan_Progressive
StereoscopicMode
@ kStereoscopicModeSideBySideDiscard