diff options
author | MaZderMind <github@mazdermind.de> | 2015-05-14 19:59:16 +0200 |
---|---|---|
committer | MaZderMind <github@mazdermind.de> | 2015-05-14 19:59:16 +0200 |
commit | 038bc89367f26fe9be8bff135c8c0eca3f9faaaf (patch) | |
tree | 692306fb3bb14b75b09056711b4fe4bfd74d2860 /voctocore/lib/avsource.py | |
parent | 51ac59343673286cc4c5d1d9b484b1e3a8f657a5 (diff) |
implement switchable preview source in mjpg coding for the GUI
Diffstat (limited to 'voctocore/lib/avsource.py')
-rw-r--r-- | voctocore/lib/avsource.py | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/voctocore/lib/avsource.py b/voctocore/lib/avsource.py index 49b39a8..a809948 100644 --- a/voctocore/lib/avsource.py +++ b/voctocore/lib/avsource.py @@ -51,7 +51,20 @@ class AVSource(object): atee. ! queue ! interaudiosink channel=audio_{name}_mixer atee. ! queue ! interaudiosink channel=audio_{name}_mirror + """.format( + fd=conn.fileno(), + name=self.name, + acaps=Config.get('mix', 'audiocaps') + ) + if Config.getboolean('previews', 'enabled'): + pipeline += """ + atee. ! queue ! interaudiosink channel=audio_{name}_preview + """.format( + name=self.name + ) + + pipeline += """ demux. ! {vcaps} ! textoverlay halignment=left valignment=top ypad=25 text=AVSource ! @@ -64,9 +77,16 @@ class AVSource(object): """.format( fd=conn.fileno(), name=self.name, - acaps=Config.get('mix', 'audiocaps'), vcaps=Config.get('mix', 'videocaps') ) + + if Config.getboolean('previews', 'enabled'): + pipeline += """ + vtee. ! queue ! intervideosink channel=video_{name}_preview + """.format( + name=self.name + ) + self.log.debug('Launching Source-Pipeline:\n%s', pipeline) self.receiverPipeline = Gst.parse_launch(pipeline) |