Trait gstreamer_video::prelude::DeviceMonitorExt [−][src]
pub trait DeviceMonitorExt {
fn add_filter<'a, 'b, P, Q>(&self, classes: P, caps: Q) -> u32
where
P: Into<Option<&'a str>>,
Q: Into<Option<&'b GstRc<CapsRef>>>;
fn get_bus(&self) -> Bus;
fn get_devices(&self) -> Vec<Device>;
fn get_providers(&self) -> Vec<String>;
fn get_show_all_devices(&self) -> bool;
fn remove_filter(&self, filter_id: u32) -> bool;
fn set_show_all_devices(&self, show_all: bool);
fn start(&self) -> Result<(), BoolError>;
fn stop(&self);
fn get_property_show_all(&self) -> bool;
fn set_property_show_all(&self, show_all: bool);
fn connect_property_show_all_notify<F>(&self, f: F) -> SignalHandlerId
where
F: 'static + Send + Sync + Fn(&Self);
}Required Methods
fn add_filter<'a, 'b, P, Q>(&self, classes: P, caps: Q) -> u32 where
P: Into<Option<&'a str>>,
Q: Into<Option<&'b GstRc<CapsRef>>>,
P: Into<Option<&'a str>>,
Q: Into<Option<&'b GstRc<CapsRef>>>,
Adds a filter for which Device will be monitored, any device that matches
all these classes and the Caps will be returned.
If this function is called multiple times to add more filters, each will be matched independently. That is, adding more filters will not further restrict what devices are matched.
The Caps supported by the device as returned by DeviceExt::get_caps are
not intersected with caps filters added using this function.
Filters must be added before the DeviceMonitor is started.
classes
device classes to use as filter or None for any class
caps
the Caps to filter or None for ANY
Returns
The id of the new filter or 0 if no provider matched the filter's classes.
fn get_bus(&self) -> Bus
fn get_devices(&self) -> Vec<Device>
Gets a list of devices from all of the relevant monitors. This may actually probe the hardware if the monitor is not currently started.
Returns
a glib::List of
Device
fn get_providers(&self) -> Vec<String>
Get a list of the currently selected device provider factories.
This
Returns
A list of device provider factory names that are currently being
monitored by self or None when nothing is being monitored.
fn get_show_all_devices(&self) -> bool
Get if self is curretly showing all devices, even those from hidden
providers.
Returns
true when all devices will be shown.
fn remove_filter(&self, filter_id: u32) -> bool
Removes a filter from the DeviceMonitor using the id that was returned
by DeviceMonitorExt::add_filter.
filter_id
the id of the filter
Returns
true of the filter id was valid, false otherwise
fn set_show_all_devices(&self, show_all: bool)
Set if all devices should be visible, even those devices from hidden
providers. Setting show_all to true might show some devices multiple times.
show_all
show all devices
fn start(&self) -> Result<(), BoolError>
Starts monitoring the devices, one this has succeeded, the
MessageType::DeviceAdded and MessageType::DeviceRemoved messages
will be emitted on the bus when the list of devices changes.
Returns
true if the device monitoring could be started
fn stop(&self)
Stops monitoring the devices.
fn get_property_show_all(&self) -> bool
fn set_property_show_all(&self, show_all: bool)
fn connect_property_show_all_notify<F>(&self, f: F) -> SignalHandlerId where
F: 'static + Send + Sync + Fn(&Self),
F: 'static + Send + Sync + Fn(&Self),
Implementors
impl<O> DeviceMonitorExt for O where
O: IsA<DeviceMonitor> + IsA<Object>,