Miam-Player  0.8.0
A nice music player
LibAVFilter.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_LIBAVFILTER_H
23 #define QTAV_LIBAVFILTER_H
24 
25 #include <QtAV/Filter.h>
26 
27 namespace QtAV {
28 
30 {
31 public:
32  static QString filterDescription(const QString& filterName);
33  static QStringList videoFilters();
34  static QStringList audioFilters();
42  enum Status {
45  ConfigureOk
46  };
47 
48  LibAVFilter();
49  virtual ~LibAVFilter();
55  void setOptions(const QString& options);
56  QString options() const;
57 
58  Status status() const;
59 protected:
60  virtual QString sourceArguments() const = 0;
61  bool pushVideoFrame(Frame* frame, bool changed);
62  bool pushAudioFrame(Frame* frame, bool changed);
63  void* pullFrameHolder();
64  static QStringList registeredFilters(int type); // filters whose input/output type matches
65  virtual void optionsChanged() {}
66  class Private;
67  Private *priv;
68 };
69 
71 {
72  Q_OBJECT
73  Q_PROPERTY(QString options READ options WRITE setOptions NOTIFY optionsChanged)
74  Q_PROPERTY(QStringList filters READ filters)
75 public:
76  LibAVFilterVideo(QObject *parent = 0);
77  bool isSupported(VideoFilterContext::Type t) const Q_DECL_OVERRIDE { return t == VideoFilterContext::None;}
78  QStringList filters() const; //the same as LibAVFilter::videoFilters
79 Q_SIGNALS:
80  void optionsChanged() Q_DECL_OVERRIDE;
81 protected:
82  void process(Statistics *statistics, VideoFrame *frame) Q_DECL_OVERRIDE;
83  QString sourceArguments() const Q_DECL_OVERRIDE;
84 };
85 
87 {
88  Q_OBJECT
89  Q_PROPERTY(QString options READ options WRITE setOptions NOTIFY optionsChanged)
90  Q_PROPERTY(QStringList filters READ filters)
91 public:
92  LibAVFilterAudio(QObject *parent = 0);
93  QStringList filters() const; //the same as LibAVFilter::audioFilters
94 Q_SIGNALS:
95  void optionsChanged() Q_DECL_OVERRIDE;
96 protected:
97  void process(Statistics *statistics, AudioFrame *frame) Q_DECL_OVERRIDE;
98  QString sourceArguments() const Q_DECL_OVERRIDE;
99 };
100 
101 } //namespace QtAV
102 
103 #endif // QTAV_LIBAVFILTER_H
Definition: Filter.h:77
Definition: Frame.h:33
#define Q_AV_EXPORT
Definition: QtAV_Global.h:40
Definition: LibAVFilter.h:86
Definition: LibAVFilter.h:43
Definition: LibAVFilter.h:70
Definition: Filter.h:105
virtual void optionsChanged()
Definition: LibAVFilter.h:65
Definition: LibAVFilter.h:44
Definition: FilterContext.h:41
Definition: LibAVFilter.h:29
Definition: AudioFrame.h:31
Definition: VideoFrame.h:32
Definition: Statistics.h:35
AudioOutput ao; ao.setAudioFormat(fmt); ao.open(); while (has_data) { data = read_data(ao->bufferSize...
Definition: AudioDecoder.h:31
Private * priv
Definition: LibAVFilter.h:66
Status
The Status enum Status of filter graph.
Definition: LibAVFilter.h:42
#define Q_DECL_OVERRIDE
Definition: QtAV_Global.h:177
Definition: FilterContext.h:50