diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-04-23 13:38:50 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-04-26 08:38:57 +0200 |
commit | bebe72f4a05d338e04ae9ca1e9c6b72749b488aa (patch) | |
tree | 8036839520fcde4fba5526e647d53e833075d799 /libavcodec | |
parent | 30fe9719344f01a147628e07a8e79a9ccc7e0835 (diff) | |
download | ffmpeg-bebe72f4a05d338e04ae9ca1e9c6b72749b488aa.tar.gz |
lavc: deprecate FF_*_TYPE macros in favor of AV_PICTURE_TYPE_* enums
Also deprecate av_get_pict_type_char() in favor of
av_get_picture_type_char().
The new enum and av_get_picture_type_char() are defined in libavutil.
This allows the use in libavfilter without the need to link against
libavcodec.
Signed-off-by: Stefano Sabatini <stefano.sabatini-lala@poste.it>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/avcodec.h | 24 | ||||
-rw-r--r-- | libavcodec/utils.c | 13 | ||||
-rw-r--r-- | libavcodec/version.h | 5 |
3 files changed, 22 insertions, 20 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 91edaf0d51..eb5c5b3b64 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -762,7 +762,7 @@ typedef struct AVPanScan{ * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\ * - decoding: Set by libavcodec.\ */\ - int pict_type;\ + enum AVPictureType pict_type;\ \ /**\ * presentation timestamp in time_base units (time when frame should be shown to user)\ @@ -1004,14 +1004,16 @@ typedef struct AVPanScan{ #define FF_BUFFER_TYPE_SHARED 4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared. #define FF_BUFFER_TYPE_COPY 8 ///< Just a (modified) copy of some other buffer, don't deallocate anything. - -#define FF_I_TYPE 1 ///< Intra -#define FF_P_TYPE 2 ///< Predicted -#define FF_B_TYPE 3 ///< Bi-dir predicted -#define FF_S_TYPE 4 ///< S(GMC)-VOP MPEG4 -#define FF_SI_TYPE 5 ///< Switching Intra -#define FF_SP_TYPE 6 ///< Switching Predicted -#define FF_BI_TYPE 7 +#if FF_API_OLD_FF_PICT_TYPES +/* DEPRECATED, directly use the AV_PICTURE_TYPE_* enum values */ +#define FF_I_TYPE AV_PICTURE_TYPE_I ///< Intra +#define FF_P_TYPE AV_PICTURE_TYPE_P ///< Predicted +#define FF_B_TYPE AV_PICTURE_TYPE_B ///< Bi-dir predicted +#define FF_S_TYPE AV_PICTURE_TYPE_S ///< S(GMC)-VOP MPEG4 +#define FF_SI_TYPE AV_PICTURE_TYPE_SI ///< Switching Intra +#define FF_SP_TYPE AV_PICTURE_TYPE_SP ///< Switching Predicted +#define FF_BI_TYPE AV_PICTURE_TYPE_BI +#endif #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore). #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer. @@ -3766,13 +3768,17 @@ void avcodec_default_free_buffers(AVCodecContext *s); /* misc useful functions */ +#if FF_API_OLD_FF_PICT_TYPES /** * Return a single letter to describe the given picture type pict_type. * * @param[in] pict_type the picture type * @return A single character representing the picture type. + * @deprecated Use av_get_picture_type_char() instead. */ +attribute_deprecated char av_get_pict_type_char(int pict_type); +#endif /** * Return codec bits per sample. diff --git a/libavcodec/utils.c b/libavcodec/utils.c index d60e236952..7e2847afb1 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1030,18 +1030,11 @@ void avcodec_default_free_buffers(AVCodecContext *s){ s->internal_buffer_count=0; } +#if FF_API_OLD_FF_PICT_TYPES char av_get_pict_type_char(int pict_type){ - switch(pict_type){ - case FF_I_TYPE: return 'I'; - case FF_P_TYPE: return 'P'; - case FF_B_TYPE: return 'B'; - case FF_S_TYPE: return 'S'; - case FF_SI_TYPE:return 'i'; - case FF_SP_TYPE:return 'p'; - case FF_BI_TYPE:return 'b'; - default: return '?'; - } + return av_get_picture_type_char(pict_type); } +#endif int av_get_bits_per_sample(enum CodecID codec_id){ switch(codec_id){ diff --git a/libavcodec/version.h b/libavcodec/version.h index d384d54a24..418e2756b9 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -22,7 +22,7 @@ #define LIBAVCODEC_VERSION_MAJOR 53 #define LIBAVCODEC_VERSION_MINOR 1 -#define LIBAVCODEC_VERSION_MICRO 0 +#define LIBAVCODEC_VERSION_MICRO 1 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ @@ -59,5 +59,8 @@ #ifndef FF_API_THREAD_INIT #define FF_API_THREAD_INIT (LIBAVCODEC_VERSION_MAJOR < 54) #endif +#ifndef FF_API_OLD_FF_PICT_TYPES +#define FF_API_OLD_FF_PICT_TYPES (LIBAVCODEC_VERSION_MAJOR < 54) +#endif #endif /* AVCODEC_VERSION_H */ |