Also deprecate avcodec_get_pix_fmt_name() in its favor.
Unified · Split
| @@ -13,6 +13,10 @@ libavutil: 2011-04-18 · 12 unmodified lines | |||
| 13 | 13 | ||
| 14 | API changes, most recent first: | 14 | API changes, most recent first: |
| 15 | 15 | ||
| 16 | 2011-05-28 - xxxxxx - lavu 51.3.0 - pixdesc.h | ||
| 17 | Add av_get_pix_fmt_name() in libavutil/pixdesc.h, and deprecate | ||
| 18 | avcodec_get_pix_fmt_name() in libavcodec/avcodec.h in its favor. | ||
| 19 | |||
| 16 | 2011-05-22 - xxxxxx - lavf 53.2.0 - avformat.h | 20 | 2011-05-22 - xxxxxx - lavf 53.2.0 - avformat.h |
| 17 | Introduce avformat_alloc_output_context2() and deprecate | 21 | Introduce avformat_alloc_output_context2() and deprecate |
| 18 | avformat_alloc_output_context(). | 22 | avformat_alloc_output_context(). |
| @@ -3391,12 +3391,16 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, · 3390 unmodified lines | |||
| 3391 | int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height); | 3391 | int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height); |
| 3392 | void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift); | 3392 | void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift); |
| 3393 | 3393 | ||
| 3394 | #if FF_API_GET_PIX_FMT_NAME | ||
| 3394 | /** | 3395 | /** |
| 3395 | * Return the short name for a pixel format. | 3396 | * Return the short name for a pixel format. |
| 3396 | * | 3397 | * |
| 3397 | * \see av_get_pix_fmt(), av_get_pix_fmt_string(). | 3398 | * \see av_get_pix_fmt(), av_get_pix_fmt_string(). |
| 3399 | * @deprecated Deprecated in favor of av_get_pix_fmt_name(). | ||
| 3398 | */ | 3400 | */ |
| 3401 | attribute_deprecated | ||
| 3399 | const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt); | 3402 | const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt); |
| 3403 | #endif | ||
| 3400 | 3404 | ||
| 3401 | void avcodec_set_dimensions(AVCodecContext *s, int width, int height); | 3405 | void avcodec_set_dimensions(AVCodecContext *s, int width, int height); |
| 3402 | 3406 | ||
| @@ -417,13 +417,12 @@ void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int * · 416 unmodified lines | |||
| 417 | *v_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_h; | 417 | *v_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_h; |
| 418 | } | 418 | } |
| 419 | 419 | ||
| 420 | #if FF_API_GET_PIX_FMT_NAME | ||
| 420 | const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt) | 421 | const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt) |
| 421 | { | 422 | { |
| 422 | if ((unsigned)pix_fmt >= PIX_FMT_NB) | 423 | return av_get_pix_fmt_name(pix_fmt); |
| 423 | return NULL; | ||
| 424 | else | ||
| 425 | return av_pix_fmt_descriptors[pix_fmt].name; | ||
| 426 | } | 424 | } |
| 425 | #endif | ||
| 427 | 426 | ||
| 428 | int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt) | 427 | int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt) |
| 429 | { | 428 | { |
| @@ -22,7 +22,7 @@ · 21 unmodified lines | |||
| 22 | 22 | ||
| 23 | #define LIBAVCODEC_VERSION_MAJOR 53 | 23 | #define LIBAVCODEC_VERSION_MAJOR 53 |
| 24 | #define LIBAVCODEC_VERSION_MINOR 6 | 24 | #define LIBAVCODEC_VERSION_MINOR 6 |
| 25 | #define LIBAVCODEC_VERSION_MICRO 0 | 25 | #define LIBAVCODEC_VERSION_MICRO 1 |
| 26 | 26 | ||
| 27 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ | 27 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |
| 28 | LIBAVCODEC_VERSION_MINOR, \ | 28 | LIBAVCODEC_VERSION_MINOR, \ |
| @@ -65,5 +65,8 @@ · 36 unmodified lines | |||
| 65 | #ifndef FF_API_FLAC_GLOBAL_OPTS | 65 | #ifndef FF_API_FLAC_GLOBAL_OPTS |
| 66 | #define FF_API_FLAC_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54) | 66 | #define FF_API_FLAC_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54) |
| 67 | #endif | 67 | #endif |
| 68 | #ifndef FF_API_GET_PIX_FMT_NAME | ||
| 69 | #define FF_API_GET_PIX_FMT_NAME (LIBAVCODEC_VERSION_MAJOR < 54) | ||
| 70 | #endif | ||
| 68 | 71 | ||
| 69 | #endif /* AVCODEC_VERSION_H */ | 72 | #endif /* AVCODEC_VERSION_H */ |
| @@ -40,8 +40,8 @@ · 39 unmodified lines | |||
| 40 | #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) | 40 | #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) |
| 41 | 41 | ||
| 42 | #define LIBAVUTIL_VERSION_MAJOR 51 | 42 | #define LIBAVUTIL_VERSION_MAJOR 51 |
| 43 | #define LIBAVUTIL_VERSION_MINOR 2 | 43 | #define LIBAVUTIL_VERSION_MINOR 3 |
| 44 | #define LIBAVUTIL_VERSION_MICRO 2 | 44 | #define LIBAVUTIL_VERSION_MICRO 0 |
| 45 | 45 | ||
| 46 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ | 46 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |
| 47 | LIBAVUTIL_VERSION_MINOR, \ | 47 | LIBAVUTIL_VERSION_MINOR, \ |
| @@ -906,6 +906,12 @@ static enum PixelFormat get_pix_fmt_internal(const char *name) · 905 unmodified lines | |||
| 906 | return PIX_FMT_NONE; | 906 | return PIX_FMT_NONE; |
| 907 | } | 907 | } |
| 908 | 908 | ||
| 909 | const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt) | ||
| 910 | { | ||
| 911 | return (unsigned)pix_fmt < PIX_FMT_NB ? | ||
| 912 | av_pix_fmt_descriptors[pix_fmt].name : NULL; | ||
| 913 | } | ||
| 914 | |||
| 909 | #if HAVE_BIGENDIAN | 915 | #if HAVE_BIGENDIAN |
| 910 | # define X_NE(be, le) be | 916 | # define X_NE(be, le) be |
| 911 | #else | 917 | #else |
| @@ -22,6 +22,7 @@ · 21 unmodified lines | |||
| 22 | #ifndef AVUTIL_PIXDESC_H | 22 | #ifndef AVUTIL_PIXDESC_H |
| 23 | #define AVUTIL_PIXDESC_H | 23 | #define AVUTIL_PIXDESC_H |
| 24 | 24 | ||
| 25 | #include "pixfmt.h" | ||
| 25 | #include <inttypes.h> | 26 | #include <inttypes.h> |
| 26 | 27 | ||
| 27 | typedef struct AVComponentDescriptor{ | 28 | typedef struct AVComponentDescriptor{ |
| @@ -141,6 +142,14 @@ void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesi · 113 unmodified lines | |||
| 141 | */ | 142 | */ |
| 142 | enum PixelFormat av_get_pix_fmt(const char *name); | 143 | enum PixelFormat av_get_pix_fmt(const char *name); |
| 143 | 144 | ||
| 145 | /** | ||
| 146 | * Return the short name for a pixel format, NULL in case pix_fmt is | ||
| 147 | * unknown. | ||
| 148 | * | ||
| 149 | * @see av_get_pix_fmt(), av_get_pix_fmt_string() | ||
| 150 | */ | ||
| 151 | const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt); | ||
| 152 | |||
| 144 | /** | 153 | /** |
| 145 | * Print in buf the string corresponding to the pixel format with | 154 | * Print in buf the string corresponding to the pixel format with |
| 146 | * number pix_fmt, or an header if pix_fmt is negative. | 155 | * number pix_fmt, or an header if pix_fmt is negative. |