gstreamer::subclass::prelude

Trait DeviceProviderImpl

Source
pub trait DeviceProviderImpl: GstObjectImpl + ObjectSubclass<Type: IsA<DeviceProvider>> {
    // Provided methods
    fn metadata() -> Option<&'static DeviceProviderMetadata> { ... }
    fn probe(&self) -> Vec<Device> { ... }
    fn start(&self) -> Result<(), LoggableError> { ... }
    fn stop(&self) { ... }
}

Provided Methods§

Source

fn metadata() -> Option<&'static DeviceProviderMetadata>

Source

fn probe(&self) -> Vec<Device>

Returns a list of devices that are currently available. This should never block. The devices should not have a parent and should be floating.

Source

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

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, DeviceProviderExt::start() may already have been called by another user of the object, DeviceProviderExt::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 DeviceProviderExt::start() was called.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§