diff --git a/gst-libs/gst/video/video.c b/gst-libs/gst/video/video.c index 5cf9a75105..9231d01035 100644 --- a/gst-libs/gst/video/video.c +++ b/gst-libs/gst/video/video.c @@ -1530,6 +1530,42 @@ no_endianess: } } +/** + * gst_video_info_is_equal: + * @info: a #GstVideoInfo + * @other: a #GstVideoInfo + * + * Compares two #GstVideoInfo and returns whether they are equal or not + * + * Returns: %TRUE if @info and @other are equal, else %FALSE. + */ +gboolean +gst_video_info_is_equal (const GstVideoInfo * info, const GstVideoInfo * other) +{ + if (GST_VIDEO_INFO_FORMAT (info) != GST_VIDEO_INFO_FORMAT (other)) + return FALSE; + if (GST_VIDEO_INFO_INTERLACE_MODE (info) != + GST_VIDEO_INFO_INTERLACE_MODE (other)) + return FALSE; + if (GST_VIDEO_INFO_FLAGS (info) != GST_VIDEO_INFO_FLAGS (other)) + return FALSE; + if (GST_VIDEO_INFO_WIDTH (info) != GST_VIDEO_INFO_WIDTH (other)) + return FALSE; + if (GST_VIDEO_INFO_HEIGHT (info) != GST_VIDEO_INFO_HEIGHT (other)) + return FALSE; + if (GST_VIDEO_INFO_SIZE (info) != GST_VIDEO_INFO_SIZE (other)) + return FALSE; + if (GST_VIDEO_INFO_PAR_N (info) != GST_VIDEO_INFO_PAR_N (other)) + return FALSE; + if (GST_VIDEO_INFO_PAR_D (info) != GST_VIDEO_INFO_PAR_D (other)) + return FALSE; + if (GST_VIDEO_INFO_FPS_N (info) != GST_VIDEO_INFO_FPS_N (other)) + return FALSE; + if (GST_VIDEO_INFO_FPS_D (info) != GST_VIDEO_INFO_FPS_D (other)) + return FALSE; + return TRUE; +} + /** * gst_video_info_to_caps: * @info: a #GstVideoInfo diff --git a/gst-libs/gst/video/video.h b/gst-libs/gst/video/video.h index 73e4b473ad..f88d1583c1 100644 --- a/gst-libs/gst/video/video.h +++ b/gst-libs/gst/video/video.h @@ -895,7 +895,8 @@ gboolean gst_video_info_convert (GstVideoInfo *info, gint64 src_value, GstFormat dest_format, gint64 *dest_value); - +gboolean gst_video_info_is_equal (const GstVideoInfo *info, + const GstVideoInfo *other); /* functions */ const GValue * gst_video_frame_rate (GstPad * pad);