aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaZderMind <git@mazdermind.de>2015-09-06 13:50:51 +0200
committerMaZderMind <git@mazdermind.de>2015-09-06 13:50:51 +0200
commit2bc61c9012aecebba06484a25e4ca3e31d0cdc2f (patch)
treea16a83c79b818113da981a38a7b40be55739fca6
parent1bfd26ccce0cf3c2f2c7df7fbac8270d7a019efc (diff)
USe Server-Configured Video-Size in Warning-Overlay
-rw-r--r--voctogui/lib/warningoverlay.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/voctogui/lib/warningoverlay.py b/voctogui/lib/warningoverlay.py
index ad86b69..6df932e 100644
--- a/voctogui/lib/warningoverlay.py
+++ b/voctogui/lib/warningoverlay.py
@@ -1,5 +1,7 @@
import logging
-from gi.repository import GLib
+from gi.repository import GLib, Gst
+
+from lib.config import Config
class VideoWarningOverlay(object):
""" Displays a Warning-Overlay above the Video-Feed of another VideoDisplay """
@@ -13,6 +15,15 @@ class VideoWarningOverlay(object):
GLib.timeout_add_seconds(1, self.on_blink_callback)
+ caps_string = Config.get('mix', 'videocaps')
+ self.log.debug('parsing video-caps: %s', caps_string)
+ caps = Gst.Caps.from_string(caps_string)
+ struct = caps.get_structure(0)
+ _, self.width = struct.get_int('width')
+ _, self.height = struct.get_int('height')
+
+ self.log.debug('configuring size to %ux%u', self.width, self.height)
+
def on_blink_callback(self):
self.blink_state = not self.blink_state
@@ -32,8 +43,8 @@ class VideoWarningOverlay(object):
if not self.enabled:
return
- w = 1920
- h = 1080/20
+ w = self.width
+ h = self.height / 20
if self.blink_state:
cr.set_source_rgba(1.0, 0.0, 0.0, 0.8)