[][src]Trait gstreamer_base::prelude::DeviceProviderExt

pub trait DeviceProviderExt: 'static {
    fn can_monitor(&self) -> bool;
fn device_add<P>(&self, device: &P)
    where
        P: IsA<Device>
;
fn device_changed<P, Q>(&self, device: &P, changed_device: &Q)
    where
        P: IsA<Device>,
        Q: IsA<Device>
;
fn device_remove<P>(&self, device: &P)
    where
        P: IsA<Device>
;
fn get_bus(&self) -> Bus;
fn get_devices(&self) -> Vec<Device>;
fn get_factory(&self) -> Option<DeviceProviderFactory>;
fn get_hidden_providers(&self) -> Vec<GString>;
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)
; }

Trait containing all DeviceProvider methods.

Implementors

DeviceProvider

Required methods

fn can_monitor(&self) -> bool

fn device_add<P>(&self, device: &P) where
    P: IsA<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_changed<P, Q>(&self, device: &P, changed_device: &Q) where
    P: IsA<Device>,
    Q: IsA<Device>, 

This function is used when changed_device was modified into its new form device. This will post a DEVICE_CHANGED message on the bus to let the application know that the device was modified. Device is immutable for MT. safety purposes so this is an "atomic" way of letting the application know when a device was modified.

Feature: v1_16

device

the new version of changed_device

changed_device

the old version of the device that has been udpated

fn device_remove<P>(&self, device: &P) where
    P: IsA<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

Gets the Bus of this DeviceProvider

Returns

a 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.

fn get_hidden_providers(&self) -> Vec<GString>

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

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), 

Loading content...

Implementors

impl<O> DeviceProviderExt for O where
    O: IsA<DeviceProvider>, 
[src]

Loading content...