Device#
Added in version 1.4.
Superclasses: Object, InitiallyUnowned, Object
Device are objects representing a device, they contain
relevant metadata about the device, such as its class and the Caps
representing the media types it can produce or handle.
Device are created by DeviceProvider objects which can be
aggregated by DeviceMonitor objects.
Methods#
- class Device
- create_element(name: str | None = None) Element | None#
Creates the element with all of the required parameters set to use this device.
Added in version 1.4.
- Parameters:
name – name of new element, or
Noneto automatically create a unique name.
- get_device_class() str#
Gets the “class” of a device. This is a “/” separated list of classes that represent this device. They are a subset of the classes of the
DeviceProviderthat produced this device.Added in version 1.4.
- has_classes(classes: str) bool#
Check if
devicematches all of the given classesAdded in version 1.4.
- Parameters:
classes – a “/”-separated list of device classes to match, only match if all classes are matched
- has_classesv(classes: list[str]) bool#
Check if
factorymatches all of the given classesAdded in version 1.4.
- Parameters:
classes – a
Noneterminated array of classes to match, only match if all classes are matched
- reconfigure_element(element: Element) bool#
Tries to reconfigure an existing element to use the device. If this function fails, then one must destroy the element and create a new one using
create_element().Note: This should only be implemented for elements can change their device in the PLAYING state.
Added in version 1.4.
- Parameters:
element – a
Element
Properties#
Signals#
Virtual Methods#
- class Device
- do_create_element(name: str | None = None) Element | None#
Creates the element with all of the required parameters set to use this device.
Added in version 1.4.
- Parameters:
name – name of new element, or
Noneto automatically create a unique name.
- do_reconfigure_element(element: Element) bool#
Tries to reconfigure an existing element to use the device. If this function fails, then one must destroy the element and create a new one using
create_element().Note: This should only be implemented for elements can change their device in the PLAYING state.
Added in version 1.4.
- Parameters:
element – a
Element