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) 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
QMap< MythPlayer *, PIPLocation > PIPMap
Definition: mythvideoout.h:32
MythRenderOpenGL * m_render
static QStringList GetAllowedRenderers(MythCodecID CodecId, const QSize &VideoDim)
Generate a list of supported OpenGL profiles.
void DoneDisplayingFrame(VideoFrame *Frame) override
Release a video frame back into the decoder pool.
MythCodecID
Definition: mythcodecid.h:10
void PrepareFrame(VideoFrame *Frame, FrameScanType Scan, OSD *Osd) override
void WindowResized(const QSize &Size) override
QStringList GetVisualiserList(void) override
FrameScanType
Definition: videoouttypes.h:78
VideoFrameType
Definition: mythframe.h:23
bool CreateBuffers(MythCodecID CodecID, QSize Size)
MythVideoOutputOpenGL(QString Profile=QString())
MythOpenGLVideo * m_openGLVideo
void UpdatePauseFrame(int64_t &DisplayTimecode) override
TextureFormats m_textureFormats
VideoFrameType * DirectRenderFormats(void) override
bool CanVisualise(AudioPlayer *Audio, MythRender *Render) override
bool IsPIPSupported(void) const override
QMap< MythPlayer *, MythOpenGLVideo * > m_openGLVideoPiPs
MythOpenGLVideo * m_openGLVideoPiPActive
bool StereoscopicModesAllowed(void) const override
void DiscardFrames(bool KeyFrame, bool Flushed) override
Discard video frames.
MythPainter * GetOSDPainter(void) override
void Show(FrameScanType Scan) override
void RemovePIP(MythPlayer *PiPPlayer) override
static void GetRenderOptions(RenderOptions &Options)
Generate the list of available OpenGL profiles.
void ShowPIP(VideoFrame *Frame, MythPlayer *PiPPlayer, PIPLocation Location) override
QMap< MythPlayer *, bool > m_openGLVideoPiPsReady
PIPLocation
Definition: videoouttypes.h:17
void ClearAfterSeek(void) override
Tells video output to toss decoded buffers due to a seek.
A simple overload of QOpenGLTimeMonitor to record and log OpenGL execution intervals.
bool SetupVisualisation(AudioPlayer *Audio, MythRender *Render, const QString &Name) override
Definition: osd.h:131
MythOpenGLPerf * m_openGLPerf
bool Init(const QSize &VideoDim, const QSize &VideoDispDim, float Aspect, MythDisplay *Display, const QRect &DisplayVisibleRect, MythCodecID CodecId) override
void SetVideoFrameRate(float NewRate) override
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.
MythOpenGLVideo is responsible for displaying video frames on screen using OpenGL.
MythOpenGLPainter * m_openGLPainter
void InitPictureAttributes(void) override
void ProcessFrame(VideoFrame *Frame, OSD *Osd, const PIPMap &PiPPlayers, FrameScanType Scan) override