avcpp 3.1.0
Wrapper for the FFmpeg that simplify usage from C++ projects.
Loading...
Searching...
No Matches
averror.h File Reference

Error codes, error categories and the OptionalErrorCode convention.

#include <system_error>
#include <exception>

Go to the source code of this file.

Classes

class  av::OptionalErrorCode
 Carries the caller's choice between exceptions and error codes. More...
class  av::Exception
 The AvException class Default exception that thows from function that does not accept error code storage. More...
class  av::AvcppCategory
 The AvcppCategory class Describes internal AvCpp errors. More...
class  av::FfmpegCategory
 The FfmpegCategory class Describers FFmpeg internal errors. More...
struct  std::is_error_condition_enum< av::Errors >

Namespaces

namespace  av
 Root namespace of the library.
namespace  std
 STL namespace.

Enumerations

enum class  av::Errors {
  NoError = 0 , Generic , Unallocated , InvalidArgument ,
  OutOfRange , CantAllocateFrame , CodecStreamInvalid , CodecInvalidDirection ,
  CodecAlreadyOpened , CodecIsNotOpened , CodecInvalid , CodecNotOpened ,
  CodecInvalidDecodeProc , CodecInvalidEncodeProc , CodecDecodingOffsetToLarge , CodecInvalidForEncode ,
  CodecInvalidForDecoce , CodecInvalidMediaType , FrameInvalid , DictOutOfRage ,
  DictNoKey , BufferReadonly , FormatCantAddStream , FormatAlreadyOpened ,
  FormatNullOutputFormat , FormatWrongCountOfStreamOptions , FormatNoStreams , FormatInvalidStreamIndex ,
  FormatNotOpened , FormatInvalidDirection , FormatHeaderNotWriten , FormatCodecUnsupported ,
  ResamplerInvalidParameters , ResamplerNotInited , ResamplerInputChanges , ResamplerOutputChanges ,
  RescalerInvalidParameters , RescalerInternalSwsError , FilterNotInFilterGraph , FilterGraphDescriptionEmpty ,
  IncorrectBufferSrcFilter , IncorrectBufferSrcMediaType , IncorrectBufferSinkFilter , IncorrectBufferSinkMediaType ,
  MixBufferSinkAccess , CodecUnsupportedOperation , HardwareDeviceUnavailable , HardwareDeviceInvalid ,
  HardwareConfigNotFound , HardwareFramesInvalid , HardwareTransferUnsupported , HardwareCodecNotFound
}
 Errors the library raises itself, as opposed to FFmpeg's return codes. More...

Functions

const AvcppCategory & av::avcpp_category ()
 Error category of the library's own errors.
FfmpegCategory & av::ffmpeg_category ()
 Error category that wraps FFmpeg return codes.
std::error_condition av::make_error_condition (av::Errors errc) noexcept
 Build an error condition from an avcpp error.
std::error_code av::make_error_code (av::Errors errc) noexcept
 Build an error code from an avcpp error.
std::error_code av::make_avcpp_error (Errors code)
 Build an error code from an avcpp error.
std::error_condition av::make_avcpp_condition (Errors code)
 Build an error condition from an avcpp error.
std::error_code av::make_ffmpeg_error (int code)
 Build an error code from an FFmpeg return value.
std::error_condition av::make_ffmpeg_condition (int code)
 Build an error condition from an FFmpeg return value.
template<typename Exception = av::Exception>
void av::throw_error_code (const std::error_code &ec)
 Throw an exception carrying the given error code.
template<typename Exception = av::Exception>
void av::throw_error_code (Errors errc)
 Throw an exception carrying an avcpp error.
OptionalErrorCode av::throws ()
 Helper to construct null OptionalErrorCode object.
template<typename Category, typename Exception = av::Exception>
void av::throws_if (OptionalErrorCode ec, int errcode, const Category &cat)
 Throw or store an error, depending on what the caller passed.
template<typename T, typename Exception = av::Exception>
void av::throws_if (OptionalErrorCode ec, T errcode)
 Throw or store an error code, depending on the caller's choice.
void av::clear_if (OptionalErrorCode ec)
 clear_if - clear error code if it is not av::throws()
bool av::is_error (OptionalErrorCode ec)
 Whether an error was stored in the caller's variable.