Miam-Player  0.8.0
A nice music player
VideoDecoder.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
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_VIDEODECODER_H
23 #define QTAV_VIDEODECODER_H
24 
25 #include <QtAV/AVDecoder.h>
26 #include <QtAV/VideoFrame.h>
27 #include <QtCore/QStringList>
28 
29 namespace QtAV {
30 typedef int VideoDecoderId;
58 {
59  Q_DISABLE_COPY(VideoDecoder)
61 public:
62  static QStringList supportedCodecs();
63  static VideoDecoder* create(VideoDecoderId id);
70  static VideoDecoder* create(const char* name = "FFmpeg");
71  virtual VideoDecoderId id() const = 0;
72  QString name() const; //name from factory
73  virtual VideoFrame frame() = 0;
74 public:
75  typedef int Id;
76  static QVector<VideoDecoderId> registered();
77  template<class C> static bool Register(VideoDecoderId id, const char* name) { return Register(id, create<C>, name);}
83  static VideoDecoderId* next(VideoDecoderId* id = 0);
84  static const char* name(VideoDecoderId id);
85  static VideoDecoderId id(const char* name);
86 private:
87  template<class C> static VideoDecoder* create() { return new C();}
88  typedef VideoDecoder* (*VideoDecoderCreator)();
89  static bool Register(VideoDecoderId id, VideoDecoderCreator, const char *name);
90 protected:
92 private:
93  VideoDecoder();
94 };
95 
96 extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_FFmpeg;
97 extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_CUDA;
98 extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_DXVA;
99 extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_D3D11;
100 extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_VAAPI;
101 extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_Cedarv;
102 extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_VDA;
103 extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_VideoToolbox;
104 extern Q_AV_EXPORT VideoDecoderId VideoDecoderId_MediaCodec;
105 } //namespace QtAV
106 #endif // QTAV_VIDEODECODER_H
static bool Register(VideoDecoderId id, const char *name)
Definition: VideoDecoder.h:77
#define Q_AV_EXPORT
Definition: QtAV_Global.h:40
Q_AV_EXPORT VideoDecoderId VideoDecoderId_Cedarv
#define DPTR_DECLARE_PRIVATE(Class)
Definition: dptr.h:107
Definition: AVDecoder.h:33
Definition: VideoDecoder.h:57
Q_AV_EXPORT VideoDecoderId VideoDecoderId_MediaCodec
int VideoDecoderId
Definition: VideoDecoder.h:30
int Id
Definition: VideoDecoder.h:75
Q_AV_EXPORT VideoDecoderId VideoDecoderId_FFmpeg
Q_AV_EXPORT VideoDecoderId VideoDecoderId_D3D11
Q_AV_EXPORT VideoDecoderId VideoDecoderId_VDA
Definition: VideoFrame.h:32
Q_AV_EXPORT VideoDecoderId VideoDecoderId_VideoToolbox
Q_AV_EXPORT VideoDecoderId VideoDecoderId_VAAPI
Q_AV_EXPORT VideoDecoderId VideoDecoderId_DXVA
AudioOutput ao; ao.setAudioFormat(fmt); ao.open(); while (has_data) { data = read_data(ao->bufferSize...
Definition: AudioDecoder.h:31
Q_AV_EXPORT VideoDecoderId VideoDecoderId_CUDA
Definition: AVDecoder_p.h:135