3 #include <system_error>
74 operator bool()
const;
79 std::error_code *m_ec =
nullptr;
91 using std::system_error::system_error;
102 virtual const char *
name()
const noexcept
override;
103 virtual std::string
message(
int ev)
const override;
112 virtual const char *name()
const noexcept
override;
113 virtual std::string message(
int ev)
const override;
150 return std::error_condition(
static_cast<int>(code),
avcpp_category());
165 template<
typename Exception = av::Exception>
171 template<
typename Exception = av::Exception>
189 template<
typename Category,
typename Exception = av::Exception>
193 *ec = std::error_code(errcode, cat);
195 throw Exception(std::error_code(errcode, cat));
198 template<
typename T,
typename Exception = av::Exception>
223 return static_cast<bool>(*ec);
231 template<>
struct is_error_condition_enum<
av::
Errors> :
public true_type {};
The AvcppCategory class Describes internal AvCpp errors.
Definition: averror.h:99
virtual std::string message(int ev) const override
Definition: averror.cpp:14
virtual const char * name() const noexcept override
Definition: averror.cpp:9
The AvException class Default exception that thows from function that does not accept error code stor...
Definition: averror.h:89
The FfmpegCategory class Describers FFmpeg internal errors.
Definition: averror.h:111
static OptionalErrorCode null()
Definition: averror.cpp:84
OptionalErrorCode(std::error_code &ec)
std::error_code & operator*()
Definition: averror.cpp:89
Definition: audioresampler.cpp:8
const AvcppCategory & avcpp_category()
Definition: averror.h:117
void clear_if(OptionalErrorCode ec)
clear_if - clear error code if it is not av::throws()
Definition: averror.h:213
void throw_error_code(const std::error_code &ec)
Definition: averror.h:166
bool is_error(OptionalErrorCode ec)
Definition: averror.h:220
std::error_code make_avcpp_error(Errors code)
Definition: averror.h:142
std::error_code make_error_code(av::Errors errc) noexcept
Definition: averror.h:136
std::error_condition make_ffmpeg_condition(int code)
Definition: averror.h:160
std::error_code make_ffmpeg_error(int code)
Definition: averror.h:154
Errors
Definition: averror.h:10
@ IncorrectBufferSinkMediaType
@ IncorrectBufferSrcFilter
@ FilterGraphDescriptionEmpty
@ ResamplerInvalidParameters
@ IncorrectBufferSrcMediaType
@ IncorrectBufferSinkFilter
@ RescalerInternalSwsError
@ FormatInvalidStreamIndex
@ RescalerInvalidParameters
@ FormatWrongCountOfStreamOptions
@ CodecDecodingOffsetToLarge
std::error_condition make_error_condition(av::Errors errc) noexcept
Definition: averror.h:130
void throws_if(OptionalErrorCode ec, int errcode, const Category &cat)
Throws exception if ec is av::throws() or fill error code.
Definition: averror.h:190
std::error_condition make_avcpp_condition(Errors code)
Definition: averror.h:148
FfmpegCategory & ffmpeg_category()
Definition: averror.h:123
Definition: averror.h:230