pythia.utils.gst#
Deepstream interface, utilities and customization.
- pythia.utils.gst.element_repr(element: Object) str [source]#
Compute element strig based on its hierarchy.
- Parameters:
element – The gstreamer element.
- Returns:
The element’s string representation.
Example
>>> from gi.repository import Gst >>> Gst.init() >>> pipeline = Gst.parse_launch( ... "bin ( videotestsrc ! identity name=eye ) ! fakesink" ... ) >>> element_repr(pipeline.get_by_name("eye")) '/Pipeline:pipeline0/Bin:bin1/GstIdentity:eye'
- pythia.utils.gst.get_element(gst_bin: Bin, name) Element [source]#
Get element from bin.
- Parameters:
gst_bin – parent where the element is to be located.
name – name of the element to locate.
- Returns:
The found element.
- Raises:
NameError – internal gst getter returned None.
- pythia.utils.gst.get_sinkpad(gst_bin: Bin, element_name: str) Pad [source]#
Get sinkpad element from element.
- Parameters:
gst_bin – parent where the element is to be located.
element_name – name of the element to locate the sink pad.
- Returns:
The found source pad.
- pythia.utils.gst.get_srcpad(gst_bin: Bin, element_name: str) Pad [source]#
Get srcpad element from element.
- Parameters:
gst_bin – parent where the element is to be located.
element_name – name of the element to locate the source pad.
- Returns:
The found source pad.
- pythia.utils.gst.get_static_pad(element: Element, direction: Literal['sink', 'src']) Pad [source]#
Get static pad from element.
- Parameters:
element – element where the pad is located.
direction – pad direction - “sink” or “source”.
- Returns:
The found pad.
- Raises:
ValueError – Unable to get the pad.
- pythia.utils.gst.gst_iter(iterator: Iterator) Iterator [source]#
Iterate pythonically over a
Gst.Iterator
.- Parameters:
iterator – the iterator which produces values.
- Yields:
The values from the iterator
See also
http://lazka.github.io/pgi-docs/index.html#Gst-1.0/classes/Iterator.html#Gst.Iterator