From 62bdb117acb0c7600e1b825278196ee1de24a755 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Mon, 4 May 2015 02:18:22 +1000 Subject: [PATCH] video: check colorimetry and chroma_site equality in gst_video_info_is_equal() 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 | 5 +++++ gst-libs/gst/video/video-info.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/gst-libs/gst/video/video-info.c b/gst-libs/gst/video/video-info.c index 4338aec..03e1476 100644 --- a/gst-libs/gst/video/video-info.c +++ b/gst-libs/gst/video/video-info.c @@ -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]) diff --git a/gst-libs/gst/video/video-info.h b/gst-libs/gst/video/video-info.h index 8b1210d..20c653b 100644 --- a/gst-libs/gst/video/video-info.h +++ b/gst-libs/gst/video/video-info.h @@ -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)) -- 2.7.4