Skip to content
Snippets Groups Projects
Commit 8a50e01c authored by Patrick Godwin's avatar Patrick Godwin
Browse files

pipeparts/__init__.py: add convenience func for stream API to leverage framecppchannelmux

parent ccf7a67f
No related branches found
No related tags found
1 merge request!55Add high-level Stream API to build GStreamer pipelines
......@@ -70,6 +70,7 @@ from .filters import fir as mkfirfilter
from .encode import flac as mkflacenc
from .mux import framecpp_channel_demux as mkframecppchanneldemux
from .mux import framecpp_channel_mux as mkframecppchannelmux
from .mux import framecpp_channel_mux_from_list as mkframecppchannelmux_from_list
from .sink import gwf as mkframecppfilesink
from .source import framexmit as mkframexmitsrc
from .filters import gate as mkgate
......
......@@ -194,6 +194,32 @@ def framecpp_channel_mux(pipeline, channel_src_map, units=None, seglists=None, *
return elem
def framecpp_channel_mux_from_list(pipeline, *srcs, channels = None, **properties):
"""Mux a source using framecpp
NOTE: This acts similarly to framecpp_channel_mux with a different function
signature to map channels to sources.
Args:
pipeline:
Gst.Pipeline, the pipeline to which the new element will be added
*srcs:
Gst.Element, the source elements
channels:
Union[str, Iterable], default None, the channels mapping to sources
seglists:
default None, if given create a segments handler for these segments
**properties:
Returns:
Element, the muxed sources
"""
if isinstance(channels, str):
channels = [channels]
channel_src_map = {channel: src for channel, src in zip(channels, srcs)}
return framecpp_channel_mux(pipeline, channel_src_map, **properties)
def ogg_mux(pipeline, src):
"""This element merges streams (audio and video) into ogg files.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment