Trait gstreamer_video::prelude::DeviceProviderExt [−][src]
pub trait DeviceProviderExt {
fn can_monitor(&self) -> bool;
fn device_add(&self, device: &Device);
fn device_remove(&self, device: &Device);
fn get_bus(&self) -> Bus;
fn get_devices(&self) -> Vec<Device>;
fn get_factory(&self) -> Option<DeviceProviderFactory>;
fn get_hidden_providers(&self) -> Vec<String>;
fn hide_provider(&self, name: &str);
fn start(&self) -> Result<(), BoolError>;
fn stop(&self);
fn unhide_provider(&self, name: &str);
fn connect_provider_hidden<F>(&self, f: F) -> SignalHandlerId
where
F: 'static + Send + Sync + Fn(&Self, &str);
fn connect_provider_unhidden<F>(&self, f: F) -> SignalHandlerId
where
F: 'static + Send + Sync + Fn(&Self, &str);
}Required Methods
fn can_monitor(&self) -> bool
fn device_add(&self, device: &Device)
Posts a message on the provider's Bus to inform applications that
a new device has been added.
This is for use by subclasses.
device's reference count will be incremented, and any floating reference
will be removed (see Object::ref_sink).
device
a Device that has been added
fn device_remove(&self, device: &Device)
Posts a message on the provider's Bus to inform applications that
a device has been removed.
This is for use by subclasses.
device
a Device that has been removed
fn get_bus(&self) -> Bus
fn get_devices(&self) -> Vec<Device>
Gets a list of devices that this provider understands. This may actually probe the hardware if the provider is not currently started.
Returns
a glib::List of
Device
fn get_factory(&self) -> Option<DeviceProviderFactory>
Retrieves the factory that was used to create this device provider.
Returns
the DeviceProviderFactory used for
creating this device provider. no refcounting is needed.
Get the provider factory names of the DeviceProvider instances that
are hidden by self.
Returns
a list of hidden providers factory names or None when
nothing is hidden by self. Free with g_strfreev.
fn hide_provider(&self, name: &str)
Make self hide the devices from the factory with name.
This function is used when self will also provide the devices reported
by provider factory name. A monitor should stop monitoring the
device provider with name to avoid duplicate devices.
name
a provider factory name
fn start(&self) -> Result<(), BoolError>
Starts providering the devices. This will cause MessageType::DeviceAdded
and MessageType::DeviceRemoved messages to be posted on the provider's bus
when devices are added or removed from the system.
Since the DeviceProvider is a singleton,
DeviceProviderExt::start may already have been called by another
user of the object, DeviceProviderExt::stop needs to be called the same
number of times.
Returns
true if the device providering could be started
fn stop(&self)
Decreases the use-count by one. If the use count reaches zero, this
DeviceProvider will stop providering the devices. This needs to be
called the same number of times that DeviceProviderExt::start was called.
fn unhide_provider(&self, name: &str)
Make self unhide the devices from factory name.
This function is used when self will no longer provide the devices
reported by provider factory name. A monitor should start
monitoring the devices from provider factory name in order to see
all devices again.
name
a provider factory name
Implementors
impl<O> DeviceProviderExt for O where
O: IsA<DeviceProvider> + IsA<Object>,