Miam-Player  0.8.0
A nice music player
OpenGLWindowRenderer.h
Go to the documentation of this file.
1 /******************************************************************************
2  QtAV: Multimedia framework based on Qt and FFmpeg
3  Copyright (C) 2014-2016 Wang Bin <wbsecg1@gmail.com>
4 
5 * This file is part of QtAV
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_OPENGLWINDOWRENDERER_H
23 #define QTAV_OPENGLWINDOWRENDERER_H
24 #ifndef QT_NO_OPENGL
25 #include <QtGui/QOpenGLWindow>
27 
28 namespace QtAV {
29 
30 class OpenGLWindowRendererPrivate;
31 class Q_AV_EXPORT OpenGLWindowRenderer : public QOpenGLWindow, public OpenGLRendererBase
32 {
33  Q_OBJECT
35  Q_PROPERTY(qreal brightness READ brightness WRITE setBrightness NOTIFY brightnessChanged)
36  Q_PROPERTY(qreal contrast READ contrast WRITE setContrast NOTIFY contrastChanged)
37  Q_PROPERTY(qreal hue READ hue WRITE setHue NOTIFY hueChanged)
38  Q_PROPERTY(qreal saturation READ saturation WRITE setSaturation NOTIFY saturationChanged)
39  Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged)
40  Q_PROPERTY(QRectF regionOfInterest READ regionOfInterest WRITE setRegionOfInterest NOTIFY regionOfInterestChanged)
41  Q_PROPERTY(qreal sourceAspectRatio READ sourceAspectRatio NOTIFY sourceAspectRatioChanged)
42  Q_PROPERTY(qreal outAspectRatio READ outAspectRatio WRITE setOutAspectRatio NOTIFY outAspectRatioChanged)
43  //fillMode
44  // TODO: how to use enums in base class as property or Q_ENUM
45  Q_PROPERTY(OutAspectRatioMode outAspectRatioMode READ outAspectRatioMode WRITE setOutAspectRatioMode NOTIFY outAspectRatioModeChanged)
46  Q_ENUMS(OutAspectRatioMode)
47  Q_PROPERTY(int orientation READ orientation WRITE setOrientation NOTIFY orientationChanged)
48  Q_PROPERTY(QRect videoRect READ videoRect NOTIFY videoRectChanged)
49  Q_PROPERTY(QSize videoFrameSize READ videoFrameSize NOTIFY videoFrameSizeChanged)
50  Q_ENUMS(Quality)
51 public:
52  explicit OpenGLWindowRenderer(UpdateBehavior updateBehavior = NoPartialUpdate, QWindow *parent = 0);
53  virtual VideoRendererId id() const Q_DECL_OVERRIDE;
54  QWindow* qwindow() Q_DECL_OVERRIDE Q_DECL_FINAL { return this; }
55 Q_SIGNALS:
56  void sourceAspectRatioChanged(qreal value) Q_DECL_OVERRIDE Q_DECL_FINAL;
57  void regionOfInterestChanged() Q_DECL_OVERRIDE;
58  void outAspectRatioChanged() Q_DECL_OVERRIDE;
59  void outAspectRatioModeChanged() Q_DECL_OVERRIDE;
60  void brightnessChanged(qreal value) Q_DECL_OVERRIDE;
61  void contrastChanged(qreal) Q_DECL_OVERRIDE;
62  void hueChanged(qreal) Q_DECL_OVERRIDE;
63  void saturationChanged(qreal) Q_DECL_OVERRIDE;
64  void backgroundColorChanged() Q_DECL_OVERRIDE;
65  void orientationChanged() Q_DECL_OVERRIDE;
66  void videoRectChanged() Q_DECL_OVERRIDE;
67  void videoFrameSizeChanged() Q_DECL_OVERRIDE;
68 protected:
69  virtual void initializeGL() Q_DECL_OVERRIDE;
70  virtual void paintGL() Q_DECL_OVERRIDE;
71  virtual void resizeGL(int w, int h) Q_DECL_OVERRIDE;
72  virtual void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
73  //virtual void showEvent(QShowEvent *);
74 };
76 
77 } //namespace QtAV
78 #endif //QT_NO_OPENGL
79 #endif // QTAV_OPENGLWINDOWRENDERER_H
OpenGLWindowRenderer VideoRendererOpenGLWindow
Definition: OpenGLWindowRenderer.h:75
#define Q_AV_EXPORT
Definition: QtAV_Global.h:40
#define Q_DECL_FINAL
Definition: QtAV_Global.h:180
#define DPTR_DECLARE_PRIVATE(Class)
Definition: dptr.h:107
OutAspectRatioMode
Definition: VideoRenderer.h:57
Definition: OpenGLRendererBase.h:41
Definition: OpenGLWindowRenderer.h:31
Quality
Definition: VideoRenderer.h:63
int VideoRendererId
Definition: VideoRenderer.h:45
Definition: FilterContext.h:102
AudioOutput ao; ao.setAudioFormat(fmt); ao.open(); while (has_data) { data = read_data(ao->bufferSize...
Definition: AudioDecoder.h:31
#define Q_DECL_OVERRIDE
Definition: QtAV_Global.h:177