aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2011-04-23 13:38:50 +0200
committerAnton Khirnov <anton@khirnov.net>2011-04-26 08:38:57 +0200
commitbebe72f4a05d338e04ae9ca1e9c6b72749b488aa (patch)
tree8036839520fcde4fba5526e647d53e833075d799 /libavutil
parent30fe9719344f01a147628e07a8e79a9ccc7e0835 (diff)
downloadffmpeg-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 'libavutil')
-rw-r--r--libavutil/avutil.h21
-rw-r--r--libavutil/utils.c14
2 files changed, 34 insertions, 1 deletions
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 '?';
+ }
+}