gstreamer-rs/gstreamer/src/auto/element_factory.rs

143 lines
4.6 KiB
Rust
Raw Normal View History

2018-04-23 17:34:22 +00:00
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT
2017-07-10 21:02:08 +00:00
use Caps;
use Element;
use ElementFactoryListType;
use Object;
2017-07-10 21:02:08 +00:00
use PadDirection;
use PluginFeature;
2017-08-14 19:18:34 +00:00
use Rank;
use StaticPadTemplate;
use URIType;
use glib;
use glib::GString;
use glib::translate::*;
2019-03-19 07:40:05 +00:00
use gst_sys;
glib_wrapper! {
2019-03-19 07:40:05 +00:00
pub struct ElementFactory(Object<gst_sys::GstElementFactory, gst_sys::GstElementFactoryClass, ElementFactoryClass>) @extends PluginFeature, Object;
match fn {
2019-03-19 07:40:05 +00:00
get_type => || gst_sys::gst_element_factory_get_type(),
}
}
impl ElementFactory {
2017-07-10 21:02:08 +00:00
pub fn can_sink_all_caps(&self, caps: &Caps) -> bool {
unsafe {
2019-03-19 07:40:05 +00:00
from_glib(gst_sys::gst_element_factory_can_sink_all_caps(self.to_glib_none().0, caps.to_glib_none().0))
2017-07-10 21:02:08 +00:00
}
}
2017-07-10 21:02:08 +00:00
pub fn can_sink_any_caps(&self, caps: &Caps) -> bool {
unsafe {
2019-03-19 07:40:05 +00:00
from_glib(gst_sys::gst_element_factory_can_sink_any_caps(self.to_glib_none().0, caps.to_glib_none().0))
2017-07-10 21:02:08 +00:00
}
}
2017-07-10 21:02:08 +00:00
pub fn can_src_all_caps(&self, caps: &Caps) -> bool {
unsafe {
2019-03-19 07:40:05 +00:00
from_glib(gst_sys::gst_element_factory_can_src_all_caps(self.to_glib_none().0, caps.to_glib_none().0))
2017-07-10 21:02:08 +00:00
}
}
2017-07-10 21:02:08 +00:00
pub fn can_src_any_caps(&self, caps: &Caps) -> bool {
unsafe {
2019-03-19 07:40:05 +00:00
from_glib(gst_sys::gst_element_factory_can_src_any_caps(self.to_glib_none().0, caps.to_glib_none().0))
2017-07-10 21:02:08 +00:00
}
}
2019-03-19 07:40:05 +00:00
pub fn create(&self, name: Option<&str>) -> Option<Element> {
unsafe {
2019-03-19 07:40:05 +00:00
from_glib_none(gst_sys::gst_element_factory_create(self.to_glib_none().0, name.to_glib_none().0))
}
}
pub fn get_element_type(&self) -> glib::types::Type {
unsafe {
2019-03-19 07:40:05 +00:00
from_glib(gst_sys::gst_element_factory_get_element_type(self.to_glib_none().0))
}
}
pub fn get_metadata(&self, key: &str) -> Option<GString> {
unsafe {
2019-03-19 07:40:05 +00:00
from_glib_none(gst_sys::gst_element_factory_get_metadata(self.to_glib_none().0, key.to_glib_none().0))
}
}
pub fn get_metadata_keys(&self) -> Vec<GString> {
unsafe {
2019-03-19 07:40:05 +00:00
FromGlibPtrContainer::from_glib_full(gst_sys::gst_element_factory_get_metadata_keys(self.to_glib_none().0))
}
}
pub fn get_num_pad_templates(&self) -> u32 {
unsafe {
2019-03-19 07:40:05 +00:00
gst_sys::gst_element_factory_get_num_pad_templates(self.to_glib_none().0)
}
}
pub fn get_static_pad_templates(&self) -> Vec<StaticPadTemplate> {
unsafe {
2019-03-19 07:40:05 +00:00
FromGlibPtrContainer::from_glib_none(gst_sys::gst_element_factory_get_static_pad_templates(self.to_glib_none().0))
}
}
pub fn get_uri_protocols(&self) -> Vec<GString> {
unsafe {
2019-03-19 07:40:05 +00:00
FromGlibPtrContainer::from_glib_none(gst_sys::gst_element_factory_get_uri_protocols(self.to_glib_none().0))
}
}
pub fn get_uri_type(&self) -> URIType {
unsafe {
2019-03-19 07:40:05 +00:00
from_glib(gst_sys::gst_element_factory_get_uri_type(self.to_glib_none().0))
}
}
pub fn has_interface(&self, interfacename: &str) -> bool {
unsafe {
2019-03-19 07:40:05 +00:00
from_glib(gst_sys::gst_element_factory_has_interface(self.to_glib_none().0, interfacename.to_glib_none().0))
}
}
pub fn list_is_type(&self, type_: ElementFactoryListType) -> bool {
unsafe {
2019-03-19 07:40:05 +00:00
from_glib(gst_sys::gst_element_factory_list_is_type(self.to_glib_none().0, type_))
}
}
pub fn find(name: &str) -> Option<ElementFactory> {
assert_initialized_main_thread!();
unsafe {
2019-03-19 07:40:05 +00:00
from_glib_full(gst_sys::gst_element_factory_find(name.to_glib_none().0))
}
}
2017-07-10 21:02:08 +00:00
pub fn list_filter(list: &[ElementFactory], caps: &Caps, direction: PadDirection, subsetonly: bool) -> Vec<ElementFactory> {
assert_initialized_main_thread!();
unsafe {
2019-03-19 07:40:05 +00:00
FromGlibPtrContainer::from_glib_full(gst_sys::gst_element_factory_list_filter(list.to_glib_none().0, caps.to_glib_none().0, direction.to_glib(), subsetonly.to_glib()))
2017-07-10 21:02:08 +00:00
}
}
2017-08-14 19:18:34 +00:00
pub fn list_get_elements(type_: ElementFactoryListType, minrank: Rank) -> Vec<ElementFactory> {
assert_initialized_main_thread!();
unsafe {
2019-03-19 07:40:05 +00:00
FromGlibPtrContainer::from_glib_full(gst_sys::gst_element_factory_list_get_elements(type_, minrank.to_glib()))
2017-08-14 19:18:34 +00:00
}
}
2019-03-19 07:40:05 +00:00
pub fn make(factoryname: &str, name: Option<&str>) -> Option<Element> {
assert_initialized_main_thread!();
unsafe {
2019-03-19 07:40:05 +00:00
from_glib_none(gst_sys::gst_element_factory_make(factoryname.to_glib_none().0, name.to_glib_none().0))
}
}
}
unsafe impl Send for ElementFactory {}
unsafe impl Sync for ElementFactory {}