From 538ce91987c4a9b58eff67aa59707516ec80eb11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 19 Sep 2021 14:55:29 +0300 Subject: [PATCH] gstreamer: Provide getter for meta type in addition to meta API type --- gstreamer/src/meta.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/gstreamer/src/meta.rs b/gstreamer/src/meta.rs index aea45e611..42e8e9744 100644 --- a/gstreamer/src/meta.rs +++ b/gstreamer/src/meta.rs @@ -145,6 +145,14 @@ impl<'a, T> MetaRef<'a, T> { } } + pub fn type_(&self) -> glib::Type { + unsafe { + let meta = self.meta as *const _ as *const ffi::GstMeta; + let info = (*meta).info; + glib::Type::from_glib((*info).type_) + } + } + #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[doc(alias = "get_seqnum")] @@ -199,6 +207,14 @@ impl<'a, T, U> MetaRefMut<'a, T, U> { } } + pub fn type_(&self) -> glib::Type { + unsafe { + let meta = self.meta as *const _ as *const ffi::GstMeta; + let info = (*meta).info; + glib::Type::from_glib((*info).type_) + } + } + #[cfg(any(feature = "v1_16", feature = "dox"))] #[cfg_attr(feature = "dox", doc(cfg(feature = "v1_16")))] #[doc(alias = "get_seqnum")]