video-color: keep UNKNOWN colorimetry define automatically up-to-date

Follow-up to !310 and helps with backport commits like !360
This commit is contained in:
Tim-Philipp Müller 2019-08-11 14:16:51 +01:00
parent fe9c38244f
commit 81dd81b739

View file

@ -63,10 +63,6 @@ typedef struct
#define GST_VIDEO_COLORIMETRY_NONAME NULL #define GST_VIDEO_COLORIMETRY_NONAME NULL
#define DEFAULT_UNKNOWN 9
/* NOTE: If you add an entry below, don't forget to update DEFAULT_UNKNOWN
* above */
static const ColorimetryInfo colorimetry[] = { static const ColorimetryInfo colorimetry[] = {
MAKE_COLORIMETRY (BT601, _16_235, BT601, BT709, SMPTE170M), MAKE_COLORIMETRY (BT601, _16_235, BT601, BT709, SMPTE170M),
MAKE_COLORIMETRY (BT709, _16_235, BT709, BT709, BT709), MAKE_COLORIMETRY (BT709, _16_235, BT709, BT709, BT709),
@ -77,12 +73,10 @@ static const ColorimetryInfo colorimetry[] = {
MAKE_COLORIMETRY (BT2100_PQ, _16_235, BT2020, SMPTE2084, BT2020), MAKE_COLORIMETRY (BT2100_PQ, _16_235, BT2020, SMPTE2084, BT2020),
MAKE_COLORIMETRY (BT2100_HLG, _16_235, BT2020, ARIB_STD_B67, BT2020), MAKE_COLORIMETRY (BT2100_HLG, _16_235, BT2020, ARIB_STD_B67, BT2020),
MAKE_COLORIMETRY (NONAME, _0_255, BT601, UNKNOWN, UNKNOWN), MAKE_COLORIMETRY (NONAME, _0_255, BT601, UNKNOWN, UNKNOWN),
MAKE_COLORIMETRY (NONAME, _UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN), MAKE_COLORIMETRY (NONAME, _UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN), /* Keep last! */
}; };
/* Ensure that DEFAULT_UNKNOWN is indeed updated */ #define DEFAULT_UNKNOWN (G_N_ELEMENTS(colorimetry)-1)
G_STATIC_ASSERT (sizeof (colorimetry) ==
(sizeof (gchar *) + sizeof (GstVideoColorimetry)) * (DEFAULT_UNKNOWN + 1));
static const ColorimetryInfo * static const ColorimetryInfo *
gst_video_get_colorimetry (const gchar * s) gst_video_get_colorimetry (const gchar * s)