| 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) |
| 2 | // from gir-files (https://github.com/gtk-rs/gir-files) |
| 3 | // from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git) |
| 4 | // DO NOT EDIT |
| 5 | |
| 6 | use crate::{ffi, Object, PluginFeature, URIType}; |
| 7 | use glib::translate::*; |
| 8 | |
| 9 | glib::wrapper! { |
| 10 | #[doc (alias = "GstElementFactory" )] |
| 11 | pub struct ElementFactory(Object<ffi::GstElementFactory, ffi::GstElementFactoryClass>) @extends PluginFeature, Object; |
| 12 | |
| 13 | match fn { |
| 14 | type_ => || ffi::gst_element_factory_get_type(), |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | impl ElementFactory { |
| 19 | #[doc (alias = "gst_element_factory_get_element_type" )] |
| 20 | #[doc (alias = "get_element_type" )] |
| 21 | pub fn element_type(&self) -> glib::types::Type { |
| 22 | unsafe { |
| 23 | from_glib(ffi::gst_element_factory_get_element_type( |
| 24 | self.to_glib_none().0, |
| 25 | )) |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | #[doc (alias = "gst_element_factory_get_metadata_keys" )] |
| 30 | #[doc (alias = "get_metadata_keys" )] |
| 31 | pub fn metadata_keys(&self) -> Vec<glib::GString> { |
| 32 | unsafe { |
| 33 | FromGlibPtrContainer::from_glib_full(ffi::gst_element_factory_get_metadata_keys( |
| 34 | self.to_glib_none().0, |
| 35 | )) |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | #[doc (alias = "gst_element_factory_get_num_pad_templates" )] |
| 40 | #[doc (alias = "get_num_pad_templates" )] |
| 41 | pub fn num_pad_templates(&self) -> u32 { |
| 42 | unsafe { ffi::gst_element_factory_get_num_pad_templates(self.to_glib_none().0) } |
| 43 | } |
| 44 | |
| 45 | #[cfg (feature = "v1_20" )] |
| 46 | #[cfg_attr (docsrs, doc(cfg(feature = "v1_20" )))] |
| 47 | #[doc (alias = "gst_element_factory_get_skip_documentation" )] |
| 48 | #[doc (alias = "get_skip_documentation" )] |
| 49 | pub fn skips_documentation(&self) -> bool { |
| 50 | unsafe { |
| 51 | from_glib(ffi::gst_element_factory_get_skip_documentation( |
| 52 | self.to_glib_none().0, |
| 53 | )) |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | #[doc (alias = "gst_element_factory_get_uri_protocols" )] |
| 58 | #[doc (alias = "get_uri_protocols" )] |
| 59 | pub fn uri_protocols(&self) -> Vec<glib::GString> { |
| 60 | unsafe { |
| 61 | FromGlibPtrContainer::from_glib_none(ffi::gst_element_factory_get_uri_protocols( |
| 62 | self.to_glib_none().0, |
| 63 | )) |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | #[doc (alias = "gst_element_factory_get_uri_type" )] |
| 68 | #[doc (alias = "get_uri_type" )] |
| 69 | pub fn uri_type(&self) -> URIType { |
| 70 | unsafe { from_glib(ffi::gst_element_factory_get_uri_type(self.to_glib_none().0)) } |
| 71 | } |
| 72 | |
| 73 | #[doc (alias = "gst_element_factory_has_interface" )] |
| 74 | pub fn has_interface(&self, interfacename: &str) -> bool { |
| 75 | unsafe { |
| 76 | from_glib(ffi::gst_element_factory_has_interface( |
| 77 | self.to_glib_none().0, |
| 78 | interfacename.to_glib_none().0, |
| 79 | )) |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | #[doc (alias = "gst_element_factory_find" )] |
| 84 | pub fn find(name: &str) -> Option<ElementFactory> { |
| 85 | assert_initialized_main_thread!(); |
| 86 | unsafe { from_glib_full(ffi::gst_element_factory_find(name.to_glib_none().0)) } |
| 87 | } |
| 88 | } |
| 89 | |
| 90 | unsafe impl Send for ElementFactory {} |
| 91 | unsafe impl Sync for ElementFactory {} |
| 92 | |