From 11e6f8da925f3c2f7b157221cecf6326edd5f2be Mon Sep 17 00:00:00 2001 From: Jakub Adam Date: Mon, 27 Apr 2020 20:52:34 +0200 Subject: [PATCH] video-hdr: Add API to check content light level equality Part-of: --- gst-libs/gst/video/video-hdr.c | 23 +++++++++++++++++++++++ gst-libs/gst/video/video-hdr.h | 4 ++++ 2 files changed, 27 insertions(+) diff --git a/gst-libs/gst/video/video-hdr.c b/gst-libs/gst/video/video-hdr.c index 728d423bf5..4c32747201 100644 --- a/gst-libs/gst/video/video-hdr.c +++ b/gst-libs/gst/video/video-hdr.c @@ -380,6 +380,29 @@ gst_video_content_light_level_to_string (const GstVideoContentLightLevel * linfo->max_content_light_level, linfo->max_frame_average_light_level); } +/** + * gst_video_content_light_level_is_equal: + * @linfo: a #GstVideoContentLightLevel + * @other: a #GstVideoContentLightLevel + * + * Checks equality between @linfo and @other. + * + * Returns: %TRUE if @linfo and @other are equal. + * + * Since: 1.20 + */ +gboolean +gst_video_content_light_level_is_equal (const GstVideoContentLightLevel * linfo, + const GstVideoContentLightLevel * other) +{ + g_return_val_if_fail (linfo != NULL, FALSE); + g_return_val_if_fail (other != NULL, FALSE); + + return (linfo->max_content_light_level == other->max_content_light_level && + linfo->max_frame_average_light_level == + other->max_frame_average_light_level); +} + /** * gst_video_content_light_level_from_caps: * @linfo: a #GstVideoContentLightLevel diff --git a/gst-libs/gst/video/video-hdr.h b/gst-libs/gst/video/video-hdr.h index 6b3a915f5e..2b5850b565 100644 --- a/gst-libs/gst/video/video-hdr.h +++ b/gst-libs/gst/video/video-hdr.h @@ -255,6 +255,10 @@ gboolean gst_video_content_light_level_from_string (GstVideoContentLightLevel GST_VIDEO_API gchar * gst_video_content_light_level_to_string (const GstVideoContentLightLevel * linfo); +GST_VIDEO_API +gboolean gst_video_content_light_level_is_equal (const GstVideoContentLightLevel * linfo, + const GstVideoContentLightLevel * other); + GST_VIDEO_API gboolean gst_video_content_light_level_from_caps (GstVideoContentLightLevel * linfo, const GstCaps * caps);