diff options
author | MaZderMind <git@mazdermind.de> | 2015-11-26 15:58:07 +0100 |
---|---|---|
committer | MaZderMind <git@mazdermind.de> | 2015-11-26 15:58:07 +0100 |
commit | d513ed2bb25250945daebb4804324cd5e6ad5048 (patch) | |
tree | b5594f800655dca41fbf27a4a668c7e451a78495 /voctocore/lib/vsource.py | |
parent | ee496ab095be69efa070aab06a7dc4db81f8bb94 (diff) |
warn on imcompatible input formats, fixes #25
Diffstat (limited to 'voctocore/lib/vsource.py')
-rw-r--r-- | voctocore/lib/vsource.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/voctocore/lib/vsource.py b/voctocore/lib/vsource.py index 2296eac..893c7c0 100644 --- a/voctocore/lib/vsource.py +++ b/voctocore/lib/vsource.py @@ -32,8 +32,23 @@ class VSource(TCPSingleConnection): self.receiverPipeline.bus.connect("message::eos", self.on_eos) self.receiverPipeline.bus.connect("message::error", self.on_error) + self.all_video_caps = Gst.Caps.from_string('video/x-raw') + self.video_caps = Gst.Caps.from_string(Config.get('mix', 'videocaps')) + + demux = self.receiverPipeline.get_by_name('demux') + demux.connect('pad-added', self.on_pad_added) + self.receiverPipeline.set_state(Gst.State.PLAYING) + def on_pad_added(self, demux, src_pad): + caps = src_pad.query_caps(None) + self.log.debug('demuxer added pad w/ caps: %s', caps.to_string()) + if caps.can_intersect(self.all_video_caps): + self.log.debug('new demuxer-pad is a video-pad, testing against configured video-caps') + if not caps.can_intersect(self.video_caps): + self.log.warning('the incoming connection presented a video-stream that is not compatible to the configured caps') + self.log.warning(' incoming caps: %s', caps.to_string()) + self.log.warning(' configured caps: %s', self.video_caps.to_string()) def on_eos(self, bus, message): self.log.debug('Received End-of-Stream-Signal on Source-Pipeline') |