gstreamer: value: add binding for gst_value_hash()

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1639>
This commit is contained in:
Guillaume Desmottes 2025-05-21 07:50:40 +02:00
parent 07971930b6
commit d1ad651548

View file

@ -1305,6 +1305,10 @@ pub trait GstValueExt: Sized {
s: &str, s: &str,
pspec: &glib::ParamSpec, pspec: &glib::ParamSpec,
) -> Result<glib::Value, glib::BoolError>; ) -> Result<glib::Value, glib::BoolError>;
#[cfg(feature = "v1_28")]
#[cfg_attr(docsrs, doc(cfg(feature = "v1_28")))]
#[doc(alias = "gst_value_hash")]
fn hash(&self) -> Result<u32, glib::BoolError>;
} }
impl GstValueExt for glib::Value { impl GstValueExt for glib::Value {
@ -1483,6 +1487,20 @@ impl GstValueExt for glib::Value {
} }
} }
} }
#[cfg(feature = "v1_28")]
fn hash(&self) -> Result<u32, glib::BoolError> {
{
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)] #[doc(hidden)]