Mercurial > libavcodec.hg
comparison avcodec.h @ 4520:9bf957e669f0 libavcodec
This fixes error handling for BeOS, removing the need for some ifdefs.
AVERROR_ defines are moved to avcodec.h as they are needed in there as well. Feel free to move that to avutil/common.h.
Bumped up avcodec/format version numbers as though it's binary compatible we will want to rebuild apps as error values changed.
Please from now on use return AVERROR(EFOO) instead of the ugly return -EFOO in your code.
This also removes the need for berrno.h.
author | mmu_man |
---|---|
date | Tue, 13 Feb 2007 18:26:14 +0000 |
parents | 3367310f8460 |
children | f3b85d4ee26b |
comparison
equal
deleted
inserted
replaced
4519:b08a4d11e01c | 4520:9bf957e669f0 |
---|---|
35 #include <sys/types.h> /* size_t */ | 35 #include <sys/types.h> /* size_t */ |
36 | 36 |
37 #define AV_STRINGIFY(s) AV_TOSTRING(s) | 37 #define AV_STRINGIFY(s) AV_TOSTRING(s) |
38 #define AV_TOSTRING(s) #s | 38 #define AV_TOSTRING(s) #s |
39 | 39 |
40 #define LIBAVCODEC_VERSION_INT ((51<<16)+(32<<8)+0) | 40 #define LIBAVCODEC_VERSION_INT ((51<<16)+(33<<8)+0) |
41 #define LIBAVCODEC_VERSION 51.32.0 | 41 #define LIBAVCODEC_VERSION 51.33.0 |
42 #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT | 42 #define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT |
43 | 43 |
44 #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) | 44 #define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) |
45 | 45 |
46 #define AV_NOPTS_VALUE INT64_C(0x8000000000000000) | 46 #define AV_NOPTS_VALUE INT64_C(0x8000000000000000) |
2697 int img_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt, | 2697 int img_pad(AVPicture *dst, const AVPicture *src, int height, int width, int pix_fmt, |
2698 int padtop, int padbottom, int padleft, int padright, int *color); | 2698 int padtop, int padbottom, int padleft, int padright, int *color); |
2699 | 2699 |
2700 extern unsigned int av_xiphlacing(unsigned char *s, unsigned int v); | 2700 extern unsigned int av_xiphlacing(unsigned char *s, unsigned int v); |
2701 | 2701 |
2702 /* error handling */ | |
2703 #if EINVAL > 0 | |
2704 #define AVERROR(e) (-(e)) /**< returns a negative error code from a POSIX error code, to return from library functions. */ | |
2705 #define AVUNERROR(e) (-(e)) /**< returns a POSIX error code from a library function error return value. */ | |
2706 #else | |
2707 /* some platforms have E* and errno already negated. */ | |
2708 #define AVERROR(e) (e) | |
2709 #define AVUNERROR(e) (e) | |
2710 #endif | |
2711 #define AVERROR_UNKNOWN AVERROR(EINVAL) /**< unknown error */ | |
2712 #define AVERROR_IO AVERROR(EIO) /**< i/o error */ | |
2713 #define AVERROR_NUMEXPECTED AVERROR(EDOM) /**< number syntax expected in filename */ | |
2714 #define AVERROR_INVALIDDATA AVERROR(EINVAL) /**< invalid data found */ | |
2715 #define AVERROR_NOMEM AVERROR(ENOMEM) /**< not enough memory */ | |
2716 #define AVERROR_NOFMT AVERROR(EILSEQ) /**< unknown format */ | |
2717 #define AVERROR_NOTSUPP AVERROR(ENOSYS) /**< operation not supported */ | |
2718 | |
2702 #ifdef __cplusplus | 2719 #ifdef __cplusplus |
2703 } | 2720 } |
2704 #endif | 2721 #endif |
2705 | 2722 |
2706 #endif /* AVCODEC_H */ | 2723 #endif /* AVCODEC_H */ |