From: Luca Barbato <[email protected]>

Signed-off-by: Vittorio Giovara <[email protected]>
---
 doc/APIchanges      | 3 +++
 libavutil/pixdesc.c | 4 +++-
 libavutil/pixdesc.h | 5 +++++
 libavutil/version.h | 2 +-
 4 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 261993b..41cc34d 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -13,6 +13,9 @@ libavutil:     2013-12-xx
 
 API changes, most recent first:
 
+2014-07-xx - xxxxxxx - lavu 53.20.0 - pixdesc.h
+  Support name aliases for pixel formats.
+
 2014-07-xx - xxxxxxx - lavu 53.19.0 - avstring.h
   Make name matching function from lavf public as av_match_name().
 
diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index f2a3dd1..5443012 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 cfc3a04..1c9e0af 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 e981948..820fdc6 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -54,7 +54,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR 53
-#define LIBAVUTIL_VERSION_MINOR 19
+#define LIBAVUTIL_VERSION_MINOR 20
 #define LIBAVUTIL_VERSION_MICRO  0
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
-- 
1.8.5.2 (Apple Git-48)

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to