gstreamer: Add bindings for Plugin::get_plugin_name()

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/248
This commit is contained in:
Sebastian Dröge 2020-04-11 19:33:34 +03:00
parent 4866739342
commit d05f8cace8

View file

@ -36,6 +36,8 @@ impl Plugin {
pub trait GstPluginExtManual: 'static { pub trait GstPluginExtManual: 'static {
fn get_plugin_flags(&self) -> PluginFlags; fn get_plugin_flags(&self) -> PluginFlags;
fn get_plugin_name(&self) -> glib::GString;
} }
impl<O: IsA<::Plugin>> GstPluginExtManual for O { impl<O: IsA<::Plugin>> GstPluginExtManual for O {
@ -46,4 +48,8 @@ impl<O: IsA<::Plugin>> GstPluginExtManual for O {
from_glib((*ptr).flags) from_glib((*ptr).flags)
} }
} }
fn get_plugin_name(&self) -> glib::GString {
unsafe { from_glib_none(gst_sys::gst_plugin_get_name(self.as_ref().to_glib_none().0)) }
}
} }