Add basic pipeline tools
Motivation
The same code is repeated in many places for creating a pipeline, coercing strings to Caps, and running a pipeline. This MR gathers these into a single place.
Changes
- added several utilities to
gstlal.gsttools
for creating and executing gstreamer pipelines - renames
gstlal.gsttools
to a more specificgstlal.gstpipetools
Related Issues
Closes: #88 (closed) Related: #90, #91
Examples
Using the new utilities it's possible to put together a simple GStreamer pipeline and run.
# Import utilities
from gstlal import gsttools
from gstlal.pipeparts import source, sink, transform, encode
# Construct the pipeline
pipeline = gsttools.make_pipeline('Tutorial101')
head = source.audio_test(pipeline, wave=source.AudioTestWaveform.Sine)
head = transform.amplify(pipeline, head, amplification=0.5)
head = encode.wav(pipeline, head)
head = sink.file(pipeline, head, 'sample-out.wav')
# Execute the pipeline
gsttools.run_pipeline(pipeline, segment=(0, 1))
Edited by James Kennington