Originally committed as revision 25879 to svn://svn.ffmpeg.org/ffmpeg/trunk
Unified · Split
| @@ -12,6 +12,10 @@ libavutil: 2009-03-08 · 11 unmodified lines | |||
| 12 | 12 | ||
| 13 | 13 | ||
| 14 | API changes, most recent first: | 14 | API changes, most recent first: |
| 15 | 2010-12-04 - r25879 - lavu 50.34.0 - av_get_pix_fmt_string() | ||
| 16 | Deprecate avcodec_pix_fmt_string() in favor of | ||
| 17 | pixdesc.h/av_get_pix_fmt_string(). | ||
| 18 | |||
| 15 | 2010-12-04 - r25878 - lavcore 1.15.0 - av_image_alloc() | 19 | 2010-12-04 - r25878 - lavcore 1.15.0 - av_image_alloc() |
| 16 | Add av_image_alloc() to libavcore/imgutils.h. | 20 | Add av_image_alloc() to libavcore/imgutils.h. |
| 17 | 21 | ||
| @@ -33,7 +33,7 @@ · 32 unmodified lines | |||
| 33 | 33 | ||
| 34 | #define LIBAVCODEC_VERSION_MAJOR 52 | 34 | #define LIBAVCODEC_VERSION_MAJOR 52 |
| 35 | #define LIBAVCODEC_VERSION_MINOR 97 | 35 | #define LIBAVCODEC_VERSION_MINOR 97 |
| 36 | #define LIBAVCODEC_VERSION_MICRO 2 | 36 | #define LIBAVCODEC_VERSION_MICRO 3 |
| 37 | 37 | ||
| 38 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ | 38 | #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ |
| 39 | LIBAVCODEC_VERSION_MINOR, \ | 39 | LIBAVCODEC_VERSION_MINOR, \ |
| @@ -3285,18 +3285,12 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_ · 3245 unmodified lines | |||
| 3285 | enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt, | 3285 | enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt, |
| 3286 | int has_alpha, int *loss_ptr); | 3286 | int has_alpha, int *loss_ptr); |
| 3287 | 3287 | ||
| 3288 | 3288 | #if LIBAVCODEC_VERSION_MAJOR < 53 | |
| 3289 | /** | 3289 | /** |
| 3290 | * Print in buf the string corresponding to the pixel format with | 3290 | * @deprecated Use av_get_pix_fmt_string() instead. |
| 3291 | * number pix_fmt, or an header if pix_fmt is negative. | ||
| 3292 | * | ||
| 3293 | * @param[in] buf the buffer where to write the string | ||
| 3294 | * @param[in] buf_size the size of buf | ||
| 3295 | * @param[in] pix_fmt the number of the pixel format to print the corresponding info string, or | ||
| 3296 | * a negative value to print the corresponding header. | ||
| 3297 | * Meaningful values for obtaining a pixel format info vary from 0 to PIX_FMT_NB -1. | ||
| 3298 | */ | 3291 | */ |
| 3299 | void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt); | 3292 | void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt); |
| 3293 | #endif | ||
| 3300 | 3294 | ||
| 3301 | #define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */ | 3295 | #define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */ |
| 3302 | #define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */ | 3296 | #define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */ |
| @@ -431,25 +431,12 @@ enum PixelFormat avcodec_get_pix_fmt(const char *name) · 430 unmodified lines | |||
| 431 | { | 431 | { |
| 432 | return av_get_pix_fmt(name); | 432 | return av_get_pix_fmt(name); |
| 433 | } | 433 | } |
| 434 | #endif | ||
| 435 | 434 | ||
| 436 | void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt) | 435 | void avcodec_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt) |
| 437 | { | 436 | { |
| 438 | /* print header */ | 437 | av_get_pix_fmt_string(buf, buf_size, pix_fmt); |
| 439 | if (pix_fmt < 0) | ||
| 440 | snprintf (buf, buf_size, | ||
| 441 | "name " " nb_components" " nb_bits" | ||
| 442 | ); | ||
| 443 | else{ | ||
| 444 | const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt]; | ||
| 445 | snprintf (buf, buf_size, | ||
| 446 | "%-11s %7d %10d", | ||
| 447 | pixdesc->name, | ||
| 448 | pixdesc->nb_components, | ||
| 449 | av_get_bits_per_pixel(pixdesc) | ||
| 450 | ); | ||
| 451 | } | ||
| 452 | } | 438 | } |
| 439 | #endif | ||
| 453 | 440 | ||
| 454 | int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt) | 441 | int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt) |
| 455 | { | 442 | { |
| @@ -40,7 +40,7 @@ · 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 50 | 42 | #define LIBAVUTIL_VERSION_MAJOR 50 |
| 43 | #define LIBAVUTIL_VERSION_MINOR 33 | 43 | #define LIBAVUTIL_VERSION_MINOR 34 |
| 44 | #define LIBAVUTIL_VERSION_MICRO 0 | 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, \ |
| @@ -851,3 +851,17 @@ int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc) · 850 unmodified lines | |||
| 851 | 851 | ||
| 852 | return bits >> log2_pixels; | 852 | return bits >> log2_pixels; |
| 853 | } | 853 | } |
| 854 | |||
| 855 | char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt) | ||
| 856 | { | ||
| 857 | /* print header */ | ||
| 858 | if (pix_fmt < 0) { | ||
| 859 | snprintf (buf, buf_size, "name " " nb_components" " nb_bits"); | ||
| 860 | } else { | ||
| 861 | const AVPixFmtDescriptor *pixdesc = &av_pix_fmt_descriptors[pix_fmt]; | ||
| 862 | snprintf(buf, buf_size, "%-11s %7d %10d", | ||
| 863 | pixdesc->name, pixdesc->nb_components, av_get_bits_per_pixel(pixdesc)); | ||
| 864 | } | ||
| 865 | |||
| 866 | return buf; | ||
| 867 | } | ||
| @@ -141,6 +141,18 @@ void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesi · 140 unmodified lines | |||
| 141 | */ | 141 | */ |
| 142 | enum PixelFormat av_get_pix_fmt(const char *name); | 142 | enum PixelFormat av_get_pix_fmt(const char *name); |
| 143 | 143 | ||
| 144 | /** | ||
| 145 | * Print in buf the string corresponding to the pixel format with | ||
| 146 | * number pix_fmt, or an header if pix_fmt is negative. | ||
| 147 | * | ||
| 148 | * @param buf the buffer where to write the string | ||
| 149 | * @param buf_size the size of buf | ||
| 150 | * @param pix_fmt the number of the pixel format to print the | ||
| 151 | * corresponding info string, or a negative value to print the | ||
| 152 | * corresponding header. | ||
| 153 | */ | ||
| 154 | char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt); | ||
| 155 | |||
| 144 | /** | 156 | /** |
| 145 | * Return the number of bits per pixel used by the pixel format | 157 | * Return the number of bits per pixel used by the pixel format |
| 146 | * described by pixdesc. | 158 | * described by pixdesc. |