video: check colorimetry and chroma_site equality in gst_video_info_is_equal()
authorJan Schmidt <jan@centricular.com>
Sun, 3 May 2015 16:18:22 +0000 (02:18 +1000)
committerJan Schmidt <jan@centricular.com>
Mon, 4 May 2015 03:16:27 +0000 (13:16 +1000)
Add VideoInfo accessors for colorimetry and chroma_site and use them
when checking the equality of two GstVideoInfo

gst-libs/gst/video/video-info.c
gst-libs/gst/video/video-info.h

index 4338aec..03e1476 100644 (file)
@@ -370,6 +370,11 @@ gst_video_info_is_equal (const GstVideoInfo * info, const GstVideoInfo * other)
     return FALSE;
   if (GST_VIDEO_INFO_FPS_D (info) != GST_VIDEO_INFO_FPS_D (other))
     return FALSE;
+  if (!gst_video_colorimetry_is_equal (&GST_VIDEO_INFO_COLORIMETRY (info),
+          &GST_VIDEO_INFO_COLORIMETRY (other)))
+    return FALSE;
+  if (GST_VIDEO_INFO_CHROMA_SITE (info) != GST_VIDEO_INFO_CHROMA_SITE (other))
+    return FALSE;
 
   for (i = 0; i < info->finfo->n_planes; i++) {
     if (info->stride[i] != other->stride[i])
index 8b1210d..20c653b 100644 (file)
@@ -144,6 +144,9 @@ struct _GstVideoInfo {
 #define GST_VIDEO_INFO_FPS_N(i)          ((i)->fps_n)
 #define GST_VIDEO_INFO_FPS_D(i)          ((i)->fps_d)
 
+#define GST_VIDEO_INFO_COLORIMETRY(i) ((i)->colorimetry)
+#define GST_VIDEO_INFO_CHROMA_SITE(i) ((i)->chroma_site)
+
 /* dealing with GstVideoInfo flags */
 #define GST_VIDEO_INFO_FLAG_IS_SET(i,flag) ((GST_VIDEO_INFO_FLAGS(i) & (flag)) == (flag))
 #define GST_VIDEO_INFO_FLAG_SET(i,flag)    (GST_VIDEO_INFO_FLAGS(i) |= (flag))