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)]