summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--doc/APIchanges3
-rw-r--r--libavutil/pixdesc.c5
-rw-r--r--libavutil/pixdesc.h5
-rw-r--r--libavutil/version.h4
4 files changed, 13 insertions, 4 deletions
diff --git a/doc/APIchanges b/doc/APIchanges
index 4455fbf..b8bcddf 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2012-10-22
API changes, most recent first:
+2014-08-xx - xxxxxxx - lavu 53.21.0 - pixdesc.h
+ Support name aliases for pixel formats.
+
2014-08-04 - xxxxxxx - lavc 55.72.101 / 55.57.2 - avcodec.h
2014-08-04 - xxxxxxx - lavu 52.95.100 / 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 73d89a0..7e5cedd 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -23,12 +23,12 @@
#include <string.h>
#include "avassert.h"
+#include "avstring.h"
#include "common.h"
#include "pixfmt.h"
#include "pixdesc.h"
#include "internal.h"
#include "intreadwrite.h"
-#include "avstring.h"
#include "version.h"
void av_read_image_line(uint16_t *dst,
@@ -1887,7 +1887,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 0586280..41e81db 100644
--- a/libavutil/pixdesc.h
+++ b/libavutil/pixdesc.h
@@ -98,6 +98,11 @@ typedef struct AVPixFmtDescriptor {
* otherwise 0 is luma, 1 is chroma-U and 2 is chroma-V.
*/
AVComponentDescriptor comp[4];
+
+ /**
+ * Alternative comma-separated names.
+ */
+ const char *alias;
} AVPixFmtDescriptor;
/**
diff --git a/libavutil/version.h b/libavutil/version.h
index 9b38c09..69001f3 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -56,8 +56,8 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 52
-#define LIBAVUTIL_VERSION_MINOR 95
-#define LIBAVUTIL_VERSION_MICRO 101
+#define LIBAVUTIL_VERSION_MINOR 96
+#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
OpenPOWER on IntegriCloud