:right-sidebar: True Device =================================================================== .. currentmodule:: gi.repository.Gst .. versionadded:: 1.4 .. class:: Device(**properties: ~typing.Any) :no-contents-entry: Superclasses: :class:`~gi.repository.Gst.Object`, :class:`~gi.repository.GObject.InitiallyUnowned`, :class:`~gi.repository.GObject.Object` :obj:`~gi.repository.Gst.Device` are objects representing a device, they contain relevant metadata about the device, such as its class and the :obj:`~gi.repository.Gst.Caps` representing the media types it can produce or handle. :obj:`~gi.repository.Gst.Device` are created by :obj:`~gi.repository.Gst.DeviceProvider` objects which can be aggregated by :obj:`~gi.repository.Gst.DeviceMonitor` objects. Methods ------- .. rst-class:: interim-class .. class:: Device :no-index: .. method:: create_element(name: str | None = None) -> ~gi.repository.Gst.Element | None Creates the element with all of the required parameters set to use this device. .. versionadded:: 1.4 :param name: name of new element, or :const:`None` to automatically create a unique name. .. method:: do_create_element(self, name: str | None = None) -> ~gi.repository.Gst.Element | None :param name: .. method:: do_reconfigure_element(self, element: ~gi.repository.Gst.Element) -> bool :param element: .. method:: get_caps() -> ~gi.repository.Gst.Caps | None Getter for the :obj:`~gi.repository.Gst.Caps` that this device supports. .. versionadded:: 1.4 .. method:: 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 :obj:`~gi.repository.Gst.DeviceProvider` that produced this device. .. versionadded:: 1.4 .. method:: get_display_name() -> str Gets the user-friendly name of the device. .. versionadded:: 1.4 .. method:: get_properties() -> ~gi.repository.Gst.Structure | None Gets the extra properties of a device. .. versionadded:: 1.6 .. method:: has_classes(classes: str) -> bool Check if ``device`` matches all of the given classes .. versionadded:: 1.4 :param classes: a "/"-separated list of device classes to match, only match if all classes are matched .. method:: has_classesv(classes: list[str]) -> bool Check if ``factory`` matches all of the given classes .. versionadded:: 1.4 :param classes: a :const:`None` terminated array of classes to match, only match if all classes are matched .. method:: reconfigure_element(element: ~gi.repository.Gst.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 :func:`~gi.repository.Gst.Device.create_element`. Note: This should only be implemented for elements can change their device in the PLAYING state. .. versionadded:: 1.4 :param element: a :obj:`~gi.repository.Gst.Element` Properties ---------- .. rst-class:: interim-class .. class:: Device :no-index: .. attribute:: props.caps :type: ~gi.repository.Gst.Caps The type of the None singleton. .. attribute:: props.device_class :type: str The type of the None singleton. .. attribute:: props.display_name :type: str The type of the None singleton. .. attribute:: props.properties :type: ~gi.repository.Gst.Structure The type of the None singleton. Signals ------- .. rst-class:: interim-class .. class:: Device.signals :no-index: .. method:: removed() -> None The type of the None singleton. Virtual Methods --------------- .. rst-class:: interim-class .. class:: Device :no-index: .. method:: do_create_element(name: str | None = None) -> ~gi.repository.Gst.Element | None Creates the element with all of the required parameters set to use this device. .. versionadded:: 1.4 :param name: name of new element, or :const:`None` to automatically create a unique name. .. method:: do_reconfigure_element(element: ~gi.repository.Gst.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 :func:`~gi.repository.Gst.Device.create_element`. Note: This should only be implemented for elements can change their device in the PLAYING state. .. versionadded:: 1.4 :param element: a :obj:`~gi.repository.Gst.Element` Fields ------ .. rst-class:: interim-class .. class:: Device :no-index: .. attribute:: parent The parent :obj:`~gi.repository.Gst.Object` structure. .. attribute:: priv