Miam-Player  0.8.0
A nice music player
VideoShaderObject.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 2016)
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 #ifndef QTAV_VIDEOSHADEROBJECT_H
22 #define QTAV_VIDEOSHADEROBJECT_H
23 #include <QtAV/VideoShader.h>
24 #include <QtCore/QObject>
25 #include <QtCore/QVector>
26 
27 namespace QtAV {
28 // check and auto update properties in shader
29 class VideoShaderObjectPrivate;
36 class Q_AV_EXPORT VideoShaderObject : public QObject, public VideoShader
37 {
39  Q_OBJECT
40 public:
41  VideoShaderObject(QObject* parent = 0);
42 protected:
43  VideoShaderObject(VideoShaderObjectPrivate &d, QObject* parent = 0);
44  bool event(QEvent *event) Q_DECL_OVERRIDE;
45 private Q_SLOTS:
46  void propertyChanged(int id);
47 private:
48  void programReady() Q_DECL_OVERRIDE Q_DECL_FINAL;
49 };
50 
51 class DynamicShaderObjectPrivate;
57 {
58  Q_OBJECT
60  Q_PROPERTY(QString header READ header WRITE setHeader NOTIFY headerChanged)
61  Q_PROPERTY(QString sample READ sample WRITE setSample NOTIFY sampleChanged)
62  Q_PROPERTY(QString postProcess READ postProcess WRITE setPostProcess NOTIFY postProcessChanged)
63 public:
64  DynamicShaderObject(QObject* parent = 0);
65  QString header() const;
66  void setHeader(const QString& text);
67  QString sample() const;
68  void setSample(const QString& text);
69  QString postProcess() const;
70  void setPostProcess(const QString& text);
71 Q_SIGNALS:
72  void headerChanged();
73  void sampleChanged();
74  void postProcessChanged();
75 protected:
76  DynamicShaderObject(DynamicShaderObjectPrivate &d, QObject* parent = 0);
77 private:
78  const char* userShaderHeader(QOpenGLShader::ShaderType st) const Q_DECL_OVERRIDE;
79  const char* userSample() const Q_DECL_OVERRIDE;
80  const char* userPostProcess() const Q_DECL_OVERRIDE;
81 };
82 } //namespace QtAV
83 #endif //QTAV_VIDEOSHADEROBJECT_H
The DynamicShaderObject class Able to set custom shader code.
Definition: VideoShaderObject.h:56
#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
The VideoShaderObject class User defined uniform names are bound to class meta properties (property s...
Definition: VideoShaderObject.h:36
The VideoShader class Represents a shader for rendering a video frame.
Definition: VideoShader.h:53
ShaderType
Definition: VideoShader_p.h:48
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