Miam-Player  0.8.0
A nice music player
VideoFrameExtractor.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_VIDEOFRAMEEXTRACTOR_H
23 #define QTAV_VIDEOFRAMEEXTRACTOR_H
24 
25 #include <QtCore/QObject>
26 #include <QtAV/VideoFrame.h>
27 
28 //TODO: extract all streams
29 namespace QtAV {
30 class VideoFrameExtractorPrivate;
31 class Q_AV_EXPORT VideoFrameExtractor : public QObject
32 {
33  Q_OBJECT
35  Q_PROPERTY(QString source READ source WRITE setSource NOTIFY sourceChanged)
36  Q_PROPERTY(bool autoExtract READ autoExtract WRITE setAutoExtract NOTIFY autoExtractChanged)
37  Q_PROPERTY(bool async READ async WRITE setAsync NOTIFY asyncChanged)
38  Q_PROPERTY(int precision READ precision WRITE setPrecision NOTIFY precisionChanged)
39  Q_PROPERTY(qint64 position READ position WRITE setPosition NOTIFY positionChanged)
40 public:
41  explicit VideoFrameExtractor(QObject *parent = 0);
46  void setSource(const QString url);
47  QString source() const;
54  void setAsync(bool value);
55  bool async() const;
56  void setAutoExtract(bool value);
57  bool autoExtract() const;
65  void setPrecision(int value);
66  int precision() const;
67  void setPosition(qint64 value);
68  qint64 position() const;
69 
70  virtual bool event(QEvent *e);
71 Q_SIGNALS:
72  void frameExtracted(const QtAV::VideoFrame& frame); // parameter: VideoFrame, bool changed?
73  void sourceChanged();
74  void asyncChanged();
75  void error(); // clear preview image in a slot
76  void autoExtractChanged();
81  void positionChanged();
82  void precisionChanged();
83 
84  void aboutToExtract(qint64 pos);
85 
86 public Q_SLOTS:
93  void extract();
94 private Q_SLOTS:
95  void extractInternal(qint64 pos);
96 
97 protected:
98  //VideoFrameExtractor(VideoFrameExtractorPrivate &d, QObject* parent = 0);
100 };
101 
102 } //namespace QtAV
103 #endif // QTAV_VIDEOFRAMEEXTRACTOR_H
#define Q_AV_EXPORT
Definition: QtAV_Global.h:40
#define DPTR_DECLARE_PRIVATE(Class)
Definition: dptr.h:107
Definition: VideoFrameExtractor.h:31
Definition: VideoFrame.h:32
#define DPTR_DECLARE(Class)
Definition: dptr.h:105
AudioOutput ao; ao.setAudioFormat(fmt); ao.open(); while (has_data) { data = read_data(ao->bufferSize...
Definition: AudioDecoder.h:31