Trait gstreamer::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: Fn(&Self, &str) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId;
fn connect_provider_unhidden<F: Fn(&Self, &str) + Send + Sync + 'static>(
        &self,
        f: F
    ) -> SignalHandlerId; }

Trait containing all DeviceProvider methods.

Implementors

DeviceProvider

Required Methods

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

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

Gets the Bus of this DeviceProvider

Returns

a Bus

Important traits for Vec<u8>

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

Retrieves the factory that was used to create this device provider.

Returns

the DeviceProviderFactory used for creating this device provider. no refcounting is needed.

Important traits for Vec<u8>

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.

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

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

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.

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