:right-sidebar: True DeviceProvider =================================================================== .. currentmodule:: gi.repository.Gst .. versionadded:: 1.4 .. class:: DeviceProvider(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gst.Object`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` :Constructors: :: DeviceProvider(**properties) Methods ------- .. rst-class:: interim-class .. class:: DeviceProvider :no-index: .. classmethod:: add_metadata(key: str, value: str) -> None :param key: :param value: .. classmethod:: add_static_metadata(key: str, value: str) -> None :param key: :param value: .. method:: can_monitor() -> bool .. method:: device_add(device: ~gi.repository.Gst.Device) -> None Posts a message on the provider's :obj:`~gi.repository.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 :func:`~gi.repository.Gst.Object.ref_sink`). .. versionadded:: 1.4 :param device: a :obj:`~gi.repository.Gst.Device` that has been added .. method:: device_changed(device: ~gi.repository.Gst.Device, changed_device: ~gi.repository.Gst.Device) -> None 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. :obj:`~gi.repository.Gst.Device` is immutable for MT. safety purposes so this is an "atomic" way of letting the application know when a device was modified. .. versionadded:: 1.16 :param device: the new version of ``changed_device`` :param changed_device: the old version of the device that has been updated .. method:: device_remove(device: ~gi.repository.Gst.Device) -> None Posts a message on the provider's :obj:`~gi.repository.Gst.Bus` to inform applications that a device has been removed. This is for use by subclasses. .. versionadded:: 1.4 :param device: a :obj:`~gi.repository.Gst.Device` that has been removed .. method:: get_bus() -> ~gi.repository.Gst.Bus Gets the :obj:`~gi.repository.Gst.Bus` of this :obj:`~gi.repository.Gst.DeviceProvider` .. versionadded:: 1.4 .. method:: get_devices() -> list[~gi.repository.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 :obj:`~gi.repository.Gst.Device` objedcts that have been returned by the ``GST_MESSAGE_DEVICE_ADDED`` messages. .. versionadded:: 1.4 .. method:: get_factory() -> ~gi.repository.Gst.DeviceProviderFactory | None Retrieves the factory that was used to create this device provider. .. versionadded:: 1.4 .. method:: get_hidden_providers() -> list[str] Get the provider factory names of the :obj:`~gi.repository.Gst.DeviceProvider` instances that are hidden by ``provider``. .. versionadded:: 1.6 .. method:: get_metadata(key: str) -> str Get metadata with ``key`` in ``provider``. .. versionadded:: 1.14 :param key: the key to get .. method:: hide_provider(name: str) -> None Make ``provider`` hide the devices from the factory with ``name``. This function is used when ``provider`` will also provide the devices reported by provider factory ``name``. A monitor should stop monitoring the device provider with ``name`` to avoid duplicate devices. .. versionadded:: 1.6 :param name: a provider factory name .. method:: is_started() -> bool This function can be used to know if the ``provider`` was successfully started. .. versionadded:: 1.20 .. method:: register(plugin: ~gi.repository.Gst.Plugin | None, name: str, rank: int, type: type) -> bool Create a new device providerfactory capable of instantiating objects of the ``type`` and add the factory to ``plugin``. .. versionadded:: 1.4 :param plugin: :obj:`~gi.repository.Gst.Plugin` to register the device provider with, or :const:`None` for a static device provider. :param name: name of device providers of this type :param rank: rank of device provider (higher rank means more importance when autoplugging) :param type: GType of device provider to register .. classmethod:: set_metadata(longname: str, classification: str, description: str, author: str) -> None :param longname: :param classification: :param description: :param author: .. classmethod:: set_static_metadata(longname: str, classification: str, description: str, author: str) -> None :param longname: :param classification: :param description: :param author: .. method:: start() -> bool Starts providering the devices. This will cause ``GST_MESSAGE_DEVICE_ADDED`` and ``GST_MESSAGE_DEVICE_REMOVED`` messages to be posted on the provider's bus when devices are added or removed from the system. Since the :obj:`~gi.repository.Gst.DeviceProvider` is a singleton, :func:`~gi.repository.Gst.DeviceProvider.start` may already have been called by another user of the object, :func:`~gi.repository.Gst.DeviceProvider.stop` needs to be called the same number of times. After this function has been called, :func:`~gi.repository.Gst.DeviceProvider.get_devices` will return the same objects that have been received from the ``GST_MESSAGE_DEVICE_ADDED`` messages and will no longer probe. .. versionadded:: 1.4 .. method:: stop() -> None Decreases the use-count by one. If the use count reaches zero, this :obj:`~gi.repository.Gst.DeviceProvider` will stop providering the devices. This needs to be called the same number of times that :func:`~gi.repository.Gst.DeviceProvider.start` was called. .. versionadded:: 1.4 .. method:: unhide_provider(name: str) -> None Make ``provider`` unhide the devices from factory ``name``. This function is used when ``provider`` 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. .. versionadded:: 1.6 :param name: a provider factory name Signals ------- .. rst-class:: interim-class .. class:: DeviceProvider.signals :no-index: .. method:: provider_hidden(object: str) -> None :param object: .. method:: provider_unhidden(object: str) -> None :param object: Virtual Methods --------------- .. rst-class:: interim-class .. class:: DeviceProvider :no-index: .. method:: do_start() -> bool Starts providering the devices. This will cause ``GST_MESSAGE_DEVICE_ADDED`` and ``GST_MESSAGE_DEVICE_REMOVED`` messages to be posted on the provider's bus when devices are added or removed from the system. Since the :obj:`~gi.repository.Gst.DeviceProvider` is a singleton, :func:`~gi.repository.Gst.DeviceProvider.start` may already have been called by another user of the object, :func:`~gi.repository.Gst.DeviceProvider.stop` needs to be called the same number of times. After this function has been called, :func:`~gi.repository.Gst.DeviceProvider.get_devices` will return the same objects that have been received from the ``GST_MESSAGE_DEVICE_ADDED`` messages and will no longer probe. .. versionadded:: 1.4 .. method:: do_stop() -> None Decreases the use-count by one. If the use count reaches zero, this :obj:`~gi.repository.Gst.DeviceProvider` will stop providering the devices. This needs to be called the same number of times that :func:`~gi.repository.Gst.DeviceProvider.start` was called. .. versionadded:: 1.4 Fields ------ .. rst-class:: interim-class .. class:: DeviceProvider :no-index: .. attribute:: devices A ``GList`` of the :obj:`~gi.repository.Gst.Device` objects .. attribute:: parent The parent :obj:`~gi.repository.Gst.Object` .. attribute:: priv