Gst.Device

g GObject.InitiallyUnowned GObject.InitiallyUnowned Gst.Object Gst.Object GObject.InitiallyUnowned->Gst.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gst.Device Gst.Device Gst.Object->Gst.Device

Subclasses:

None

Methods

Inherited:

Gst.Object (27), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

create_element (name)

get_caps ()

get_device_class ()

get_display_name ()

get_properties ()

has_classes (classes)

has_classesv (classes)

reconfigure_element (element)

Virtual Methods

Inherited:

Gst.Object (1), GObject.Object (7)

do_create_element (name)

do_reconfigure_element (element)

Properties

Inherited:

Gst.Object (2)

Name

Type

Flags

Short Description

caps

Gst.Caps

r/w/co

The possible caps of a device

device-class

str

r/w/co

The Class of the device

display-name

str

r/w/co

The user-friendly name of the device

properties

Gst.Structure

r/w/co

The extra properties of the device

Signals

Inherited:

Gst.Object (1), GObject.Object (1)

Name

Short Description

removed

Fields

Inherited:

Gst.Object (1), GObject.Object (1)

Name

Type

Access

Description

parent

Gst.Object

r

The parent Gst.Object structure.

Class Details

class Gst.Device(**kwargs)
Bases:

Gst.Object

Abstract:

Yes

Structure:

Gst.DeviceClass

Gst.Device are objects representing a device, they contain relevant metadata about the device, such as its class and the Gst.Caps representing the media types it can produce or handle.

Gst.Device are created by Gst.DeviceProvider objects which can be aggregated by Gst.DeviceMonitor objects.

New in version 1.4.

create_element(name)[source]
Parameters:

name (str or None) – name of new element, or None to automatically create a unique name.

Returns:

a new Gst.Element configured to use this device

Return type:

Gst.Element or None

Creates the element with all of the required parameters set to use this device.

New in version 1.4.

get_caps()[source]
Returns:

The Gst.Caps supported by this device. Unref with gst_caps_unref() when done.

Return type:

Gst.Caps or None

Getter for the Gst.Caps that this device supports.

New in version 1.4.

get_device_class()[source]
Returns:

The device class. Free with GLib.free() after use.

Return type:

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

New in version 1.4.

get_display_name()[source]
Returns:

The device name. Free with GLib.free() after use.

Return type:

str

Gets the user-friendly name of the device.

New in version 1.4.

get_properties()[source]
Returns:

The extra properties or None when there are none. Free with Gst.Structure.free() after use.

Return type:

Gst.Structure or None

Gets the extra properties of a device.

New in version 1.6.

has_classes(classes)[source]
Parameters:

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

Returns:

True if self matches.

Return type:

bool

Check if self matches all of the given classes

New in version 1.4.

has_classesv(classes)[source]
Parameters:

classes ([str]) – a None terminated array of classes to match, only match if all classes are matched

Returns:

True if self matches.

Return type:

bool

Check if factory matches all of the given classes

New in version 1.4.

reconfigure_element(element)[source]
Parameters:

element (Gst.Element) – a Gst.Element

Returns:

True if the element could be reconfigured to use this device, False otherwise.

Return type:

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 Gst.Device.create_element().

Note: This should only be implemented for elements can change their device in the PLAYING state.

New in version 1.4.

do_create_element(name) virtual
Parameters:

name (str or None) – name of new element, or None to automatically create a unique name.

Returns:

a new Gst.Element configured to use this device

Return type:

Gst.Element or None

Creates the element with all of the required parameters set to use this device.

New in version 1.4.

do_reconfigure_element(element) virtual
Parameters:

element (Gst.Element) – a Gst.Element

Returns:

True if the element could be reconfigured to use this device, False otherwise.

Return type:

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 Gst.Device.create_element().

Note: This should only be implemented for elements can change their device in the PLAYING state.

New in version 1.4.

Signal Details

Gst.Device.signals.removed(device)
Signal Name:

removed

Flags:

RUN_LAST

Parameters:

device (Gst.Device) – The object which received the signal

Property Details

Gst.Device.props.caps
Name:

caps

Type:

Gst.Caps

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The possible caps of a device

Gst.Device.props.device_class
Name:

device-class

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The Class of the device

Gst.Device.props.display_name
Name:

display-name

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The user-friendly name of the device

Gst.Device.props.properties
Name:

properties

Type:

Gst.Structure

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The extra properties of the device