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
1515
1616 API changes, most recent first:
1717
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+
1821 2014-09-xx - xxxxxxx - lavc 56.2.0 - vdpau.h
1922 Add av_vdpau_bind_context(). This function should now be used for creating
2023 (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
19021902 },
19031903 };
19041904
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+
19051932 FF_DISABLE_DEPRECATION_WARNINGS
19061933 static enum AVPixelFormat get_pix_fmt_internal(const char *name)
19071934 {
@@ -2305,6 +2332,36 @@ enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, en · 397 unmodified lines
23052332 return dst_pix_fmt;
23062333 }
23072334
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+
23082365 #ifdef TEST
23092366
23102367 int main(void){
@@ -2332,3 +2389,4 @@ int main(void){ · 21 unmodified lines
23322389 }
23332390
23342391 #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
356356 */
357357 enum AVPixelFormat av_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2,
358358 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+
359385 #endif /* AVUTIL_PIXDESC_H */
libavutil/version.h+2−2
@@ -56,8 +56,8 @@ · 55 unmodified lines
5656 */
5757
5858 #define LIBAVUTIL_VERSION_MAJOR 54
59−#define LIBAVUTIL_VERSION_MINOR 9
60−#define LIBAVUTIL_VERSION_MICRO 101
59+#define LIBAVUTIL_VERSION_MINOR 10
60+#define LIBAVUTIL_VERSION_MICRO 100
6161
6262 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
6363 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