Miam-Player  0.8.0
A nice music player
OpenGLRendererBase.h
Go to the documentation of this file.
1 /******************************************************************************
2  QtAV: Multimedia framework based on Qt and FFmpeg
3  Copyright (C) 2012-2016 Wang Bin <wbsecg1@gmail.com>
4 
5 * This file is part of QtAV (from 2014)
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Lesser General Public
9  License as published by the Free Software Foundation; either
10  version 2.1 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public
18  License along with this library; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 ******************************************************************************/
21 
22 #ifndef QTAV_OPENGLRENDERERBASE_H
23 #define QTAV_OPENGLRENDERERBASE_H
24 
25 #include <QtAV/VideoRenderer.h>
26 #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
27 #include <QtGui/QOpenGLFunctions>
28 #elif QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
29 #include <QtOpenGL/QGLFunctions>
30 #define QOpenGLFunctions QGLFunctions
31 #endif
32 
33 namespace QtAV {
34 
40 class OpenGLRendererBasePrivate;
42 #if QT_VERSION >= QT_VERSION_CHECK(4, 8, 0)
43  , public QOpenGLFunctions
44 #endif
45 {
47 public:
48  virtual ~OpenGLRendererBase();
49  bool isSupported(VideoFormat::PixelFormat pixfmt) const Q_DECL_OVERRIDE;
50  OpenGLVideo* opengl() const Q_DECL_OVERRIDE;
51 protected:
52  virtual bool receiveFrame(const VideoFrame& frame) Q_DECL_OVERRIDE;
53  //called in paintEvent before drawFrame() when required
54  virtual void drawBackground() Q_DECL_OVERRIDE;
55  //draw the current frame using the current paint engine. called by paintEvent()
56  virtual void drawFrame() Q_DECL_OVERRIDE;
57  void onInitializeGL();
58  void onPaintGL();
59  void onResizeGL(int w, int h);
60  void onResizeEvent(int w, int h);
61  void onShowEvent();
62 private:
63  void onSetOutAspectRatioMode(OutAspectRatioMode mode) Q_DECL_OVERRIDE;
64  void onSetOutAspectRatio(qreal ratio) Q_DECL_OVERRIDE;
65  bool onSetOrientation(int value) Q_DECL_OVERRIDE;
66  bool onSetBrightness(qreal b) Q_DECL_OVERRIDE;
67  bool onSetContrast(qreal c) Q_DECL_OVERRIDE;
68  bool onSetHue(qreal h) Q_DECL_OVERRIDE;
69  bool onSetSaturation(qreal s) Q_DECL_OVERRIDE;
70 protected:
72 };
73 
74 } //namespace QtAV
75 
76 #endif // QTAV_OPENGLRENDERERBASE_H
#define Q_AV_EXPORT
Definition: QtAV_Global.h:40
#define DPTR_DECLARE_PRIVATE(Class)
Definition: dptr.h:107
OutAspectRatioMode
Definition: VideoRenderer.h:57
PixelFormat
The PixelFormat enum 32 bit rgba format enum name indicates it&#39;s channel layout.
Definition: VideoFormat.h:51
Definition: OpenGLRendererBase.h:41
Definition: VideoFrame.h:32
Definition: OpenGLRendererBase_p.h:30
AudioOutput ao; ao.setAudioFormat(fmt); ao.open(); while (has_data) { data = read_data(ao->bufferSize...
Definition: AudioDecoder.h:31
The OpenGLVideo class high level api for renderering a video frame.
Definition: OpenGLVideo.h:51
#define Q_DECL_OVERRIDE
Definition: QtAV_Global.h:177
Definition: VideoRenderer.h:51