video-hdr: Add API to check content light level equality
authorJakub Adam <jakub.adam@collabora.com>
Mon, 27 Apr 2020 18:52:34 +0000 (20:52 +0200)
committerJakub Adam <jakub.adam@collabora.com>
Thu, 28 Jan 2021 19:55:38 +0000 (20:55 +0100)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/969>

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

index 728d423..4c32747 100644 (file)
@@ -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
index 6b3a915..2b5850b 100644 (file)
@@ -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);