Miam-Player  0.8.0
A nice music player
QtAV_Global.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 
23 #ifndef QTAV_GLOBAL_H
24 #define QTAV_GLOBAL_H
25 
26 #include <stdarg.h>
27 #include <QtCore/QMetaType>
28 #include <QtCore/QByteArray> //QByteArrayLiteral check
29 #include <QtCore/qglobal.h>
30 #include <QtAV/dptr.h>
31 
32 #ifdef BUILD_QTAV_STATIC
33 #define Q_AV_EXPORT
34 #else
35 #if defined(BUILD_QTAV_LIB)
36 # undef Q_AV_EXPORT
37 # define Q_AV_EXPORT Q_DECL_EXPORT
38 #else
39 # undef Q_AV_EXPORT
40 # define Q_AV_EXPORT Q_DECL_IMPORT //only for vc?
41 #endif
42 #endif //BUILD_QTAV_STATIC
43 #define Q_AV_PRIVATE_EXPORT Q_AV_EXPORT
44 
45 /* runtime version. used to compare with compile time version */
46 Q_AV_EXPORT unsigned QtAV_Version();
49 namespace QtAV {
50 enum LogLevel {
52  LogDebug, // log all
53  LogWarning, // log warning, critical, fatal
54  LogCritical, // log critical, fatal
55  LogFatal, // log fatal
57 };
61 Q_AV_EXPORT QString aboutQtAV_HTML();
68 Q_AV_EXPORT void setLogLevel(LogLevel value);
71 Q_AV_EXPORT void setFFmpegLogHandler(void(*)(void *, int, const char *, va_list));
76 Q_AV_EXPORT void setFFmpegLogLevel(const QByteArray& level);
77 
80 Q_AV_EXPORT QString avcodecOptions();
81 
84 {
87  LoadingMedia, // when source is set
88  LoadedMedia, // if auto load and source is set. player is stopped state
89  StalledMedia, // insufficient buffering or other interruptions (timeout, user interrupt)
90  BufferingMedia, // NOT IMPLEMENTED
91  BufferedMedia, // when playing //NOT IMPLEMENTED
92  EndOfMedia, // Playback has reached the end of the current media. The player is in the StoppedState.
93  InvalidMedia // what if loop > 0 or stopPosition() is not mediaStopPosition()?
94 };
95 
96 enum BufferMode {
100 };
101 
106 };
107 Q_DECLARE_FLAGS(MediaEndAction, MediaEndActionFlag)
108 
109 enum SeekUnit {
110  SeekByTime, // only this is supported now
113 };
114 enum SeekType {
115  AccurateSeek, // slow
116  KeyFrameSeek, // fast
118 };
119 
120 //http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.709-5-200204-I!!PDF-E.pdf
121 // TODO: other color spaces (yuv itu.xxxx, XYZ, ...)
125  ColorSpace_GBR, // for planar gbr format(e.g. video from x264) used in glsl
128 };
129 
136  ColorRange_Limited, // TV, MPEG
137  ColorRange_Full // PC, JPEG
138 };
139 
156  UserSurface = 0xffff
157 };
158 } //namespace QtAV
159 
160 Q_DECLARE_METATYPE(QtAV::MediaStatus)
161 Q_DECLARE_METATYPE(QtAV::MediaEndAction)
162 
163 // TODO: internal use. move to a private header
164 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
165 #define QStringLiteral(X) QString::fromUtf8(X)
166 #endif //QT_VERSION
167 #ifndef QByteArrayLiteral
168 #define QByteArrayLiteral(str) QByteArray(str, sizeof(str) - 1)
169 #endif
170 /*
171  * msvc sucks! can not deal with (defined(QTAV_HAVE_##FEATURE) && QTAV_HAVE_##FEATURE)
172  */
173 // TODO: internal use. move to a private header
174 #define QTAV_HAVE(FEATURE) (defined QTAV_HAVE_##FEATURE && QTAV_HAVE_##FEATURE)
175 
176 #ifndef Q_DECL_OVERRIDE
177 #define Q_DECL_OVERRIDE
178 #endif
179 #ifndef Q_DECL_FINAL
180 #define Q_DECL_FINAL
181 #endif
182 
183 #if defined(BUILD_QTAV_LIB)
184 #define QTAV_DEPRECATED
185 #else
186 #define QTAV_DEPRECATED Q_DECL_DEPRECATED
187 #endif
188 #endif // QTAV_GLOBAL_H
189 
Definition: QtAV_Global.h:89
LogLevel
Definition: QtAV_Global.h:50
Definition: QtAV_Global.h:53
Q_AV_EXPORT QString avformatOptions()
query the common options of avformat/avcodec that can be used by AVPlayer::setOptionsForXXX. Format/codec specified options are also included
Q_AV_EXPORT QString QtAV_Version_String()
Definition: QtAV_Global.h:112
Definition: QtAV_Global.h:115
Definition: QtAV_Global.h:110
Definition: QtAV_Global.h:90
Definition: QtAV_Global.h:155
#define Q_AV_EXPORT
Definition: QtAV_Global.h:40
Definition: QtAV_Global.h:52
Definition: QtAV_Global.h:97
Definition: QtAV_Global.h:123
Definition: QtAV_Global.h:126
Definition: QtAV_Global.h:117
Q_AV_EXPORT void setFFmpegLogLevel(const QByteArray &level)
setFFmpegLogLevel
Definition: QtAV_Global.h:85
Q_AV_EXPORT QString QtAV_Version_String_Long()
Q_AV_EXPORT unsigned QtAV_Version()
Definition: QtAV_Global.h:127
Q_AV_EXPORT QString aboutQtAV_PlainText()
Definition: QtAV_Global.h:125
Q_AV_EXPORT void setFFmpegLogHandler(void(*)(void *, int, const char *, va_list))
Default handler is qt message logger. Set environment QTAV_FFMPEG_LOG=0 or setFFmpegLogHandler(0) to ...
Definition: QtAV_Global.h:111
ColorSpace
Definition: QtAV_Global.h:122
stop playback but video renderer keeps the last frame
Definition: QtAV_Global.h:105
Definition: QtAV_Global.h:103
Definition: QtAV_Global.h:51
Definition: QtAV_Global.h:136
Definition: QtAV_Global.h:86
Q_AV_EXPORT LogLevel logLevel()
Definition: QtAV_Global.h:55
Definition: QtAV_Global.h:87
Definition: QtAV_Global.h:99
SurfaceType
The SurfaceType enum HostMemorySurface: Map the decoded frame to host memory GLTextureSurface: Map th...
Definition: QtAV_Global.h:152
SeekType
Definition: QtAV_Global.h:114
Definition: QtAV_Global.h:154
Q_AV_EXPORT void setLogLevel(LogLevel value)
Default value: LogOff for release build.
SeekUnit
Definition: QtAV_Global.h:109
Definition: QtAV_Global.h:98
Definition: QtAV_Global.h:56
BufferMode
Definition: QtAV_Global.h:96
Definition: QtAV_Global.h:88
MediaEndActionFlag
Definition: QtAV_Global.h:102
stop playback (if loop end) and clear video renderer
Definition: QtAV_Global.h:104
Definition: QtAV_Global.h:135
ColorRange
The ColorRange enum YUV or RGB color range.
Definition: QtAV_Global.h:134
AudioOutput ao; ao.setAudioFormat(fmt); ao.open(); while (has_data) { data = read_data(ao->bufferSize...
Definition: AudioDecoder.h:31
Definition: QtAV_Global.h:156
Definition: QtAV_Global.h:116
Q_AV_EXPORT QString aboutQtAV_HTML()
Q_AV_EXPORT QString avcodecOptions()
Definition: QtAV_Global.h:92
Definition: QtAV_Global.h:153
Definition: QtAV_Global.h:137
Definition: QtAV_Global.h:93
MediaStatus
Definition: QtAV_Global.h:83
Definition: QtAV_Global.h:124
Q_AV_EXPORT QString aboutFFmpeg_PlainText()
Definition: QtAV_Global.h:54
Definition: QtAV_Global.h:91
Q_AV_EXPORT QString aboutFFmpeg_HTML()