mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 17:41:05 +00:00
meta: Add support for 1.24 Meta
clear function
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1390>
This commit is contained in:
parent
12c9ada9e0
commit
f82b9cc197
1 changed files with 18 additions and 0 deletions
|
@ -522,6 +522,24 @@ impl<'a, T, U> MetaRefMut<'a, T, U> {
|
||||||
) -> Result<usize, glib::BoolError> {
|
) -> Result<usize, glib::BoolError> {
|
||||||
self.as_meta_ref().serialize(writer)
|
self.as_meta_ref().serialize(writer)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(feature = "v1_24")]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(feature = "v1_24")))]
|
||||||
|
pub fn clear(&mut self) -> Result<(), glib::BoolError>
|
||||||
|
where
|
||||||
|
T: MetaAPI,
|
||||||
|
{
|
||||||
|
unsafe {
|
||||||
|
let info = *(*self.upcast_ref().as_ptr()).info;
|
||||||
|
|
||||||
|
if let Some(clear_func) = info.clear_func {
|
||||||
|
clear_func(self.buffer.as_mut_ptr(), self.upcast_mut().as_mut_ptr());
|
||||||
|
Ok(())
|
||||||
|
} else {
|
||||||
|
Err(glib::bool_error!("Failed to clear meta"))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, T> MetaRefMut<'a, T, Standalone> {
|
impl<'a, T> MetaRefMut<'a, T, Standalone> {
|
||||||
|
|
Loading…
Reference in a new issue