video-color: Add compile-time assert for ColorimetryInfo enum

A comment is not sufficient because this will break when
cherry-picking or backporting commits.
This commit is contained in:
Nirbheek Chauhan 2019-06-26 17:05:04 +05:30
parent fb842a3fdb
commit 12d534bada

View file

@ -80,6 +80,10 @@ static const ColorimetryInfo colorimetry[] = {
MAKE_COLORIMETRY (NONAME, _UNKNOWN, UNKNOWN, UNKNOWN, UNKNOWN),
};
/* Ensure that DEFAULT_UNKNOWN is indeed updated */
G_STATIC_ASSERT (sizeof (colorimetry) ==
(sizeof (gchar *) + sizeof (GstVideoColorimetry)) * (DEFAULT_UNKNOWN + 1));
static const ColorimetryInfo *
gst_video_get_colorimetry (const gchar * s)
{