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)
|
2021-04-01 13:58:41 +00:00
|
|
|
// from gst-gir-files (https://gitlab.freedesktop.org/gstreamer/gir-files-rs.git)
|
2017-05-12 12:24:03 +00:00
|
|
|
// DO NOT EDIT
|
|
|
|
|
2020-11-21 13:46:33 +00:00
|
|
|
use crate::Caps;
|
|
|
|
use crate::Element;
|
|
|
|
use crate::ElementFactoryListType;
|
|
|
|
use crate::Object;
|
|
|
|
use crate::PadDirection;
|
|
|
|
use crate::PluginFeature;
|
|
|
|
use crate::Rank;
|
|
|
|
use crate::StaticPadTemplate;
|
|
|
|
use crate::URIType;
|
2019-06-18 10:12:00 +00:00
|
|
|
use glib::translate::*;
|
2020-11-21 13:46:33 +00:00
|
|
|
|
2020-12-17 22:34:53 +00:00
|
|
|
glib::wrapper! {
|
2021-06-02 07:47:51 +00:00
|
|
|
#[doc(alias = "GstElementFactory")]
|
2020-11-21 13:46:33 +00:00
|
|
|
pub struct ElementFactory(Object<ffi::GstElementFactory, ffi::GstElementFactoryClass>) @extends PluginFeature, Object;
|
2017-05-12 12:24:03 +00:00
|
|
|
|
|
|
|
match fn {
|
2021-04-19 19:55:01 +00:00
|
|
|
type_ => || ffi::gst_element_factory_get_type(),
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl ElementFactory {
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_can_sink_all_caps")]
|
2017-07-10 21:02:08 +00:00
|
|
|
pub fn can_sink_all_caps(&self, caps: &Caps) -> bool {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_element_factory_can_sink_all_caps(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.to_glib_none().0,
|
|
|
|
caps.to_glib_none().0,
|
|
|
|
))
|
2017-07-10 21:02:08 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_can_sink_any_caps")]
|
2017-07-10 21:02:08 +00:00
|
|
|
pub fn can_sink_any_caps(&self, caps: &Caps) -> bool {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_element_factory_can_sink_any_caps(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.to_glib_none().0,
|
|
|
|
caps.to_glib_none().0,
|
|
|
|
))
|
2017-07-10 21:02:08 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_can_src_all_caps")]
|
2017-07-10 21:02:08 +00:00
|
|
|
pub fn can_src_all_caps(&self, caps: &Caps) -> bool {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_element_factory_can_src_all_caps(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.to_glib_none().0,
|
|
|
|
caps.to_glib_none().0,
|
|
|
|
))
|
2017-07-10 21:02:08 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_can_src_any_caps")]
|
2017-07-10 21:02:08 +00:00
|
|
|
pub fn can_src_any_caps(&self, caps: &Caps) -> bool {
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_element_factory_can_src_any_caps(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.to_glib_none().0,
|
|
|
|
caps.to_glib_none().0,
|
|
|
|
))
|
2017-07-10 21:02:08 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_create")]
|
2019-12-17 19:00:42 +00:00
|
|
|
pub fn create(&self, name: Option<&str>) -> Result<Element, glib::BoolError> {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
Option::<_>::from_glib_none(ffi::gst_element_factory_create(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.to_glib_none().0,
|
|
|
|
name.to_glib_none().0,
|
|
|
|
))
|
2020-12-17 22:34:53 +00:00
|
|
|
.ok_or_else(|| glib::bool_error!("Failed to create element from factory"))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_get_element_type")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_element_type")]
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn element_type(&self) -> glib::types::Type {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_element_factory_get_element_type(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_get_metadata")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_metadata")]
|
2021-04-19 20:13:58 +00:00
|
|
|
pub fn metadata(&self, key: &str) -> Option<glib::GString> {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib_none(ffi::gst_element_factory_get_metadata(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.to_glib_none().0,
|
|
|
|
key.to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_get_metadata_keys")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_metadata_keys")]
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn metadata_keys(&self) -> Vec<glib::GString> {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(ffi::gst_element_factory_get_metadata_keys(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_get_num_pad_templates")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_num_pad_templates")]
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn num_pad_templates(&self) -> u32 {
|
2020-11-21 13:46:33 +00:00
|
|
|
unsafe { ffi::gst_element_factory_get_num_pad_templates(self.to_glib_none().0) }
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_get_static_pad_templates")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_static_pad_templates")]
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn static_pad_templates(&self) -> Vec<StaticPadTemplate> {
|
2017-10-15 08:08:56 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
FromGlibPtrContainer::from_glib_none(ffi::gst_element_factory_get_static_pad_templates(
|
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2017-10-15 08:08:56 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_get_uri_protocols")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_uri_protocols")]
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn uri_protocols(&self) -> Vec<glib::GString> {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
FromGlibPtrContainer::from_glib_none(ffi::gst_element_factory_get_uri_protocols(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_get_uri_type")]
|
2021-05-03 18:35:37 +00:00
|
|
|
#[doc(alias = "get_uri_type")]
|
2021-04-11 19:38:18 +00:00
|
|
|
pub fn uri_type(&self) -> URIType {
|
2020-11-21 13:46:33 +00:00
|
|
|
unsafe { from_glib(ffi::gst_element_factory_get_uri_type(self.to_glib_none().0)) }
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_has_interface")]
|
2017-07-03 11:06:08 +00:00
|
|
|
pub fn has_interface(&self, interfacename: &str) -> bool {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_element_factory_has_interface(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.to_glib_none().0,
|
|
|
|
interfacename.to_glib_none().0,
|
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_list_is_type")]
|
2017-07-03 11:06:08 +00:00
|
|
|
pub fn list_is_type(&self, type_: ElementFactoryListType) -> bool {
|
2017-05-12 12:24:03 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
from_glib(ffi::gst_element_factory_list_is_type(
|
2019-06-18 10:12:00 +00:00
|
|
|
self.to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
type_.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
))
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
|
|
|
}
|
2017-07-03 11:06:08 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_find")]
|
2017-07-03 11:06:08 +00:00
|
|
|
pub fn find(name: &str) -> Option<ElementFactory> {
|
2017-07-10 09:36:15 +00:00
|
|
|
assert_initialized_main_thread!();
|
2020-11-21 13:46:33 +00:00
|
|
|
unsafe { from_glib_full(ffi::gst_element_factory_find(name.to_glib_none().0)) }
|
2017-07-03 11:06:08 +00:00
|
|
|
}
|
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_list_filter")]
|
2019-06-18 10:12:00 +00:00
|
|
|
pub fn list_filter(
|
|
|
|
list: &[ElementFactory],
|
|
|
|
caps: &Caps,
|
|
|
|
direction: PadDirection,
|
|
|
|
subsetonly: bool,
|
|
|
|
) -> Vec<ElementFactory> {
|
2017-07-10 21:02:08 +00:00
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(ffi::gst_element_factory_list_filter(
|
2019-06-18 10:12:00 +00:00
|
|
|
list.to_glib_none().0,
|
|
|
|
caps.to_glib_none().0,
|
2021-04-27 15:10:39 +00:00
|
|
|
direction.into_glib(),
|
|
|
|
subsetonly.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
))
|
2017-07-10 21:02:08 +00:00
|
|
|
}
|
|
|
|
}
|
2017-07-03 11:06:08 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_list_get_elements")]
|
2017-08-14 19:18:34 +00:00
|
|
|
pub fn list_get_elements(type_: ElementFactoryListType, minrank: Rank) -> Vec<ElementFactory> {
|
|
|
|
assert_initialized_main_thread!();
|
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
FromGlibPtrContainer::from_glib_full(ffi::gst_element_factory_list_get_elements(
|
2021-04-27 15:10:39 +00:00
|
|
|
type_.into_glib(),
|
|
|
|
minrank.into_glib(),
|
2019-06-18 10:12:00 +00:00
|
|
|
))
|
2017-08-14 19:18:34 +00:00
|
|
|
}
|
|
|
|
}
|
2017-07-03 11:06:08 +00:00
|
|
|
|
2020-12-08 13:00:17 +00:00
|
|
|
#[doc(alias = "gst_element_factory_make")]
|
2019-12-17 19:00:42 +00:00
|
|
|
pub fn make(factoryname: &str, name: Option<&str>) -> Result<Element, glib::BoolError> {
|
2017-07-10 09:36:15 +00:00
|
|
|
assert_initialized_main_thread!();
|
2017-07-03 11:06:08 +00:00
|
|
|
unsafe {
|
2020-11-21 13:46:33 +00:00
|
|
|
Option::<_>::from_glib_none(ffi::gst_element_factory_make(
|
2019-06-18 10:12:00 +00:00
|
|
|
factoryname.to_glib_none().0,
|
|
|
|
name.to_glib_none().0,
|
|
|
|
))
|
2020-12-17 22:34:53 +00:00
|
|
|
.ok_or_else(|| glib::bool_error!("Failed to create element from factory name"))
|
2017-07-03 11:06:08 +00:00
|
|
|
}
|
|
|
|
}
|
2017-05-12 12:24:03 +00:00
|
|
|
}
|
2017-07-03 11:06:08 +00:00
|
|
|
|
|
|
|
unsafe impl Send for ElementFactory {}
|
|
|
|
unsafe impl Sync for ElementFactory {}
|