diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2014-07-24 23:17:17 +0200 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-08-04 12:55:07 +0100 |
commit | d2962e9f89cca6ff40f0c9d5ffc9c4397b8b1b26 (patch) | |
tree | db58a6aced1b2e24c59c1ca2cf973bcc6f776f36 | |
parent | 5420099cab1e915b191cceccec4364f54cec6e52 (diff) | |
download | ffmpeg-d2962e9f89cca6ff40f0c9d5ffc9c4397b8b1b26.tar.gz |
pixdesc: Support pixelformat aliases
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
-rw-r--r-- | doc/APIchanges | 3 | ||||
-rw-r--r-- | libavutil/pixdesc.c | 4 | ||||
-rw-r--r-- | libavutil/pixdesc.h | 5 | ||||
-rw-r--r-- | libavutil/version.h | 4 |
4 files changed, 13 insertions, 3 deletions
diff --git a/doc/APIchanges b/doc/APIchanges index 7b5b19a96b..5b865462d7 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -13,6 +13,9 @@ libavutil: 2013-12-xx API changes, most recent first: +2014-08-xx - xxxxxxx - lavu 53.21.0 - pixdesc.h + Support name aliases for pixel formats. + 2014-08-xx - xxxxxxx - lavc 55.57.2 - avcodec.h 2014-08-xx - xxxxxxx - lavu 53.20.0 - frame.h Deprecate AVCodecContext.dtg_active_format and use side-data instead. diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index f2a3dd1a53..5443012539 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -22,6 +22,7 @@ #include <stdio.h> #include <string.h> +#include "avstring.h" #include "common.h" #include "pixfmt.h" #include "pixdesc.h" @@ -1507,7 +1508,8 @@ static enum AVPixelFormat get_pix_fmt_internal(const char *name) for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) if (av_pix_fmt_descriptors[pix_fmt].name && - !strcmp(av_pix_fmt_descriptors[pix_fmt].name, name)) + (!strcmp(av_pix_fmt_descriptors[pix_fmt].name, name) || + av_match_name(name, av_pix_fmt_descriptors[pix_fmt].alias))) return pix_fmt; return AV_PIX_FMT_NONE; diff --git a/libavutil/pixdesc.h b/libavutil/pixdesc.h index cfc3a04561..1c9e0af11f 100644 --- a/libavutil/pixdesc.h +++ b/libavutil/pixdesc.h @@ -95,6 +95,11 @@ typedef struct AVPixFmtDescriptor { * comp[2]. */ AVComponentDescriptor comp[4]; + + /** + * Alternative comma-separated names. + */ + const char *alias; } AVPixFmtDescriptor; /** diff --git a/libavutil/version.h b/libavutil/version.h index c5bd92705e..6f2873c612 100644 --- a/libavutil/version.h +++ b/libavutil/version.h @@ -54,8 +54,8 @@ */ #define LIBAVUTIL_VERSION_MAJOR 53 -#define LIBAVUTIL_VERSION_MINOR 20 -#define LIBAVUTIL_VERSION_MICRO 1 +#define LIBAVUTIL_VERSION_MINOR 21 +#define LIBAVUTIL_VERSION_MICRO 0 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \ |