MythTV  master
mythvideooutopengl.h
Go to the documentation of this file.
1 #ifndef VIDEOOUT_OPENGL_H_
2 #define VIDEOOUT_OPENGL_H_
3 
4 // MythTV
5 #include "mythvideoout.h"
6 #include "mythopenglvideo.h"
7 
8 class MythRenderOpenGL;
10 class MythOpenGLPerf;
11 
13 {
14  public:
16  {
19  };
20 
21  static void GetRenderOptions(RenderOptions &Options);
22  static QStringList GetAllowedRenderers(MythCodecID CodecId, const QSize &VideoDim);
23 
24  explicit MythVideoOutputOpenGL(QString Profile = QString());
25  ~MythVideoOutputOpenGL() override;
26 
27  // VideoOutput
28  bool Init(const QSize &VideoDim, const QSize &VideoDispDim, float Aspect,
29  MythDisplay *Display, const QRect &DisplayVisibleRect, MythCodecID CodecId) override;
30 
31  void PrepareFrame(VideoFrame *Frame, FrameScanType Scan, OSD *Osd) override;
32  void ProcessFrame(VideoFrame *Frame, OSD *Osd,
33  const PIPMap &PiPPlayers, FrameScanType Scan) override;
34  void Show(FrameScanType Scan) override;
35  void ClearAfterSeek(void) override;
36  bool InputChanged(const QSize &VideoDim, const QSize &VideoDispDim,
37  float Aspect, MythCodecID CodecId, bool &AspectOnly,
38  MythMultiLocker* Locks, int ReferenceFrames,
39  bool ForceChange) override;
40  void UpdatePauseFrame(int64_t &DisplayTimecode, FrameScanType Scan = kScan_Progressive) override;
41  void InitPictureAttributes(void) override;
42  void ShowPIP(VideoFrame *Frame, MythPlayer *PiPPlayer, PIPLocation Location) override;
43  void RemovePIP(MythPlayer *PiPPlayer) override;
44  bool IsPIPSupported(void) const override { return true; }
45  MythPainter *GetOSDPainter(void) override;
46  bool CanVisualise(AudioPlayer *Audio, MythRender *Render) override;
47  bool SetupVisualisation(AudioPlayer *Audio, MythRender *Render, const QString &Name) override;
48  QStringList GetVisualiserList(void) override;
49  bool StereoscopicModesAllowed(void) const override { return true; }
50  void DoneDisplayingFrame(VideoFrame *Frame) override;
51  void DiscardFrames(bool KeyFrame, bool Flushed) override;
52  VideoFrameType* DirectRenderFormats(void) override;
53  void WindowResized(const QSize &Size) override;
54  void SetVideoFrameRate(float NewRate) override;
55 
56  protected:
57  void DestroyBuffers(void);
58  bool CreateBuffers(MythCodecID CodecID, QSize Size);
59  QRect GetDisplayVisibleRect(void);
60 
61  MythRenderOpenGL *m_render { nullptr };
64  QMap<MythPlayer*,MythOpenGLVideo*> m_openGLVideoPiPs;
65  QMap<MythPlayer*,bool> m_openGLVideoPiPsReady;
68  QString m_videoProfile;
72  float m_newAspect { 0.0F };
73  bool m_newFrameRate { false };
74  bool m_buffersCreated { false };
75 
76  // performance monitoring (-v gpu)
78 };
79 
80 #endif
MythOpenGLPainter
Definition: mythpainteropengl.h:24
MythVideoOutput
Definition: mythvideoout.h:36
mythvideoout.h
MythVideoOutputOpenGL::GetDisplayVisibleRect
QRect GetDisplayVisibleRect(void)
Definition: mythvideooutopengl.cpp:326
MythVideoOutputOpenGL::m_newFrameRate
bool m_newFrameRate
Definition: mythvideooutopengl.h:73
AudioPlayer
Definition: audioplayer.h:26
kCodec_NONE
@ kCodec_NONE
Definition: mythcodecid.h:14
MythVideoOutputOpenGL::Show
void Show(FrameScanType Scan) override
Definition: mythvideooutopengl.cpp:751
MythVideoOutputOpenGL::GetAllowedRenderers
static QStringList GetAllowedRenderers(MythCodecID CodecId, const QSize &VideoDim)
Generate a list of supported OpenGL profiles.
Definition: mythvideooutopengl.cpp:789
MythVideoOutputOpenGL::m_newVideoDispDim
QSize m_newVideoDispDim
Definition: mythvideooutopengl.h:71
Frame
Definition: zmdefines.h:93
MythVideoOutputOpenGL::SetupVisualisation
bool SetupVisualisation(AudioPlayer *Audio, MythRender *Render, const QString &Name) override
Definition: mythvideooutopengl.cpp:958
MythVideoOutputOpenGL::UpdatePauseFrame
void UpdatePauseFrame(int64_t &DisplayTimecode, FrameScanType Scan=kScan_Progressive) override
Definition: mythvideooutopengl.cpp:824
MythVideoOutputOpenGL::AllFormats
@ AllFormats
Definition: mythvideooutopengl.h:17
FrameScanType
FrameScanType
Definition: videoouttypes.h:78
MythVideoOutputOpenGL::DestroyBuffers
void DestroyBuffers(void)
Definition: mythvideooutopengl.cpp:179
MythVideoOutputOpenGL::GetRenderOptions
static void GetRenderOptions(RenderOptions &Options)
Generate the list of available OpenGL profiles.
Definition: mythvideooutopengl.cpp:26
MythPlayer
Definition: mythplayer.h:164
MythVideoOutputOpenGL::m_openGLVideoPiPsReady
QMap< MythPlayer *, bool > m_openGLVideoPiPsReady
Definition: mythvideooutopengl.h:65
VideoFrame
Definition: mythframe.h:137
mythopenglvideo.h
MythMultiLocker
Definition: mythplayer.h:121
MythVideoOutputOpenGL::m_videoProfile
QString m_videoProfile
Definition: mythvideooutopengl.h:68
MythVideoOutputOpenGL::MythVideoOutputOpenGL
MythVideoOutputOpenGL(QString Profile=QString())
Definition: mythvideooutopengl.cpp:99
MythVideoOutputOpenGL::ClearAfterSeek
void ClearAfterSeek(void) override
Tells video output to toss decoded buffers due to a seek.
Definition: mythvideooutopengl.cpp:773
MythVideoOutputOpenGL::DirectRenderFormats
VideoFrameType * DirectRenderFormats(void) override
Definition: mythvideooutopengl.cpp:726
MythVideoOutputOpenGL::m_openGLVideo
MythOpenGLVideo * m_openGLVideo
Definition: mythvideooutopengl.h:63
MythVideoOutputOpenGL::m_openGLPainter
MythOpenGLPainter * m_openGLPainter
Definition: mythvideooutopengl.h:67
MythCodecID
MythCodecID
Definition: mythcodecid.h:10
MythVideoOutputOpenGL::m_openGLVideoPiPActive
MythOpenGLVideo * m_openGLVideoPiPActive
Definition: mythvideooutopengl.h:66
RenderOptions
Definition: videodisplayprofile.h:27
kScan_Progressive
@ kScan_Progressive
Definition: videoouttypes.h:84
MythVideoOutputOpenGL::m_newAspect
float m_newAspect
Definition: mythvideooutopengl.h:72
MythVideoOutputOpenGL::CanVisualise
bool CanVisualise(AudioPlayer *Audio, MythRender *Render) override
Definition: mythvideooutopengl.cpp:953
MythVideoOutputOpenGL::m_openGLPerf
MythOpenGLPerf * m_openGLPerf
Definition: mythvideooutopengl.h:77
MythVideoOutputOpenGL::InputChanged
bool InputChanged(const QSize &VideoDim, const QSize &VideoDispDim, float Aspect, MythCodecID CodecId, bool &AspectOnly, MythMultiLocker *Locks, int ReferenceFrames, bool ForceChange) override
Tells video output to discard decoded frames and wait for new ones.
Definition: mythvideooutopengl.cpp:268
MythVideoOutputOpenGL::m_render
MythRenderOpenGL * m_render
Definition: mythvideooutopengl.h:61
MythVideoOutputOpenGL::InitPictureAttributes
void InitPictureAttributes(void) override
Definition: mythvideooutopengl.cpp:853
MythVideoOutputOpenGL::ProcessFrame
void ProcessFrame(VideoFrame *Frame, OSD *Osd, const PIPMap &PiPPlayers, FrameScanType Scan) override
Definition: mythvideooutopengl.cpp:385
MythVideoOutputOpenGL::DiscardFrames
void DiscardFrames(bool KeyFrame, bool Flushed) override
Discard video frames.
Definition: mythvideooutopengl.cpp:716
MythVideoOutputOpenGL::PrepareFrame
void PrepareFrame(VideoFrame *Frame, FrameScanType Scan, OSD *Osd) override
Definition: mythvideooutopengl.cpp:478
MythVideoOutputOpenGL
Definition: mythvideooutopengl.h:12
PIPMap
QMap< MythPlayer *, PIPLocation > PIPMap
Definition: mythvideoout.h:32
MythVideoOutputOpenGL::ShowPIP
void ShowPIP(VideoFrame *Frame, MythPlayer *PiPPlayer, PIPLocation Location) override
Definition: mythvideooutopengl.cpp:858
MythDisplay
Definition: mythdisplay.h:18
MythOpenGLPerf
A simple overload of QOpenGLTimeMonitor to record and log OpenGL execution intervals.
Definition: mythopenglperf.h:33
MythVideoOutputOpenGL::DoneDisplayingFrame
void DoneDisplayingFrame(VideoFrame *Frame) override
Release a video frame back into the decoder pool.
Definition: mythvideooutopengl.cpp:678
MythVideoOutputOpenGL::RemovePIP
void RemovePIP(MythPlayer *PiPPlayer) override
Definition: mythvideooutopengl.cpp:929
MythRenderOpenGL
Definition: mythrenderopengl.h:86
MythVideoOutputOpenGL::TextureFormats
TextureFormats
Definition: mythvideooutopengl.h:15
MythVideoOutputOpenGL::m_newCodecId
MythCodecID m_newCodecId
Definition: mythvideooutopengl.h:69
PIPLocation
PIPLocation
Definition: videoouttypes.h:17
MythOpenGLVideo
Definition: mythopenglvideo.h:23
MythVideoOutputOpenGL::LegacyFormats
@ LegacyFormats
Definition: mythvideooutopengl.h:18
MythVideoOutputOpenGL::GetVisualiserList
QStringList GetVisualiserList(void) override
Definition: mythvideooutopengl.cpp:941
MythRender
Definition: mythrender_base.h:22
MythPainter
Definition: mythpainter.h:32
Name
Definition: channelsettings.cpp:46
MythVideoOutputOpenGL::CreateBuffers
bool CreateBuffers(MythCodecID CodecID, QSize Size)
Definition: mythvideooutopengl.cpp:356
MythVideoOutputOpenGL::WindowResized
void WindowResized(const QSize &Size) override
Definition: mythvideooutopengl.cpp:745
MythVideoOutputOpenGL::~MythVideoOutputOpenGL
~MythVideoOutputOpenGL() override
Definition: mythvideooutopengl.cpp:157
VideoFrameType
VideoFrameType
Definition: mythframe.h:24
MythVideoOutputOpenGL::m_buffersCreated
bool m_buffersCreated
Definition: mythvideooutopengl.h:74
MythVideoOutputOpenGL::m_newVideoDim
QSize m_newVideoDim
Definition: mythvideooutopengl.h:70
MythVideoOutputOpenGL::m_openGLVideoPiPs
QMap< MythPlayer *, MythOpenGLVideo * > m_openGLVideoPiPs
Definition: mythvideooutopengl.h:64
MythVideoOutputOpenGL::GetOSDPainter
MythPainter * GetOSDPainter(void) override
Definition: mythvideooutopengl.cpp:948
MythVideoOutputOpenGL::Init
bool Init(const QSize &VideoDim, const QSize &VideoDispDim, float Aspect, MythDisplay *Display, const QRect &DisplayVisibleRect, MythCodecID CodecId) override
Definition: mythvideooutopengl.cpp:187
MythVideoOutputOpenGL::SetVideoFrameRate
void SetVideoFrameRate(float NewRate) override
Definition: mythvideooutopengl.cpp:254
MythVideoOutputOpenGL::m_textureFormats
TextureFormats m_textureFormats
Definition: mythvideooutopengl.h:62
MythVideoOutputOpenGL::StereoscopicModesAllowed
bool StereoscopicModesAllowed(void) const override
Definition: mythvideooutopengl.h:49
OSD
Definition: osd.h:131
MythVideoOutputOpenGL::IsPIPSupported
bool IsPIPSupported(void) const override
Definition: mythvideooutopengl.h:44