History

Merge commit '5a419b2dd1881889d436f55741fd3ff3f9f436c4'

* commit '5a419b2dd1881889d436f55741fd3ff3f9f436c4': pixdesc: return color properties names Conflicts: libavutil/pixdesc.c libavutil/pixdesc.h libavutil/version.h

Michael Niedermayer committed 12 years ago

Commit bb44f7d2 parents 7eb959b 5a419b24 files · +89 −2Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavutil/pixdesc.c +58 −0
  3. libavutil/pixdesc.h +26 −0
  4. libavutil/version.h +2 −2
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2014-08-09 · 14 unmodified lines
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182014-09-xx - xxxxxxx - lavu 54.04.0 - pixdesc.h
19 Add API to return the name of frame and context color properties.
20
182014-09-xx - xxxxxxx - lavc 56.2.0 - vdpau.h212014-09-xx - xxxxxxx - lavc 56.2.0 - vdpau.h
19 Add av_vdpau_bind_context(). This function should now be used for creating22 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().
libavutil/pixdesc.c+58−0
@@ -1902,6 +1902,33 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { · 1901 unmodified lines
1902 },1902 },
1903};1903};
1904 1904
1905static const char *color_range_names[AVCOL_RANGE_NB] = {
1906 "unknown", "tv", "pc",
1907};
1908
1909static const char *color_primaries_names[AVCOL_PRI_NB] = {
1910 "reserved", "bt709", "unknown", "reserved", "bt470m",
1911 "bt470bg", "smpte170m", "smpte240m", "film", "bt2020",
1912};
1913
1914static 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
1921static const char *color_space_names[AVCOL_SPC_NB] = {
1922 "gbr", "bt709", "unknown", "reserved", "fcc",
1923 "bt470bg", "smpte170m", "smpte240m", "ycgco",
1924 "bt2020nc", "bt2020c",
1925};
1926
1927static const char *chroma_location_names[AVCHROMA_LOC_NB] = {
1928 "unspecified", "left", "center", "topleft",
1929 "top", "bottomleft", "bottom",
1930};
1931
1905FF_DISABLE_DEPRECATION_WARNINGS1932FF_DISABLE_DEPRECATION_WARNINGS
1906static enum AVPixelFormat get_pix_fmt_internal(const char *name)1933static 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
2335const char *av_color_range_name(enum AVColorRange range)
2336{
2337 return (unsigned) range < AVCOL_RANGE_NB ?
2338 color_range_names[range] : NULL;
2339}
2340
2341const char *av_color_primaries_name(enum AVColorPrimaries primaries)
2342{
2343 return (unsigned) primaries < AVCOL_PRI_NB ?
2344 color_primaries_names[primaries] : NULL;
2345}
2346
2347const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer)
2348{
2349 return (unsigned) transfer < AVCOL_TRC_NB ?
2350 color_transfer_names[transfer] : NULL;
2351}
2352
2353const char *av_color_space_name(enum AVColorSpace space)
2354{
2355 return (unsigned) space < AVCOL_SPC_NB ?
2356 color_space_names[space] : NULL;
2357}
2358
2359const 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 TEST2365#ifdef TEST
2309 2366
2310int main(void){2367int main(void){
@@ -2332,3 +2389,4 @@ int main(void){ · 21 unmodified lines
2332}2389}
2333 2390
2334#endif2391#endif
2392
libavutil/pixdesc.h+26−0
@@ -356,4 +356,30 @@ int av_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, · 355 unmodified lines
356 */356 */
357enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,357enum 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 */
363const char *av_color_range_name(enum AVColorRange range);
364
365/**
366 * @return the name for provided color primaries or NULL if unknown.
367 */
368const char *av_color_primaries_name(enum AVColorPrimaries primaries);
369
370/**
371 * @return the name for provided color transfer or NULL if unknown.
372 */
373const char *av_color_transfer_name(enum AVColorTransferCharacteristic transfer);
374
375/**
376 * @return the name for provided color space or NULL if unknown.
377 */
378const char *av_color_space_name(enum AVColorSpace space);
379
380/**
381 * @return the name for provided chroma location or NULL if unknown.
382 */
383const char *av_chroma_location_name(enum AVChromaLocation location);
384
359#endif /* AVUTIL_PIXDESC_H */385#endif /* AVUTIL_PIXDESC_H */
libavutil/version.h+2−2
@@ -56,8 +56,8 @@ · 55 unmodified lines
56 */56 */
57 57
58#define LIBAVUTIL_VERSION_MAJOR 5458#define LIBAVUTIL_VERSION_MAJOR 54
59#define LIBAVUTIL_VERSION_MINOR 959#define LIBAVUTIL_VERSION_MINOR 10
60#define LIBAVUTIL_VERSION_MICRO 10160#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, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t