Miam-Player  0.8.0
A nice music player
AVError.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 2013)
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 #ifndef QTAV_AVERROR_H
22 #define QTAV_AVERROR_H
23 
24 #include <QtAV/QtAV_Global.h>
25 #include <QtCore/QString>
26 
27 namespace QtAV {
29 {
30 public:
31  enum ErrorCode {
33 
34  //open/read/seek network stream error. value must be less then ResourceError because of correct_error_by_ffmpeg
35  NetworkError, // all above and before NoError are NetworkError
36 
40  FindStreamInfoTimedout = ParseStreamTimedOut,
42  FindStreamInfoError = ParseStreamError,
43  StreamNotFound, //a,v,s?
47  ResourceError, // all above and before NetworkError are ResourceError
48 
54  CodecError, // all above and before NoError are CodecError
55 
56  FormatError, // all above and before CodecError are FormatError
57 
58  // decrypt error. Not implemented
59  AccessDenied, // all above and before NetworkError are AccessDenied
60 
61  UnknowError
62  };
63 
64  AVError();
65  AVError(ErrorCode code, int ffmpegError = 0);
73  AVError(ErrorCode code, const QString& detail, int ffmpegError = 0);
74  AVError(const AVError& other);
75 
76  AVError &operator=(const AVError &other);
77  bool operator==(const AVError &other) const;
78  inline bool operator!=(const AVError &other) const
79  { return !(*this == other); }
80 
81  void setError(ErrorCode ec);
82  ErrorCode error() const;
83  QString string() const;
84 
85  int ffmpegErrorCode() const;
86  QString ffmpegErrorString() const;
87 
88 private:
89  ErrorCode mError;
90  int mFFmpegError;
91  QString mDetail;
92 };
93 
94 } //namespace QtAV
95 
96 Q_DECLARE_METATYPE(QtAV::AVError)
97 
98 #ifndef QT_NO_DEBUG_STREAM
99 QT_BEGIN_NAMESPACE
100 class QDebug;
101 QT_END_NAMESPACE
102 Q_AV_EXPORT QDebug operator<<(QDebug debug, const QtAV::AVError &error);
103 #endif
104 
105 #endif // QTAV_AVERROR_H
ErrorCode
Definition: AVError.h:31
Definition: AVError.h:28
#define Q_AV_EXPORT
Definition: QtAV_Global.h:40
Definition: AVError.h:59
Definition: AVError.h:38
Definition: AVError.h:43
Definition: AVError.h:41
Definition: AVError.h:52
Definition: AVError.h:44
Definition: AVError.h:45
Definition: AVError.h:35
Definition: AVError.h:53
Q_AV_EXPORT QDebug operator<<(QDebug debug, const AudioFormat &fmt)
Definition: AVError.h:32
bool operator!=(const AVError &other) const
Definition: AVError.h:78
Definition: AVError.h:54
bool operator==(const TagButton &t1, const TagButton &t2)
Definition: tagbutton.h:61
Definition: AVError.h:56
Definition: AVError.h:50
Definition: AVError.h:51
Definition: AVError.h:46
Definition: AVError.h:49
AudioOutput ao; ao.setAudioFormat(fmt); ao.open(); while (has_data) { data = read_data(ao->bufferSize...
Definition: AudioDecoder.h:31
Definition: AVError.h:47
Definition: AVError.h:39
Definition: AVError.h:37