mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-29 13:01:05 +00:00
meta: Add is_registered function for CustomMeta
Test if a Meta type is already registered. It is useful to know if a custom metadata type has already been registed to avoid registererd twice and get asserts. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1402>
This commit is contained in:
parent
02c6b9128c
commit
d07f72f34e
1 changed files with 5 additions and 0 deletions
|
@ -951,6 +951,11 @@ impl CustomMeta {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn is_registered(name: &str) -> bool {
|
||||||
|
assert_initialized_main_thread!();
|
||||||
|
unsafe { name.run_with_gstr(|name| !ffi::gst_meta_get_info(name.as_ptr()).is_null()) }
|
||||||
|
}
|
||||||
|
|
||||||
#[doc(alias = "gst_buffer_add_custom_meta")]
|
#[doc(alias = "gst_buffer_add_custom_meta")]
|
||||||
pub fn add<'a>(
|
pub fn add<'a>(
|
||||||
buffer: &'a mut BufferRef,
|
buffer: &'a mut BufferRef,
|
||||||
|
|
Loading…
Reference in a new issue