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
Provided Methods§
fn can_monitor(&self) -> bool
sourcefn device_add(&self, device: &impl IsA<Device>)
fn device_add(&self, device: &impl IsA<Device>)
sourcefn device_changed(
&self,
device: &impl IsA<Device>,
changed_device: &impl IsA<Device>,
)
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
sourcefn device_remove(&self, device: &impl IsA<Device>)
fn device_remove(&self, device: &impl IsA<Device>)
sourcefn factory(&self) -> Option<DeviceProviderFactory>
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.
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.
sourcefn hide_provider(&self, name: &str)
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
sourcefn is_started(&self) -> bool
fn is_started(&self) -> bool
This function can be used to know if the self
was successfully started.
sourcefn start(&self) -> Result<(), BoolError>
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
sourcefn stop(&self)
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.
sourcefn unhide_provider(&self, name: &str)
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