element_factory.rs 3.96 KB
Newer Older
1
// This file was generated by gir (33e9567) from gir-files (???)
Sebastian Dröge's avatar
Sebastian Dröge committed
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
// DO NOT EDIT

use Element;
use ElementFactoryListType;
use Object;
use URIType;
use ffi;
use glib;
use glib::translate::*;

glib_wrapper! {
    pub struct ElementFactory(Object<ffi::GstElementFactory>): Object;

    match fn {
        get_type => || ffi::gst_element_factory_get_type(),
    }
}

impl ElementFactory {
21
    //pub fn can_sink_all_caps(&self, caps: /*Ignored*/&Caps) -> bool {
Sebastian Dröge's avatar
Sebastian Dröge committed
22 23 24
    //    unsafe { TODO: call ffi::gst_element_factory_can_sink_all_caps() }
    //}

25
    //pub fn can_sink_any_caps(&self, caps: /*Ignored*/&Caps) -> bool {
Sebastian Dröge's avatar
Sebastian Dröge committed
26 27 28
    //    unsafe { TODO: call ffi::gst_element_factory_can_sink_any_caps() }
    //}

29
    //pub fn can_src_all_caps(&self, caps: /*Ignored*/&Caps) -> bool {
Sebastian Dröge's avatar
Sebastian Dröge committed
30 31 32
    //    unsafe { TODO: call ffi::gst_element_factory_can_src_all_caps() }
    //}

33
    //pub fn can_src_any_caps(&self, caps: /*Ignored*/&Caps) -> bool {
Sebastian Dröge's avatar
Sebastian Dröge committed
34 35 36
    //    unsafe { TODO: call ffi::gst_element_factory_can_src_any_caps() }
    //}

37
    pub fn create<'a, P: Into<Option<&'a str>>>(&self, name: P) -> Option<Element> {
Sebastian Dröge's avatar
Sebastian Dröge committed
38 39 40 41 42 43 44
        let name = name.into();
        let name = name.to_glib_none();
        unsafe {
            from_glib_none(ffi::gst_element_factory_create(self.to_glib_none().0, name.0))
        }
    }

45
    pub fn get_element_type(&self) -> glib::types::Type {
Sebastian Dröge's avatar
Sebastian Dröge committed
46 47 48 49 50
        unsafe {
            from_glib(ffi::gst_element_factory_get_element_type(self.to_glib_none().0))
        }
    }

51
    pub fn get_metadata(&self, key: &str) -> Option<String> {
Sebastian Dröge's avatar
Sebastian Dröge committed
52 53 54 55 56
        unsafe {
            from_glib_none(ffi::gst_element_factory_get_metadata(self.to_glib_none().0, key.to_glib_none().0))
        }
    }

57
    pub fn get_metadata_keys(&self) -> Vec<String> {
Sebastian Dröge's avatar
Sebastian Dröge committed
58 59 60 61 62
        unsafe {
            FromGlibPtrContainer::from_glib_full(ffi::gst_element_factory_get_metadata_keys(self.to_glib_none().0))
        }
    }

63
    pub fn get_num_pad_templates(&self) -> u32 {
Sebastian Dröge's avatar
Sebastian Dröge committed
64 65 66 67 68
        unsafe {
            ffi::gst_element_factory_get_num_pad_templates(self.to_glib_none().0)
        }
    }

69
    //pub fn get_static_pad_templates(&self) -> /*Ignored*/Vec<StaticPadTemplate> {
Sebastian Dröge's avatar
Sebastian Dröge committed
70 71 72
    //    unsafe { TODO: call ffi::gst_element_factory_get_static_pad_templates() }
    //}

73
    pub fn get_uri_protocols(&self) -> Vec<String> {
Sebastian Dröge's avatar
Sebastian Dröge committed
74 75 76 77 78
        unsafe {
            FromGlibPtrContainer::from_glib_none(ffi::gst_element_factory_get_uri_protocols(self.to_glib_none().0))
        }
    }

79
    pub fn get_uri_type(&self) -> URIType {
Sebastian Dröge's avatar
Sebastian Dröge committed
80 81 82 83 84
        unsafe {
            from_glib(ffi::gst_element_factory_get_uri_type(self.to_glib_none().0))
        }
    }

85
    pub fn has_interface(&self, interfacename: &str) -> bool {
Sebastian Dröge's avatar
Sebastian Dröge committed
86 87 88 89 90
        unsafe {
            from_glib(ffi::gst_element_factory_has_interface(self.to_glib_none().0, interfacename.to_glib_none().0))
        }
    }

91
    pub fn list_is_type(&self, type_: ElementFactoryListType) -> bool {
Sebastian Dröge's avatar
Sebastian Dröge committed
92 93 94 95
        unsafe {
            from_glib(ffi::gst_element_factory_list_is_type(self.to_glib_none().0, type_))
        }
    }
96 97

    pub fn find(name: &str) -> Option<ElementFactory> {
98
        assert_initialized_main_thread!();
99 100 101 102 103 104 105 106 107 108 109 110 111 112
        unsafe {
            from_glib_full(ffi::gst_element_factory_find(name.to_glib_none().0))
        }
    }

    //pub fn list_filter(list: &[ElementFactory], caps: /*Ignored*/&Caps, direction: PadDirection, subsetonly: bool) -> Vec<ElementFactory> {
    //    unsafe { TODO: call ffi::gst_element_factory_list_filter() }
    //}

    //pub fn list_get_elements(type_: ElementFactoryListType, minrank: /*Ignored*/Rank) -> Vec<ElementFactory> {
    //    unsafe { TODO: call ffi::gst_element_factory_list_get_elements() }
    //}

    pub fn make<'a, P: Into<Option<&'a str>>>(factoryname: &str, name: P) -> Option<Element> {
113
        assert_initialized_main_thread!();
114 115 116 117 118 119
        let name = name.into();
        let name = name.to_glib_none();
        unsafe {
            from_glib_none(ffi::gst_element_factory_make(factoryname.to_glib_none().0, name.0))
        }
    }
Sebastian Dröge's avatar
Sebastian Dröge committed
120
}
121 122 123

unsafe impl Send for ElementFactory {}
unsafe impl Sync for ElementFactory {}