forked from mirrors/gstreamer-rs
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/1391>
This commit is contained in:
parent
7f9dd58718
commit
22796cee0c
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")]
|
||||
pub fn add<'a>(
|
||||
buffer: &'a mut BufferRef,
|
||||
|
|
Loading…
Reference in a new issue