// This file was generated by gir (5c71144) from gir-files (???) // DO NOT EDIT use Bus; use Device; use DeviceProviderFactory; use Object; use Plugin; use ffi; use glib; use glib::object::Downcast; use glib::object::IsA; use glib::signal::connect; use glib::translate::*; use glib_ffi; use gobject_ffi; use libc; use std::boxed::Box as Box_; use std::mem; use std::mem::transmute; use std::ptr; glib_wrapper! { pub struct DeviceProvider(Object): Object; match fn { get_type => || ffi::gst_device_provider_get_type(), } } impl DeviceProvider { pub fn register<'a, P: Into>>(plugin: P, name: &str, rank: u32, type_: glib::types::Type) -> bool { assert_initialized_main_thread!(); let plugin = plugin.into(); let plugin = plugin.to_glib_none(); unsafe { from_glib(ffi::gst_device_provider_register(plugin.0, name.to_glib_none().0, rank, type_.to_glib())) } } } unsafe impl Send for DeviceProvider {} unsafe impl Sync for DeviceProvider {} pub trait DeviceProviderExt { fn can_monitor(&self) -> bool; fn device_add(&self, device: &Device); fn device_remove(&self, device: &Device); fn get_bus(&self) -> Option; fn get_devices(&self) -> Vec; fn get_factory(&self) -> Option; fn get_hidden_providers(&self) -> Vec; fn hide_provider(&self, name: &str); fn start(&self) -> bool; fn stop(&self); fn unhide_provider(&self, name: &str); fn connect_provider_hidden(&self, f: F) -> u64; fn connect_provider_unhidden(&self, f: F) -> u64; } impl + IsA> DeviceProviderExt for O { fn can_monitor(&self) -> bool { unsafe { from_glib(ffi::gst_device_provider_can_monitor(self.to_glib_none().0)) } } fn device_add(&self, device: &Device) { unsafe { ffi::gst_device_provider_device_add(self.to_glib_none().0, device.to_glib_none().0); } } fn device_remove(&self, device: &Device) { unsafe { ffi::gst_device_provider_device_remove(self.to_glib_none().0, device.to_glib_none().0); } } fn get_bus(&self) -> Option { unsafe { from_glib_full(ffi::gst_device_provider_get_bus(self.to_glib_none().0)) } } fn get_devices(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::gst_device_provider_get_devices(self.to_glib_none().0)) } } fn get_factory(&self) -> Option { unsafe { from_glib_none(ffi::gst_device_provider_get_factory(self.to_glib_none().0)) } } fn get_hidden_providers(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_full(ffi::gst_device_provider_get_hidden_providers(self.to_glib_none().0)) } } fn hide_provider(&self, name: &str) { unsafe { ffi::gst_device_provider_hide_provider(self.to_glib_none().0, name.to_glib_none().0); } } fn start(&self) -> bool { unsafe { from_glib(ffi::gst_device_provider_start(self.to_glib_none().0)) } } fn stop(&self) { unsafe { ffi::gst_device_provider_stop(self.to_glib_none().0); } } fn unhide_provider(&self, name: &str) { unsafe { ffi::gst_device_provider_unhide_provider(self.to_glib_none().0, name.to_glib_none().0); } } fn connect_provider_hidden(&self, f: F) -> u64 { unsafe { let f: Box_> = Box_::new(Box_::new(f)); connect(self.to_glib_none().0, "provider-hidden", transmute(provider_hidden_trampoline:: as usize), Box_::into_raw(f) as *mut _) } } fn connect_provider_unhidden(&self, f: F) -> u64 { unsafe { let f: Box_> = Box_::new(Box_::new(f)); connect(self.to_glib_none().0, "provider-unhidden", transmute(provider_unhidden_trampoline:: as usize), Box_::into_raw(f) as *mut _) } } } unsafe extern "C" fn provider_hidden_trampoline

(this: *mut ffi::GstDeviceProvider, object: *mut libc::c_char, f: glib_ffi::gpointer) where P: IsA { callback_guard!(); let f: &Box_ = transmute(f); f(&DeviceProvider::from_glib_none(this).downcast_unchecked(), &String::from_glib_none(object)) } unsafe extern "C" fn provider_unhidden_trampoline

(this: *mut ffi::GstDeviceProvider, object: *mut libc::c_char, f: glib_ffi::gpointer) where P: IsA { callback_guard!(); let f: &Box_ = transmute(f); f(&DeviceProvider::from_glib_none(this).downcast_unchecked(), &String::from_glib_none(object)) }