Miam-Player  0.8.0
A nice music player
EncodeFilter.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 2015)
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_ENCODEFILTER_H
23 #define QTAV_ENCODEFILTER_H
24 
25 #include <QtAV/Filter.h>
26 #include <QtAV/Packet.h>
27 #include <QtAV/AudioFrame.h>
28 #include <QtAV/VideoFrame.h>
29 
30 namespace QtAV {
31 
32 class AudioEncoder;
33 class AudioEncodeFilterPrivate;
35 {
36  Q_OBJECT
38 public:
39  AudioEncodeFilter(QObject *parent = 0);
44  void setAsync(bool value = true);
45  bool isAsync() const;
53  AudioEncoder* createEncoder(const QString& name = QLatin1String("FFmpeg"));
59  AudioEncoder* encoder() const;
60  // TODO: async property
61 
66  qint64 startTime() const;
67  void setStartTime(qint64 value);
68 public Q_SLOTS:
73  void finish();
74 Q_SIGNALS:
75  void finished();
81  void readyToEncode();
82  void frameEncoded(const QtAV::Packet& packet);
83  void startTimeChanged(qint64 value);
84  // internal use only
85  void requestToEncode(const AudioFrame& frame);
86 protected Q_SLOTS:
87  void encode(const QtAV::AudioFrame& frame = AudioFrame());
88 protected:
89  virtual void process(Statistics* statistics, AudioFrame* frame = 0) Q_DECL_OVERRIDE;
90 };
91 
92 class VideoEncoder;
93 class VideoEncodeFilterPrivate;
95 {
96  Q_OBJECT
98 public:
99  VideoEncodeFilter(QObject* parent = 0);
104  void setAsync(bool value = true);
105  bool isAsync() const;
114  VideoEncoder* createEncoder(const QString& name = QLatin1String("FFmpeg"));
120  VideoEncoder* encoder() const;
121  // TODO: async property
122 
127  qint64 startTime() const;
128  void setStartTime(qint64 value);
129 public Q_SLOTS:
134  void finish();
135 Q_SIGNALS:
136  void finished();
142  void readyToEncode();
143  void frameEncoded(const QtAV::Packet& packet);
144  void startTimeChanged(qint64 value);
145  // internal use only
146  void requestToEncode(const QtAV::VideoFrame& frame);
147 protected Q_SLOTS:
148  void encode(const QtAV::VideoFrame& frame = VideoFrame());
149 protected:
150  virtual void process(Statistics* statistics, VideoFrame* frame = 0) Q_DECL_OVERRIDE;
151 };
152 } //namespace QtAV
153 #endif // QTAV_ENCODEFILTER_H
154 
bool isSupported(VideoFilterContext::Type t) const Q_DECL_OVERRIDE
Definition: EncodeFilter.h:106
Definition: Filter.h:77
Definition: EncodeFilter.h:34
#define Q_AV_EXPORT
Definition: QtAV_Global.h:40
#define DPTR_DECLARE_PRIVATE(Class)
Definition: dptr.h:107
Definition: AudioEncoder.h:32
Definition: Filter.h:105
Definition: EncodeFilter.h:94
Definition: AudioFrame.h:31
Definition: VideoFrame.h:32
Definition: Packet.h:33
Definition: Statistics.h:35
AudioOutput ao; ao.setAudioFormat(fmt); ao.open(); while (has_data) { data = read_data(ao->bufferSize...
Definition: AudioDecoder.h:31
Definition: VideoEncoder.h:32
Type
Definition: FilterContext.h:44
#define Q_DECL_OVERRIDE
Definition: QtAV_Global.h:177
Definition: FilterContext.h:50