From d1ad651548440fbd6c33e37f4ef89e687ed137a9 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 21 May 2025 07:50:40 +0200 Subject: [PATCH] gstreamer: value: add binding for gst_value_hash() Part-of: --- gstreamer/src/value.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/gstreamer/src/value.rs b/gstreamer/src/value.rs index bb0f7cb70..7703eb41f 100644 --- a/gstreamer/src/value.rs +++ b/gstreamer/src/value.rs @@ -1305,6 +1305,10 @@ pub trait GstValueExt: Sized { s: &str, pspec: &glib::ParamSpec, ) -> Result; + #[cfg(feature = "v1_28")] + #[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))] + #[doc(alias = "gst_value_hash")] + fn hash(&self) -> Result; } impl GstValueExt for glib::Value { @@ -1483,6 +1487,20 @@ impl GstValueExt for glib::Value { } } } + + #[cfg(feature = "v1_28")] + fn hash(&self) -> Result { + { + unsafe { + let mut hash = 0; + glib::result_from_gboolean!( + gstreamer_sys::gst_value_hash(self.to_glib_none().0, &mut hash), + "Failed to hash {self:?}" + )?; + Ok(hash) + } + } + } } #[doc(hidden)]