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 728d423..4c32747 100644 --- a/gst-libs/gst/video/video-hdr.c +++ b/gst-libs/gst/video/video-hdr.c @@ -381,6 +381,29 @@ gst_video_content_light_level_to_string (const GstVideoContentLightLevel * } /** + * 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 * @caps: a #GstCaps diff --git a/gst-libs/gst/video/video-hdr.h b/gst-libs/gst/video/video-hdr.h index 6b3a915..2b5850b 100644 --- a/gst-libs/gst/video/video-hdr.h +++ b/gst-libs/gst/video/video-hdr.h @@ -256,6 +256,10 @@ 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); -- 2.7.4