Gst.DeviceProvider¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | Gst.Object (27), GObject.Object (37) | 
|---|---|
| Structs: | Gst.DeviceProviderClass (5), GObject.ObjectClass (5) | 
| class | add_metadata(key, value) | 
| class | add_static_metadata(key, value) | 
| class | get_metadata(key) | 
| class | register(plugin, name, rank, type) | 
| class | set_metadata(longname, classification, description, author) | 
| class | set_static_metadata(longname, classification, description, author) | 
| can_monitor() | |
| device_add(device) | |
| device_changed(device, changed_device) | |
| device_remove(device) | |
| get_bus() | |
| get_devices() | |
| get_factory() | |
| get_hidden_providers() | |
| get_metadata(key) | |
| hide_provider(name) | |
| start() | |
| stop() | |
| unhide_provider(name) | 
Properties¶
| Inherited: | Gst.Object (2) | 
|---|
Signals¶
| Inherited: | Gst.Object (1), GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| provider-hidden | |
| provider-unhidden | 
Fields¶
| Inherited: | Gst.Object (1), GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| devices | [ object] | r | a GLib.Listof theGst.Deviceobjects | 
| parent | Gst.Object | r | The parent Gst.Object | 
Class Details¶
- 
class Gst.DeviceProvider(**kwargs)¶
- Bases: - Gst.Object- Abstract: - Yes - Structure: - Gst.DeviceProviderClass- A - Gst.DeviceProvidersubclass 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.DeviceProvidersubclass is a singleton, a plugin should normally provide a single subclass for all devices.- Applications would normally use a - Gst.DeviceMonitorto monitor devices from all relevant providers.- New in version 1.4. - 
classmethod add_metadata(key, value)¶
- Parameters: - Set key with value as metadata in self. - New in version 1.4. 
 - 
classmethod add_static_metadata(key, value)¶
- Parameters: - 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 get_metadata(key)[source]¶
- Parameters: - key ( - str) – the key to get- Returns: - the metadata for key. - Return type: - stror- None- Get metadata with key in self. - New in version 1.4. 
 - 
classmethod register(plugin, name, rank, type)[source]¶
- Parameters: - plugin (Gst.PluginorNone) –Gst.Pluginto register the device provider with, orNonefor a static device provider.
- name (str) – name of device providers of this type
- rank (int) – rank of device provider (higher rank means more importance when autoplugging)
- type (GObject.GType) –GObject.GTypeof 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. 
- plugin (
 - 
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. 
- longname (
 - 
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. 
- longname (
 - 
device_add(device)[source]¶
- Parameters: - device ( - Gst.Device) – a- Gst.Devicethat has been added- Posts a message on the provider’s - Gst.Busto 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_device
- changed_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_CHANGEDmessage on the bus to let the application know that the device was modified.- Gst.Deviceis 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 (
 - 
device_remove(device)[source]¶
- Parameters: - device ( - Gst.Device) – a- Gst.Devicethat has been removed- Posts a message on the provider’s - Gst.Busto inform applications that a device has been removed.- This is for use by subclasses. - New in version 1.4. 
 - 
get_bus()[source]¶
- Returns: - a - Gst.Bus- Return type: - Gst.Bus- Gets the - Gst.Busof this- Gst.DeviceProvider- New in version 1.4. 
 - 
get_devices()[source]¶
- Returns: - a - GLib.Listof- Gst.Device- Return type: - [ - Gst.Device]- 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.Deviceobjedcts that have been returned by the- Gst.MessageType.DEVICE_ADDEDmessages.- New in version 1.4. 
 - 
get_factory()[source]¶
- Returns: - the - Gst.DeviceProviderFactoryused for creating this device provider. no refcounting is needed.- Return type: - Gst.DeviceProviderFactoryor- None- 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 - Nonewhen nothing is hidden by self. Free with- GLib.strfreev.- Return type: - [ - str]- Get the provider factory names of the - Gst.DeviceProviderinstances that are hidden by self.- New in version 1.6. 
 - 
get_metadata(key)[source]
- Parameters: - key ( - str) – the key to get- Returns: - the metadata for key. - Return type: - str- Get metadata with key in self. - New in version 1.14. 
 - 
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. 
 - 
start()[source]¶
- Returns: - Trueif the device providering could be started- Return type: - bool- Starts providering the devices. This will cause - Gst.MessageType.DEVICE_ADDEDand- Gst.MessageType.DEVICE_REMOVEDmessages to be posted on the provider’s bus when devices are added or removed from the system.- Since the - Gst.DeviceProvideris 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 the- Gst.MessageType.DEVICE_ADDEDmessages 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.DeviceProviderwill stop providering the devices. This needs to be called the same number of times that- Gst.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¶
- Returns: - Trueif the device providering could be started- Return type: - bool- Starts providering the devices. This will cause - Gst.MessageType.DEVICE_ADDEDand- Gst.MessageType.DEVICE_REMOVEDmessages to be posted on the provider’s bus when devices are added or removed from the system.- Since the - Gst.DeviceProvideris 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 the- Gst.MessageType.DEVICE_ADDEDmessages 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.DeviceProviderwill stop providering the devices. This needs to be called the same number of times that- Gst.DeviceProvider.start() was called.- New in version 1.4. 
 
- 
classmethod 
Signal Details¶
- Signal Name: - provider-hidden- Flags: - Parameters: - device_provider (Gst.DeviceProvider) – The object which received the signal
- object (str) –
 
- device_provider (
- Signal Name: - provider-unhidden- Flags: - Parameters: - device_provider (Gst.DeviceProvider) – The object which received the signal
- object (str) –
 
- device_provider (