00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00024 #ifndef AVUTIL_ERROR_H
00025 #define AVUTIL_ERROR_H
00026 
00027 #include <errno.h>
00028 #include <stddef.h>
00029 
00037 
00038 #if EDOM > 0
00039 #define AVERROR(e) (-(e))   
00040 #define AVUNERROR(e) (-(e)) 
00041 #else
00042 
00043 #define AVERROR(e) (e)
00044 #define AVUNERROR(e) (e)
00045 #endif
00046 
00047 #define FFERRTAG(a, b, c, d) (-(int)MKTAG(a, b, c, d))
00048 
00049 #define AVERROR_BSF_NOT_FOUND      FFERRTAG(0xF8,'B','S','F') 
00050 #define AVERROR_BUG                FFERRTAG( 'B','U','G','!') 
00051 #define AVERROR_BUFFER_TOO_SMALL   FFERRTAG( 'B','U','F','S') 
00052 #define AVERROR_DECODER_NOT_FOUND  FFERRTAG(0xF8,'D','E','C') 
00053 #define AVERROR_DEMUXER_NOT_FOUND  FFERRTAG(0xF8,'D','E','M') 
00054 #define AVERROR_ENCODER_NOT_FOUND  FFERRTAG(0xF8,'E','N','C') 
00055 #define AVERROR_EOF                FFERRTAG( 'E','O','F',' ') 
00056 #define AVERROR_EXIT               FFERRTAG( 'E','X','I','T') 
00057 #define AVERROR_EXTERNAL           FFERRTAG( 'E','X','T',' ') 
00058 #define AVERROR_FILTER_NOT_FOUND   FFERRTAG(0xF8,'F','I','L') 
00059 #define AVERROR_INVALIDDATA        FFERRTAG( 'I','N','D','A') 
00060 #define AVERROR_MUXER_NOT_FOUND    FFERRTAG(0xF8,'M','U','X') 
00061 #define AVERROR_OPTION_NOT_FOUND   FFERRTAG(0xF8,'O','P','T') 
00062 #define AVERROR_PATCHWELCOME       FFERRTAG( 'P','A','W','E') 
00063 #define AVERROR_PROTOCOL_NOT_FOUND FFERRTAG(0xF8,'P','R','O') 
00064 #define AVERROR_STREAM_NOT_FOUND   FFERRTAG(0xF8,'S','T','R') 
00065 
00066 
00070 #define AVERROR_BUG2               FFERRTAG( 'B','U','G',' ')
00071 #define AVERROR_UNKNOWN            FFERRTAG( 'U','N','K','N') 
00072 
00073 #define AV_ERROR_MAX_STRING_SIZE 64
00074 
00087 int av_strerror(int errnum, char *errbuf, size_t errbuf_size);
00088 
00099 static inline char *av_make_error_string(char *errbuf, size_t errbuf_size, int errnum)
00100 {
00101     av_strerror(errnum, errbuf, errbuf_size);
00102     return errbuf;
00103 }
00104 
00109 #define av_err2str(errnum) \
00110     av_make_error_string((char[AV_ERROR_MAX_STRING_SIZE]){0}, AV_ERROR_MAX_STRING_SIZE, errnum)
00111 
00116 #endif