Trait gstreamer::prelude::DeviceProviderExt

source ·
pub trait DeviceProviderExt: IsA<DeviceProvider> + Sealed + 'static {
Show 14 methods // Provided methods fn can_monitor(&self) -> bool { ... } fn device_add(&self, device: &impl IsA<Device>) { ... } fn device_changed( &self, device: &impl IsA<Device>, changed_device: &impl IsA<Device>, ) { ... } fn device_remove(&self, device: &impl IsA<Device>) { ... } fn bus(&self) -> Bus { ... } fn factory(&self) -> Option<DeviceProviderFactory> { ... } fn hidden_providers(&self) -> Vec<GString> { ... } fn hide_provider(&self, name: &str) { ... } fn is_started(&self) -> bool { ... } 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 { ... }
}
Expand description

Trait containing all DeviceProvider methods.

§Implementors

DeviceProvider

Provided Methods§

source

fn can_monitor(&self) -> bool

source

fn device_add(&self, device: &impl 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 gst_object_ref_sink()).

§device

a Device that has been added

source

fn device_changed( &self, device: &impl IsA<Device>, changed_device: &impl 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.

§device

the new version of changed_device

§changed_device

the old version of the device that has been updated

source

fn device_remove(&self, device: &impl 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

source

fn bus(&self) -> Bus

Gets the Bus of this DeviceProvider

§Returns

a Bus

source

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

source

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

source

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

source

fn is_started(&self) -> bool

This function can be used to know if the self was successfully started.

source

fn start(&self) -> Result<(), BoolError>

Starts providering the devices. This will cause GST_MESSAGE_DEVICE_ADDED and GST_MESSAGE_DEVICE_REMOVED messages to be posted on the provider’s bus when devices are added or removed from the system.

Since the DeviceProvider is a singleton, start() may already have been called by another user of the object, stop() needs to be called the same number of times.

After this function has been called, DeviceProviderExtManual::devices() will return the same objects that have been received from the GST_MESSAGE_DEVICE_ADDED messages and will no longer probe.

§Returns

true if the device providering could be started

source

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 start() was called.

source

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

source

fn connect_provider_hidden<F: Fn(&Self, &str) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId

source

fn connect_provider_unhidden<F: Fn(&Self, &str) + Send + Sync + 'static>( &self, f: F, ) -> SignalHandlerId

Object Safety§

This trait is not object safe.

Implementors§