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#include "mythhdrtracker.h"
7
9class MythVideoGPU;
10class MythPainterGPU;
11
13{
14 Q_OBJECT
15
16 public:
17 static void GetRenderOptions(RenderOptions& Options, MythRender* Render);
18 static MythVideoOutputGPU* Create(MythMainWindow* MainWindow, MythRender* Render,
19 MythPainter* Painter, MythDisplay* Display,
20 const QString& Decoder,
21 MythCodecID CodecID, QSize VideoDim,
22 QSize VideoDispDim, float VideoAspect,
23 float FrameRate, uint PlayerFlags,
24 const QString& Codec, int ReferenceFrames,
25 const VideoFrameTypes*& RenderFormats);
27 ~MythVideoOutputGPU() override;
28
29 signals:
30 void ChangePictureAttribute(PictureAttribute Attribute, bool Direction, int Value);
31 void PictureAttributeChanged(PictureAttribute Attribute, int Value);
33 void PictureAttributesUpdated(const std::map<PictureAttribute,int>& Values);
36
37 public slots:
38 void WindowResized (QSize Size);
39 void ResizeForVideo (QSize Size = QSize());
40
41 public:
42 void InitPictureAttributes () override;
43 void SetVideoFrameRate (float NewRate) override;
44 void DiscardFrames (bool KeyFrame, bool Flushed) override;
46 void UpdatePauseFrame (std::chrono::milliseconds& DisplayTimecode, FrameScanType Scan = kScan_Progressive) override;
47 bool InputChanged (QSize VideoDim, QSize VideoDispDim,
48 float VideoAspect, MythCodecID CodecId, bool& AspectOnly,
49 int ReferenceFrames, bool ForceChange) override;
50 void EndFrame () override;
51 void ClearAfterSeek () override;
52
53 protected:
54 MythVideoOutputGPU(MythMainWindow* MainWindow, MythRender* Render,
55 MythPainterGPU* Painter, MythDisplay* Display,
56 MythVideoProfilePtr VideoProfile, QString& Profile);
57 virtual QRect GetDisplayVisibleRectAdj();
58 bool Init (QSize VideoDim, QSize VideoDispDim, float Aspect,
59 QRect DisplayVisibleRect, MythCodecID CodecId) override;
60 void PrepareFrame (MythVideoFrame* Frame, FrameScanType Scan) override;
61 void RenderFrame (MythVideoFrame* Frame, FrameScanType Scan) 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 };
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 };
81
82 private:
83 Q_DISABLE_COPY(MythVideoOutputGPU)
84};
85
86#endif
Common code shared between GPU accelerated sub-classes (e.g. OpenGL)
virtual QRect GetDisplayVisibleRectAdj()
MythCodecID m_newCodecId
MythVideoOutputGPU(MythMainWindow *MainWindow, MythRender *Render, MythPainterGPU *Painter, MythDisplay *Display, MythVideoProfilePtr VideoProfile, QString &Profile)
HDRTracker m_hdrTracker
MythMainWindow * m_mainWindow
void PrepareFrame(MythVideoFrame *Frame, FrameScanType Scan) override
void WindowResized(QSize Size)
void PictureAttributesUpdated(const std::map< PictureAttribute, int > &Values)
void SetVideoFrameRate(float NewRate) override
MythRender * m_render
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)
void UpdatePauseFrame(std::chrono::milliseconds &DisplayTimecode, FrameScanType Scan=kScan_Progressive) override
void EndFrame() override
MythPainterGPU * m_painter
~MythVideoOutputGPU() override
void ChangePictureAttribute(PictureAttribute Attribute, bool Direction, int Value)
static VideoFrameType FrameTypeForCodec(MythCodecID CodecId)
bool CreateBuffers(MythCodecID CodecID, QSize Size)
bool InputChanged(QSize VideoDim, QSize VideoDispDim, float VideoAspect, MythCodecID CodecId, bool &AspectOnly, int ReferenceFrames, bool ForceChange) override
Tells video output to discard decoded frames and wait for new ones.
void ResizeForVideo(QSize Size=QSize())
static void GetRenderOptions(RenderOptions &Options, MythRender *Render)
void PictureAttributeChanged(PictureAttribute Attribute, int Value)
void DiscardFrames(bool KeyFrame, bool Flushed) override
Discard video frames.
bool Init(QSize VideoDim, QSize VideoDispDim, float Aspect, QRect DisplayVisibleRect, MythCodecID CodecId) override
void InitDisplayMeasurements()
Initialise display measurement.
void SupportedAttributesChanged(PictureAttributeSupported Supported)
void SetReferenceFrames(int ReferenceFrames)
void DoneDisplayingFrame(MythVideoFrame *Frame) override
Release a video frame back into the decoder pool.
void InitPictureAttributes() override
void RenderFrame(MythVideoFrame *Frame, FrameScanType Scan) override
void ClearAfterSeek() override
Tells video output to toss decoded buffers due to a seek.
MythVideoGPU * m_video
unsigned int uint
Definition: freesurround.h:24
MythCodecID
Definition: mythcodecid.h:14
@ kCodec_NONE
Definition: mythcodecid.h:17
std::vector< VideoFrameType > VideoFrameTypes
Definition: mythframe.h:82
VideoFrameType
Definition: mythframe.h:20
std::shared_ptr< class MythHDRTracker > HDRTracker
PlayerFlags
Definition: mythplayer.h:65
std::shared_ptr< MythVideoProfile > MythVideoProfilePtr
Definition: mythvideogpu.h:18
PictureAttributeSupported
FrameScanType
Definition: videoouttypes.h:95
@ kScan_Progressive
PictureAttribute