Gst.DeviceProvider¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
Properties¶
- Inherited:
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
devices |
[ |
r |
a |
parent |
r |
The parent |
Class Details¶
- class Gst.DeviceProvider(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
A
Gst.DeviceProvider
subclass is provided by a plugin that handles devices if there is a way to programmatically list connected devices. It can also optionally provide updates to the list of connected devices.Each
Gst.DeviceProvider
subclass is a singleton, a plugin should normally provide a single subclass for all devices.Applications would normally use a
Gst.DeviceMonitor
to monitor devices from all relevant providers.New in version 1.4.
- classmethod add_metadata(key, value)¶
-
Set key with value as metadata in self.
New in version 1.4.
- classmethod add_static_metadata(key, value)¶
-
Set key with value as metadata in self.
Same as
Gst.DeviceProviderClass.add_metadata
(), but value must be a static string or an inlined string, as it will not be copied. (GStreamer plugins will be made resident once loaded, so this function can be used even from dynamically loaded plugins.)New in version 1.4.
- classmethod register(plugin, name, rank, type)[source]¶
- Parameters:
plugin (
Gst.Plugin
orNone
) –Gst.Plugin
to register the device provider with, orNone
for a static device provider.name (
str
) – name of device providers of this typerank (
int
) – rank of device provider (higher rank means more importance when autoplugging)type (
GObject.GType
) –GObject.GType
of device provider to register
- Returns:
- Return type:
Create a new device providerfactory capable of instantiating objects of the type and add the factory to plugin.
New in version 1.4.
- classmethod set_metadata(longname, classification, description, author)¶
- Parameters:
longname (
str
) – The long English name of the device provider. E.g. “File Sink”classification (
str
) – String describing the type of device provider, as an unordered list separated with slashes (‘/’). See draft-klass.txt of the design docs for more details and common types. E.g: “Sink/File”description (
str
) – Sentence describing the purpose of the device provider. E.g: “Write stream to a file”author (
str
) – Name and contact details of the author(s). Use \n to separate multiple author metadata. E.g: “Joe Bloggs <joe.blogs at foo.com>”
Sets the detailed information for a
Gst.DeviceProviderClass
.This function is for use in _class_init functions only.
New in version 1.4.
- classmethod set_static_metadata(longname, classification, description, author)¶
- Parameters:
longname (
str
) – The long English name of the element. E.g. “File Sink”classification (
str
) – String describing the type of element, as an unordered list separated with slashes (‘/’). See draft-klass.txt of the design docs for more details and common types. E.g: “Sink/File”description (
str
) – Sentence describing the purpose of the element. E.g: “Write stream to a file”author (
str
) – Name and contact details of the author(s). Use \n to separate multiple author metadata. E.g: “Joe Bloggs <joe.blogs at foo.com>”
Sets the detailed information for a
Gst.DeviceProviderClass
.This function is for use in _class_init functions only.
Same as
Gst.DeviceProviderClass.set_metadata
(), but longname, classification, description, and author must be static strings or inlined strings, as they will not be copied. (GStreamer plugins will be made resident once loaded, so this function can be used even from dynamically loaded plugins.)New in version 1.4.
- device_add(device)[source]¶
- Parameters:
device (
Gst.Device
) – aGst.Device
that has been added
Posts a message on the provider’s
Gst.Bus
to inform applications that a new device has been added.This is for use by subclasses.
device's reference count will be incremented, and any floating reference will be removed (see gst_object_ref_sink()).
New in version 1.4.
- device_changed(device, changed_device)[source]¶
- Parameters:
device (
Gst.Device
) – the new version of changed_devicechanged_device (
Gst.Device
) – the old version of the device that has been updated
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.Gst.Device
is immutable for MT. safety purposes so this is an “atomic” way of letting the application know when a device was modified.New in version 1.16.
- device_remove(device)[source]¶
- Parameters:
device (
Gst.Device
) – aGst.Device
that has been removed
Posts a message on the provider’s
Gst.Bus
to inform applications that a device has been removed.This is for use by subclasses.
New in version 1.4.
- get_bus()[source]¶
-
Gets the
Gst.Bus
of thisGst.DeviceProvider
New in version 1.4.
- get_devices()[source]¶
- Returns:
a
GLib.List
ofGst.Device
- Return type:
Gets a list of devices that this provider understands. This may actually probe the hardware if the provider is not currently started.
If the provider has been started, this will returned the same
Gst.Device
objedcts that have been returned by theGst.MessageType.DEVICE_ADDED
messages.New in version 1.4.
- get_factory()[source]¶
- Returns:
the
Gst.DeviceProviderFactory
used for creating this device provider. no refcounting is needed.- Return type:
Retrieves the factory that was used to create this device provider.
New in version 1.4.
- Returns:
a list of hidden providers factory names or
None
when nothing is hidden by self. Free withGLib.strfreev
.- Return type:
[
str
]
Get the provider factory names of the
Gst.DeviceProvider
instances that are hidden by self.New in version 1.6.
- hide_provider(name)[source]¶
- Parameters:
name (
str
) – a provider factory name
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.
New in version 1.6.
- is_started()[source]¶
- Return type:
This function can be used to know if the self was successfully started.
New in version 1.20.
- start()[source]¶
-
Starts providering the devices. This will cause
Gst.MessageType.DEVICE_ADDED
andGst.MessageType.DEVICE_REMOVED
messages to be posted on the provider’s bus when devices are added or removed from the system.Since the
Gst.DeviceProvider
is a singleton,Gst.DeviceProvider.start
() may already have been called by another user of the object,Gst.DeviceProvider.stop
() needs to be called the same number of times.After this function has been called,
Gst.DeviceProvider.get_devices
() will return the same objects that have been received from theGst.MessageType.DEVICE_ADDED
messages and will no longer probe.New in version 1.4.
- stop()[source]¶
Decreases the use-count by one. If the use count reaches zero, this
Gst.DeviceProvider
will stop providering the devices. This needs to be called the same number of times thatGst.DeviceProvider.start
() was called.New in version 1.4.
- unhide_provider(name)[source]¶
- Parameters:
name (
str
) – a provider factory name
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.
New in version 1.6.
- do_start() virtual¶
-
Starts providering the devices. This will cause
Gst.MessageType.DEVICE_ADDED
andGst.MessageType.DEVICE_REMOVED
messages to be posted on the provider’s bus when devices are added or removed from the system.Since the
Gst.DeviceProvider
is a singleton,Gst.DeviceProvider.start
() may already have been called by another user of the object,Gst.DeviceProvider.stop
() needs to be called the same number of times.After this function has been called,
Gst.DeviceProvider.get_devices
() will return the same objects that have been received from theGst.MessageType.DEVICE_ADDED
messages and will no longer probe.New in version 1.4.
- do_stop() virtual¶
Decreases the use-count by one. If the use count reaches zero, this
Gst.DeviceProvider
will stop providering the devices. This needs to be called the same number of times thatGst.DeviceProvider.start
() was called.New in version 1.4.
Signal Details¶
- Signal Name:
provider-hidden
- Flags:
- Parameters:
device_provider (
Gst.DeviceProvider
) – The object which received the signalobject (
str
) –
- Signal Name:
provider-unhidden
- Flags:
- Parameters:
device_provider (
Gst.DeviceProvider
) – The object which received the signalobject (
str
) –