diff options
Diffstat (limited to 'voctocore/lib/pipeline.py')
-rw-r--r-- | voctocore/lib/pipeline.py | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/voctocore/lib/pipeline.py b/voctocore/lib/pipeline.py index a4ada04..4e4a714 100644 --- a/voctocore/lib/pipeline.py +++ b/voctocore/lib/pipeline.py @@ -8,6 +8,10 @@ from lib.video.src import VideoSrc from lib.video.rawoutput import VideoRawOutput from lib.video.mix import VideoMix +from lib.audio.src import AudioSrc +from lib.audio.rawoutput import AudioRawOutput +from lib.audio.mix import AudioMix + class Pipeline(object): """mixing, streaming and encoding pipeline constuction and control""" log = logging.getLogger('Pipeline') @@ -18,11 +22,18 @@ class Pipeline(object): vmixer = None vmixerout = None + asources = [] + amirrors = [] + apreviews = [] + amixer = None + amixerout = None + def __init__(self): self.log.debug('creating Video-Pipeline') self.initVideo() - self.log.debug('creating Control-Server') + self.log.debug('creating Audio-Pipeline') + self.initAudio() def initVideo(self): caps = Config.get('mix', 'videocaps') @@ -52,3 +63,25 @@ class Pipeline(object): port = 11000 self.log.debug('Creating Video-Mixer-Output at tcp-port %u', port) self.vmixerout = VideoRawOutput('video_mix', port, caps) + + def initAudio(self): + caps = Config.get('mix', 'audiocaps') + self.log.info('Audio-Caps configured to: %s', caps) + + names = Config.getlist('sources', 'audio') + if len(names) < 1: + raise RuntimeException("At least one Audio-Source must be configured!") + + for idx, name in enumerate(names): + port = 20000 + idx + self.log.info('Creating Audio-Source %s at tcp-port %u', name, port) + + source = AudioSrc(name, port, caps) + self.asources.append(source) + + + port = 23000 + idx + self.log.info('Creating Mirror-Output for Audio-Source %s at tcp-port %u', name, port) + + mirror = AudioRawOutput('audio_%s_mirror' % name, port, caps) + self.amirrors.append(mirror) |