gstlal 1.13.0
Loading...
Searching...
No Matches
python.gstpipetools Namespace Reference

Functions

bool is_element (Any x)
bool is_pad (Any x)
Gst.Caps to_caps (Union[str, Gst.Caps] x)
Gst.Element make_element (str type_name, str name=None, **dict properties)
Gst.Pipeline make_pipeline (str name)
 run_pipeline (Gst.Pipeline pipeline, Tuple[Time, Time] segment=LIVE_SEGMENT, Optional[Iterable[Callable]] handlers=None)
 seek (pipeline, Tuple[Time, Time] segment, flags=Gst.SeekFlags.FLUSH)
Tuple[Gst.SeekType, int] seek_args (Time time)

Variables

tuple LIVE_SEGMENT = (None, None)
 Time = Union[int, float, LIGOTimeGPS]

Detailed Description

Miscellaneous utilities for working with Gstreamer Pipelines

References:
    [1] 1.0 API: https://lazka.github.io/pgi-docs/Gst-1.0/index.html

Function Documentation

◆ is_element()

bool is_element ( Any x)
Test whether an object is a Gst Element. TODO: do these belong somewhere more general?

    Args:
        x:
            Any, the object to test

    Returns:
        bool, True if x is a Gst Element, false otherwise

Definition at line 25 of file gstpipetools.py.

◆ is_pad()

bool is_pad ( Any x)
Test whether an object is a Gst Pad. TODO: do these belong somewhere more general?

    Args:
        x:
            Any, the object to test

    Returns:
        bool, True if x is a Gst Pad, false otherwise

Definition at line 38 of file gstpipetools.py.

◆ make_element()

Gst.Element make_element ( str type_name,
str name = None,
**dict properties )
Create a new element of the type defined by the given element factory. If name is None, then the element will
    receive a guaranteed unique name, consisting of the element factory name and a number. If name is given, it will
    be given the name supplied.

    Args:
        type_name:
            str, the name of the type of element
        elem_name:
            str, default None, the name of the element instance
        properties:
            dict, keyword arguments to set as properties of the element

    References:
        [1] ElementFactor.make: https://lazka.github.io/pgi-docs/Gst-1.0/classes/ElementFactory.html#Gst.ElementFactory.make

    Returns:
        Gst.Element

Definition at line 68 of file gstpipetools.py.

◆ make_pipeline()

Gst.Pipeline make_pipeline ( str name)
Create a Pipeline, which is the macroscopic container for Gstreamer elements and is necessary
    prior to creating any elements

    Args:
        name:
            str, the name of the pipeline

    References:
        [1] https://gstreamer.freedesktop.org/documentation/application-development/introduction/basics.html?gi-language=c#bins-and-pipelines

    Returns:
        Pipeline

Definition at line 98 of file gstpipetools.py.

◆ run_pipeline()

run_pipeline ( Gst.Pipeline pipeline,
Tuple[Time, Time] segment = LIVE_SEGMENT,
Optional[Iterable[Callable]] handlers = None )
Run a pipeline using the main event loop

    Args:
        pipeline:
            Gst.Pipeline, the pipeline to run
        segment:
            Tuple[Time, Time], a playback segment
        handlers:
            Iterable[Callable], default None, an optional list of functions that return Handlers. Each must
            accept only a "mainloop" and "pipeline" argument.

    Returns:
        None

Definition at line 115 of file gstpipetools.py.

◆ seek()

seek ( pipeline,
Tuple[Time, Time] segment,
flags = Gst.SeekFlags.FLUSH )
Create a new seek event, i.e., Gst.Event.new_seek()  for a given
    gps_start_time and gps_end_time, with optional flags.

    Args:
        pipeline:
        gps_start_time:
            start time as LIGOTimeGPS, float
        gps_end_time:
            end time as LIGOTimeGPS, float
        flags:
            Optional flags, see [2] for options

    Notes:
        In contrast to the documentation, we set the seek event directly on the pipeline sources. This is because of implementation
        issues in framecpp demux that prevent the full backward propagation of the seek event from sink -> source (as is done in the
        gstreamer documentation [1]).

    References:
        [1] https://gstreamer.freedesktop.org/documentation/additional/design/seeking.html?gi-language=python
        [2] Flags https://gstreamer.freedesktop.org/documentation/gstreamer/gstsegment.html?gi-language=python#GstSeekFlags

    Returns:
        None

Definition at line 150 of file gstpipetools.py.

◆ seek_args()

Tuple[Gst.SeekType, int] seek_args ( Time time)
Convenience function for determining the type of arguments to seek for a given time input

    Args:
        time:
            Time, either a float or LIGOTimeGPS

    Returns:
        Tuple[Gst.SeekType, int]

Definition at line 201 of file gstpipetools.py.

◆ to_caps()

Gst.Caps to_caps ( Union[str, Gst.Caps] x)
Create a Caps object from a string, or pass thru if already is Caps

    Args:
        x:
            str or Caps, if a string construct Caps instance from x, else pass thru as Caps

    Returns:
        Caps

Definition at line 51 of file gstpipetools.py.

Variable Documentation

◆ LIVE_SEGMENT

tuple python.gstpipetools.LIVE_SEGMENT = (None, None)

Definition at line 21 of file gstpipetools.py.

◆ Time

python.gstpipetools.Time = Union[int, float, LIGOTimeGPS]

Definition at line 22 of file gstpipetools.py.