diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-26 19:19:18 +0200 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-28 18:25:40 +0200 |
commit | e71f26086ab899be7df1efb30b33e0a11973fd8e (patch) | |
tree | e4e1579d6cd528b113512f50d5995b3933b9ded8 /libavutil | |
parent | 34e9c9b11192271a4e5d0557441d09686852c771 (diff) | |
download | ffmpeg-e71f26086ab899be7df1efb30b33e0a11973fd8e.tar.gz |
lavu: add av_get_pix_fmt_name() convenience function
Also deprecate avcodec_get_pix_fmt_name() in its favor.
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/avutil.h | 4 | ||||
-rw-r--r-- | libavutil/pixdesc.c | 6 | ||||
-rw-r--r-- | libavutil/pixdesc.h | 9 |
3 files changed, 17 insertions, 2 deletions
diff --git a/libavutil/avutil.h b/libavutil/avutil.h index ca3e029459..e3bc6c72fa 100644 --- a/libavutil/avutil.h +++ b/libavutil/avutil.h @@ -40,8 +40,8 @@ #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) #define LIBAVUTIL_VERSION_MAJOR 51 -#define LIBAVUTIL_VERSION_MINOR 2 -#define LIBAVUTIL_VERSION_MICRO 2 +#define LIBAVUTIL_VERSION_MINOR 3 +#define LIBAVUTIL_VERSION_MICRO 0 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ LIBAVUTIL_VERSION_MINOR, \ diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index f8f99289f9..57a3860e71 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -906,6 +906,12 @@ static enum PixelFormat get_pix_fmt_internal(const char *name) return PIX_FMT_NONE; } +const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt) +{ + return (unsigned)pix_fmt < PIX_FMT_NB ? + av_pix_fmt_descriptors[pix_fmt].name : NULL; +} + #if HAVE_BIGENDIAN # define X_NE(be, le) be #else diff --git a/libavutil/pixdesc.h b/libavutil/pixdesc.h index 727e47f06a..fad6d59d87 100644 --- a/libavutil/pixdesc.h +++ b/libavutil/pixdesc.h @@ -22,6 +22,7 @@ #ifndef AVUTIL_PIXDESC_H #define AVUTIL_PIXDESC_H +#include "pixfmt.h" #include <inttypes.h> typedef struct AVComponentDescriptor{ @@ -142,6 +143,14 @@ void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesi enum PixelFormat av_get_pix_fmt(const char *name); /** + * Return the short name for a pixel format, NULL in case pix_fmt is + * unknown. + * + * @see av_get_pix_fmt(), av_get_pix_fmt_string() + */ +const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt); + +/** * Print in buf the string corresponding to the pixel format with * number pix_fmt, or an header if pix_fmt is negative. * |