From bebe72f4a05d338e04ae9ca1e9c6b72749b488aa Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Sat, 23 Apr 2011 13:38:50 +0200 Subject: 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 Signed-off-by: Anton Khirnov --- libavutil/avutil.h | 21 ++++++++++++++++++++- libavutil/utils.c | 14 ++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) (limited to 'libavutil') diff --git a/libavutil/avutil.h b/libavutil/avutil.h index abbdd0642a..43f0815fd2 100644 --- a/libavutil/avutil.h +++ b/libavutil/avutil.h @@ -40,7 +40,7 @@ #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) #define LIBAVUTIL_VERSION_MAJOR 51 -#define LIBAVUTIL_VERSION_MINOR 0 +#define LIBAVUTIL_VERSION_MINOR 1 #define LIBAVUTIL_VERSION_MICRO 0 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ @@ -94,6 +94,25 @@ enum AVMediaType { #define AV_TIME_BASE 1000000 #define AV_TIME_BASE_Q (AVRational){1, AV_TIME_BASE} +enum AVPictureType { + AV_PICTURE_TYPE_I = 1, ///< Intra + AV_PICTURE_TYPE_P, ///< Predicted + AV_PICTURE_TYPE_B, ///< Bi-dir predicted + AV_PICTURE_TYPE_S, ///< S(GMC)-VOP MPEG4 + AV_PICTURE_TYPE_SI, ///< Switching Intra + AV_PICTURE_TYPE_SP, ///< Switching Predicted + AV_PICTURE_TYPE_BI, ///< BI type +}; + +/** + * 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, '?' if pict_type is unknown + */ +char av_get_picture_type_char(enum AVPictureType pict_type); + #include "common.h" #include "error.h" #include "mathematics.h" diff --git a/libavutil/utils.c b/libavutil/utils.c index 042e735631..9b18c97908 100644 --- a/libavutil/utils.c +++ b/libavutil/utils.c @@ -39,3 +39,17 @@ const char *avutil_license(void) #define LICENSE_PREFIX "libavutil license: " return LICENSE_PREFIX LIBAV_LICENSE + sizeof(LICENSE_PREFIX) - 1; } + +char av_get_picture_type_char(enum AVPictureType pict_type) +{ + switch (pict_type) { + case AV_PICTURE_TYPE_I: return 'I'; + case AV_PICTURE_TYPE_P: return 'P'; + case AV_PICTURE_TYPE_B: return 'B'; + case AV_PICTURE_TYPE_S: return 'S'; + case AV_PICTURE_TYPE_SI: return 'i'; + case AV_PICTURE_TYPE_SP: return 'p'; + case AV_PICTURE_TYPE_BI: return 'b'; + default: return '?'; + } +} -- cgit v1.2.3