MythTV  master
videoout_opengl.h
Go to the documentation of this file.
1 #ifndef VIDEOOUT_OPENGL_H_
2 #define VIDEOOUT_OPENGL_H_
3 
4 // MythTV headers
5 #include "videooutbase.h"
6 #include "openglvideo.h"
7 
8 class MythRenderOpenGL;
10 
12 {
13  public:
14  static void GetRenderOptions(render_opts &opts, QStringList &cpudeints);
15  explicit VideoOutputOpenGL(const QString &profile = QString());
16  virtual ~VideoOutputOpenGL();
17 
18  bool Init(const QSize &video_dim_buf,
19  const QSize &video_dim_disp,
20  float aspect,
21  WId winid, const QRect &win_rect, MythCodecID codec_id) override; // VideoOutput
22  virtual void SetProfile(void);
23  virtual void TearDown(void);
24 
25  void PrepareFrame(VideoFrame *buffer, FrameScanType, OSD *osd) override; // VideoOutput
26  void ProcessFrame(VideoFrame *frame, OSD *osd,
27  FilterChain *filterList,
28  const PIPMap &pipPlayers,
29  FrameScanType scan) override; // VideoOutput
30  virtual void Show(FrameScanType ) override; // VideoOutput
31  bool InputChanged(const QSize &video_dim_buf,
32  const QSize &video_dim_disp,
33  float aspect,
34  MythCodecID av_codec_id, void *codec_private,
35  bool &aspect_only) override; // VideoOutput
36  void UpdatePauseFrame(int64_t &disp_timecode) override; // VideoOutput
37  void DrawUnusedRects(bool) override { } // VideoOutput
38  void Zoom(ZoomDirection direction) override; // VideoOutput
39  void MoveResize(void) override; // VideoOutput
40  int SetPictureAttribute(PictureAttribute attribute, int newValue) override; // VideoOutput
41  void InitPictureAttributes(void) override; // VideoOutput
42  static QStringList GetAllowedRenderers(MythCodecID myth_codec_id,
43  const QSize &video_dim);
44  void EmbedInWidget(const QRect &rect) override; // VideoOutput
45  void StopEmbedding(void) override; // VideoOutput
46  bool SetDeinterlacingEnabled(bool) override; // VideoOutput
47  bool SetupDeinterlace(bool interlaced,
48  const QString& overridefilter="") override; // VideoOutput
49  void ShowPIP(VideoFrame *frame,
50  MythPlayer *pipplayer,
51  PIPLocation loc) override; // VideoOutput
52  void MoveResizeWindow(QRect new_rect) override; // VideoOutput
53 
54  void RemovePIP(MythPlayer *pipplayer) override; // VideoOutput
55  bool IsPIPSupported(void) const override { return true; } //VideoOutput
56  bool hasFullScreenOSD(void) const override { return true; } // VideoOutput
57  bool ApproveDeintFilter(const QString& filtername) const override; // VideoOutput
58  MythPainter *GetOSDPainter(void) override; // VideoOutput
59 
60  bool CanVisualise(AudioPlayer *audio, MythRender *render) override; // VideoOutput
61  bool SetupVisualisation(AudioPlayer *audio, MythRender *render,
62  const QString &name) override; // VideoOutput
63  QStringList GetVisualiserList(void) override; // VideoOutput
64 
65  bool StereoscopicModesAllowed(void) const override { return true; } // VideoOutput
66 
67  protected:
68  bool CreateCPUResources(void);
69  bool CreateGPUResources(void);
70  bool CreateVideoResources(void);
71  void DestroyCPUResources(void);
72  void DestroyVideoResources(void);
73  void DestroyGPUResources(void);
74  virtual bool CreateBuffers(void);
75  bool CreatePauseFrame(void);
76  bool SetupContext(void);
77  bool SetupOpenGL(void);
78  void CreatePainter(void);
79 
82  bool gl_valid;
84  QMap<MythPlayer*,OpenGLVideo*> gl_pipchains;
85  QMap<MythPlayer*,bool> gl_pip_ready;
89 
94 };
95 
96 #endif
bool Init(const QSize &video_dim_buf, const QSize &video_dim_disp, float aspect, WId winid, const QRect &win_rect, MythCodecID codec_id) override
Performs most of the initialization for VideoOutput.
OpenGLVideo::VideoType gl_opengl_type
bool IsPIPSupported(void) const override
bool CreatePauseFrame(void)
bool SetupDeinterlace(bool interlaced, const QString &overridefilter="") override
Attempts to enable or disable deinterlacing.
bool SetupVisualisation(AudioPlayer *audio, MythRender *render, const QString &name) override
def scan(profile, smoonURL, gate)
Definition: scan.py:46
void StopEmbedding(void) override
Tells video output to stop embedding video in an existing window.
QMap< MythPlayer *, PIPLocation > PIPMap
Definition: videooutbase.h:37
QMap< MythPlayer *, bool > gl_pip_ready
bool CanVisualise(AudioPlayer *audio, MythRender *render) override
void InitPictureAttributes(void) override
MythCodecID
Definition: mythcodecid.h:10
void DestroyCPUResources(void)
bool CreateVideoResources(void)
virtual void TearDown(void)
QMap< MythPlayer *, OpenGLVideo * > gl_pipchains
FrameScanType
Definition: videoouttypes.h:80
bool CreateGPUResources(void)
bool StereoscopicModesAllowed(void) const override
bool hasFullScreenOSD(void) const override
static QStringList GetAllowedRenderers(MythCodecID myth_codec_id, const QSize &video_dim)
Generate a list of supported OpenGL profiles.
int SetPictureAttribute(PictureAttribute attribute, int newValue) override
Sets a specified picture attribute.
void ProcessFrame(VideoFrame *frame, OSD *osd, FilterChain *filterList, const PIPMap &pipPlayers, FrameScanType scan) override
virtual void Show(FrameScanType) override
bool CreateCPUResources(void)
OpenGLVideo * gl_pipchain_active
void ShowPIP(VideoFrame *frame, MythPlayer *pipplayer, PIPLocation loc) override
Composites PiP image onto a video frame.
void DestroyGPUResources(void)
This class serves as the base class for all video output methods.
Definition: videooutbase.h:46
virtual ~VideoOutputOpenGL()
void MoveResize(void) override
performs all the calculations for video framing and any resizing.
virtual bool CreateBuffers(void)
void PrepareFrame(VideoFrame *buffer, FrameScanType, OSD *osd) override
void Zoom(ZoomDirection direction) override
Sets up zooming into to different parts of the video, the zoom is actually applied in MoveResize().
OpenGLVideo * gl_videochain
PictureAttribute
Definition: videoouttypes.h:89
const char * name
Definition: ParseText.cpp:328
MythRenderOpenGL * gl_context
MythPainter * GetOSDPainter(void) override
bool SetDeinterlacingEnabled(bool) override
Attempts to enable/disable deinterlacing using existing deinterlace method when enabling.
A class used to display video frames and associated imagery using the OpenGL API.
Definition: openglvideo.h:19
PIPLocation
Definition: videoouttypes.h:19
VideoOutputOpenGL(const QString &profile=QString())
void EmbedInWidget(const QRect &rect) override
Tells video output to embed video in an existing window.
QStringList GetVisualiserList(void) override
void UpdatePauseFrame(int64_t &disp_timecode) override
Updates frame displayed when video is paused.
virtual void SetProfile(void)
static void GetRenderOptions(render_opts &opts, QStringList &cpudeints)
Generate the list of available OpenGL profiles.
Definition: osd.h:132
void DrawUnusedRects(bool) override
Draws non-video portions of the screen.
void DestroyVideoResources(void)
bool InputChanged(const QSize &video_dim_buf, const QSize &video_dim_disp, float aspect, MythCodecID av_codec_id, void *codec_private, bool &aspect_only) override
Tells video output to discard decoded frames and wait for new ones.
void RemovePIP(MythPlayer *pipplayer) override
bool ApproveDeintFilter(const QString &filtername) const override
Approves bobdeint filter for XVideo and otherwise defers to VideoOutput::ApproveDeintFilter(const QSt...
ZoomDirection
Definition: videoouttypes.h:28
void MoveResizeWindow(QRect new_rect) override
MythOpenGLPainter * gl_painter
VideoFrame av_pause_frame