Device

Added in version 1.4.

class Device(**properties: Any)

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 None to automatically create a unique name.

get_caps() Caps | None

Getter for the Caps that this device supports.

Added in version 1.4.

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 DeviceProvider that produced this device.

Added in version 1.4.

get_display_name() str

Gets the user-friendly name of the device.

Added in version 1.4.

get_properties() Structure | None

Gets the extra properties of a device.

Added in version 1.6.

has_classes(classes: str) bool

Check if device matches all of the given classes

Added in version 1.4.

Parameters:

classes – a “/”-separated list of device classes to match, only match if all classes are matched

has_classesv(classes: Sequence[str]) bool

Check if factory matches all of the given classes

Added in version 1.4.

Parameters:

classes – a None terminated 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

class Device
props.caps: Caps
props.device_class: str
props.display_name: str
props.properties: Structure

Signals

class Device.signals
removed() None

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 None to 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

Fields

class Device
parent

The parent Object structure.

priv