* commit '5a419b2dd1881889d436f55741fd3ff3f9f436c4': pixdesc: return color properties names Conflicts: libavutil/pixdesc.c libavutil/pixdesc.h libavutil/version.h
Unified · Split
| @@ -15,6 +15,9 @@ libavutil: 2014-08-09 · 14 unmodified lines | |||
| 15 | 15 | ||
| 16 | API changes, most recent first: | 16 | API changes, most recent first: |
| 17 | 17 | ||
| 18 | 2014-09-xx - xxxxxxx - lavu 54.04.0 - pixdesc.h | ||
| 19 | Add API to return the name of frame and context color properties. | ||
| 20 | |||
| 18 | 2014-09-xx - xxxxxxx - lavc 56.2.0 - vdpau.h | 21 | 2014-09-xx - xxxxxxx - lavc 56.2.0 - vdpau.h |
| 19 | Add av_vdpau_bind_context(). This function should now be used for creating | 22 | Add av_vdpau_bind_context(). This function should now be used for creating |
| 20 | (or resetting) a AVVDPAUContext instead of av_vdpau_alloc_context(). | 23 | (or resetting) a AVVDPAUContext instead of av_vdpau_alloc_context(). |
| @@ -1902,6 +1902,33 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { · 1901 unmodified lines | |||
| 1902 | }, | 1902 | }, |
| 1903 | }; | 1903 | }; |
| 1904 | 1904 | ||
| 1905 | static const char *color_range_names[AVCOL_RANGE_NB] = { | ||
| 1906 | "unknown", "tv", "pc", | ||
| 1907 | }; | ||
| 1908 | |||
| 1909 | static const char *color_primaries_names[AVCOL_PRI_NB] = { | ||
| 1910 | "reserved", "bt709", "unknown", "reserved", "bt470m", | ||
| 1911 | "bt470bg", "smpte170m", "smpte240m", "film", "bt2020", | ||
| 1912 | }; | ||
| 1913 | |||
| 1914 | static const char *color_transfer_names[AVCOL_TRC_NB] = { | ||
| 1915 | "reserved", "bt709", "unknown", "reserved", "bt470m", | ||
| 1916 | "bt470bg", "smpte170m", "smpte240m", "linear", "log100", | ||
| 1917 | "log316", "iec61966-2-4", "bt1361e", "iec61966-2-1", | ||
| 1918 | "bt2020-10", "bt2020-20", | ||
| 1919 | }; | ||
| 1920 | |||
| 1921 | static const char *color_space_names[AVCOL_SPC_NB] = { | ||
| 1922 | "gbr", "bt709", "unknown", "reserved", "fcc", | ||
| 1923 | "bt470bg", "smpte170m", "smpte240m", "ycgco", | ||
| 1924 | "bt2020nc", "bt2020c", | ||
| 1925 | }; | ||
| 1926 | |||
| 1927 | static const char *chroma_location_names[AVCHROMA_LOC_NB] = { | ||
| 1928 | "unspecified", "left", "center", "topleft", | ||
| 1929 | "top", "bottomleft", "bottom", | ||
| 1930 | }; | ||
| 1931 | |||
| 1905 | FF_DISABLE_DEPRECATION_WARNINGS | 1932 | FF_DISABLE_DEPRECATION_WARNINGS |
| 1906 | static enum AVPixelFormat get_pix_fmt_internal(const char *name) | 1933 | static enum AVPixelFormat get_pix_fmt_internal(const char *name) |
| 1907 | { | 1934 | { |
| @@ -2305,6 +2332,36 @@ enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, en · 397 unmodified lines | |||
| 2305 | return dst_pix_fmt; | 2332 | return dst_pix_fmt; |
| 2306 | } | 2333 | } |
| 2307 | 2334 | ||
| 2335 | const char *av_color_range_name(enum AVColorRange range) | ||
| 2336 | { | ||
| 2337 | return (unsigned) range < AVCOL_RANGE_NB ? | ||
| 2338 | color_range_names[range] : NULL; | ||
| 2339 | } | ||
| 2340 | |||
| 2341 | const char *av_color_primaries_name(enum AVColorPrimaries primaries) | ||
| 2342 | { | ||
| 2343 | return (unsigned) primaries < AVCOL_PRI_NB ? | ||
| 2344 | color_primaries_names[primaries] : NULL; | ||
| 2345 | } | ||
| 2346 | |||
| 2347 | const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer) | ||
| 2348 | { | ||
| 2349 | return (unsigned) transfer < AVCOL_TRC_NB ? | ||
| 2350 | color_transfer_names[transfer] : NULL; | ||
| 2351 | } | ||
| 2352 | |||
| 2353 | const char *av_color_space_name(enum AVColorSpace space) | ||
| 2354 | { | ||
| 2355 | return (unsigned) space < AVCOL_SPC_NB ? | ||
| 2356 | color_space_names[space] : NULL; | ||
| 2357 | } | ||
| 2358 | |||
| 2359 | const char *av_chroma_location_name(enum AVChromaLocation location) | ||
| 2360 | { | ||
| 2361 | return (unsigned) location < AVCHROMA_LOC_NB ? | ||
| 2362 | chroma_location_names[location] : NULL; | ||
| 2363 | } | ||
| 2364 | |||
| 2308 | #ifdef TEST | 2365 | #ifdef TEST |
| 2309 | 2366 | ||
| 2310 | int main(void){ | 2367 | int main(void){ |
| @@ -2332,3 +2389,4 @@ int main(void){ · 21 unmodified lines | |||
| 2332 | } | 2389 | } |
| 2333 | 2390 | ||
| 2334 | #endif | 2391 | #endif |
| 2392 | |||
| @@ -356,4 +356,30 @@ int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, · 355 unmodified lines | |||
| 356 | */ | 356 | */ |
| 357 | enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, | 357 | enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, |
| 358 | enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); | 358 | enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); |
| 359 | |||
| 360 | /** | ||
| 361 | * @return the name for provided color range or NULL if unknown. | ||
| 362 | */ | ||
| 363 | const char *av_color_range_name(enum AVColorRange range); | ||
| 364 | |||
| 365 | /** | ||
| 366 | * @return the name for provided color primaries or NULL if unknown. | ||
| 367 | */ | ||
| 368 | const char *av_color_primaries_name(enum AVColorPrimaries primaries); | ||
| 369 | |||
| 370 | /** | ||
| 371 | * @return the name for provided color transfer or NULL if unknown. | ||
| 372 | */ | ||
| 373 | const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer); | ||
| 374 | |||
| 375 | /** | ||
| 376 | * @return the name for provided color space or NULL if unknown. | ||
| 377 | */ | ||
| 378 | const char *av_color_space_name(enum AVColorSpace space); | ||
| 379 | |||
| 380 | /** | ||
| 381 | * @return the name for provided chroma location or NULL if unknown. | ||
| 382 | */ | ||
| 383 | const char *av_chroma_location_name(enum AVChromaLocation location); | ||
| 384 | |||
| 359 | #endif /* AVUTIL_PIXDESC_H */ | 385 | #endif /* AVUTIL_PIXDESC_H */ |
| @@ -56,8 +56,8 @@ · 55 unmodified lines | |||
| 56 | */ | 56 | */ |
| 57 | 57 | ||
| 58 | #define LIBAVUTIL_VERSION_MAJOR 54 | 58 | #define LIBAVUTIL_VERSION_MAJOR 54 |
| 59 | #define LIBAVUTIL_VERSION_MINOR 9 | 59 | #define LIBAVUTIL_VERSION_MINOR 10 |
| 60 | #define LIBAVUTIL_VERSION_MICRO 101 | 60 | #define LIBAVUTIL_VERSION_MICRO 100 |
| 61 | 61 | ||
| 62 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ | 62 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |
| 63 | LIBAVUTIL_VERSION_MINOR, \ | 63 | LIBAVUTIL_VERSION_MINOR, \ |