mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2025-09-02 01:43:49 +00:00
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:
parent
07971930b6
commit
d1ad651548
1 changed files with 18 additions and 0 deletions
|
@ -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)]
|
||||||
|
|
Loading…
Reference in a new issue