pipeparts.sink module

“Module for producing sink elements

class pipeparts.sink.AppSync(appsink_new_buffer, appsinks=[])[source]

Bases: object

add_sink(pipeline, src, drop=False, **properties)[source]
attach(appsink)[source]

connect this AppSync’s signal handlers to the given appsink element. the element’s max-buffers property will be set to 1 (required for AppSync to work).

eos_handler(elem)[source]
new_preroll_handler(elem)[source]
new_sample_handler(elem)[source]
pull_buffers(elem)[source]

for internal use. must be called with lock held.

class pipeparts.sink.ConnectAppsinkDumpDot(pipeline, appsinks, basename, verbose=False)[source]

Bases: object

Add a signal handler to write a pipeline graph upon receipt of the first trigger buffer. the caps in the pipeline graph are not fully negotiated until data comes out the end, so this version of the graph shows the final formats on all links

execute(elem)[source]
pipeparts.sink.app(pipeline: Pipeline, src: Element, max_buffers: int = 1, drop: bool = False, sync: bool = False, async_: bool = False, **properties)[source]

Create an app sink, Appsink is a sink plugin that supports many different methods for making the application get a handle on the GStreamer data in a pipeline. Unlike most GStreamer elements, Appsink provides external API functions.

Args:
pipeline:

Gst.Pipeline, the pipeline to which the new element will be added

src:

Gst.Element, the source element

max_buffers:

int, default 1

drop:

bool, default False

sync:

bool, default False

async_:

bool, default False

**properties:

References:

[1] https://gstreamer.freedesktop.org/documentation/app/appsink.html?gi-language=python

Returns:

Element

pipeparts.sink.auto_audio(pipeline: Pipeline, src: Element) Element[source]

Create an audio sink that automatically detects an appropriate audio sink to use. It does so by scanning the registry for all elements that have “Sink” and “Audio” in the class field of their element information, and also have a non-zero autoplugging rank.

Args:
pipeline:

Gst.Pipeline, the pipeline to which the new element will be added

src:

Gst.Element, the source element

References:

[1] https://gstreamer.freedesktop.org/documentation/autodetect/autoaudiosink.html?gi-language=python

Returns:

Element

pipeparts.sink.auto_video(pipeline: Pipeline, src: Element) Element[source]

Create a video sink that automatically detects an appropriate video sink to use. It does so by scanning the registry for all elements that have “Sink” and “Video” in the class field of their element information, and also have a non-zero autoplugging rank.

Args:
pipeline:

Gst.Pipeline, the pipeline to which the new element will be added

src:

Gst.Element, the source element

References:

[1] https://gstreamer.freedesktop.org/documentation/autodetect/autovideosink.html?gi-language=python

Returns:

Element

pipeparts.sink.fake(pipeline: Pipeline, src: Element) Element[source]

Create a fake sink element

Args:
pipeline:

Gst.Pipeline, the pipeline to which the new element will be added

src:

Gst.Element, the source element

Returns:

Element

pipeparts.sink.file(pipeline: Pipeline, src: Element, filename: str, sync: bool = False, async_: bool = False) Element[source]

Add file sink to pipeline

Args:
pipeline:

Gst.Pipeline, the pipeline to which the new element will be added

src:

Gst.Element, the source element

filename:

str, the name of the output file

sync:

bool, default False

async_:

bool, default False

Returns:

Element

pipeparts.sink.framecpp_filesink_cache_entry_from_mfs_message(message)[source]

Translate an element message posted by the multifilesink element inside a framecpp_filesink bin into a lal.utils.CacheEntry object describing the file being written by the multifilesink element.

pipeparts.sink.framecpp_filesink_ldas_path_handler(elem: Element, pspec, path_digits: Tuple[str, int])[source]

Add path for file sink to element

Args:
elem:

Element, the element to which to add a filesink path property

pspec:

Unknown

path_digits:

Tuple[str, int], a string outpath and a directory digits int

Examples:
>>> filesinkelem.connect("notify::timestamp", framecpp_filesink_ldas_path_handler, (".", 5))
Returns:

Element, with the formatted outpath attached as the “path” property

pipeparts.sink.gwf(pipeline: Pipeline, src: Element, message_forward: bool = True, **properties) Element[source]

Add a framecpp file sink element to pipeline, that will write out a GWF file

Args:
pipeline:

Gst.Pipeline, the pipeline to which the new element will be added

src:

Gst.Element, the source element

message_forward:

bool, default True

**properties:

References:

Implementation: gstlal-ugly/gst/framecpp/framecpp_filesink.c

Returns:

Element

pipeparts.sink.multi_file(pipeline: Pipeline, src: Element, next_file: int = 0, sync: bool = False, async_: bool = False, **properties) Element[source]

Adds a sink element to a pipeline with useful default properties

Args:
pipeline:

Gst.Pipeline, the pipeline to which the new element will be added

src:

Gst.Element, the source element

next_file:

int, default 0

sync:

bool, default False

async_:

bool, default False

**properties:

Returns:

Element

pipeparts.sink.ogm_video(pipeline: Pipeline, videosrc: Element, filename: str, audiosrc: Optional[Element] = None, verbose: bool = False)[source]

Make a ogm video sink element

Args:
pipeline:

Gst.Pipeline, the pipeline to which the new element will be added

videosrc:

Gst.Element, the video source element

filename:

str, the name of the output video file

audiosrc:

Gst.Element, default None, the audio source element

verbose:

bool, default False

Returns:

Element, the sink element

pipeparts.sink.playback(pipeline: Pipeline, src: Element, amplification: float = 0.1) Element[source]

Create a playback pipeline and add it to existing pipeline

Args:
pipeline:

Gst.Pipeline, the pipeline to which the new element will be added

src:

Gst.Element, the source element

amplification:

float, default 0.1

Returns:

Element

pipeparts.sink.tcp_server(pipeline: Pipeline, src: Element, **properties) Element[source]

Create a sink via TCP server

Args:
pipeline:

Gst.Pipeline, the pipeline to which the new element will be added

src:

Gst.Element, the source element

**properties:

References:

[1] https://gstreamer.freedesktop.org/documentation/tcp/tcpserversink.html?gi-language=python

Returns:

Element

pipeparts.sink.trigger_xml_writer(pipeline: Pipeline, src: Element, filename: str)[source]

Write xml file

Args:
pipeline:

Gst.Pipeline, the pipeline to which the new element will be added

src:

Gst.Element, the source element

filename:

str, output path for xml file

References:

Implementation

Returns:

Element

pipeparts.sink.tsv(pipeline: Pipeline, src: Element, filename: str, segment: Optional[segment] = None) Element[source]

Converts audio time-series to tab-separated ascii text, a format compatible with most plotting utilities. The output is multi-column tab-separated ASCII text. The first column is the time, the remaining columns are the values of the channels in order.

Args:
pipeline:

Gst.Pipeline, the pipeline to which the new element will be added

src:

Gst.Element, the source element

filename:

str, the filename of the output text file

segment:

Segment, default None, a ligo.segments.segment

Returns:

Element

pipeparts.sink.tsv_tee(pipeline: Pipeline, src: Element, *args, **properties) Element[source]

Split data from source to an nxy dump

Args:
pipeline:

Gst.Pipeline, the pipeline to which the new element will be added

src:

Gst.Element, the source element

*args: **properties:

Returns:

Element