aboutsummaryrefslogtreecommitdiff
path: root/voctogui/lib
diff options
context:
space:
mode:
authorMaZderMind <git@mazdermind.de>2016-01-30 16:18:21 +0100
committerMaZderMind <git@mazdermind.de>2016-01-30 16:18:21 +0100
commit3f24beb85790027883b33f678cc0d12a353e35ed (patch)
treecb105b4a386e55b5b860ab6bfc2797ea5899aafb /voctogui/lib
parent542f76422f9cca033803203f47b47c11aa3d2305 (diff)
force preview-display-scaler to preview-size in x-mode, fixes #53
Diffstat (limited to 'voctogui/lib')
-rw-r--r--voctogui/lib/videodisplay.py11
-rw-r--r--voctogui/lib/videopreviews.py2
2 files changed, 10 insertions, 3 deletions
diff --git a/voctogui/lib/videodisplay.py b/voctogui/lib/videodisplay.py
index 0280e74..8ce1413 100644
--- a/voctogui/lib/videodisplay.py
+++ b/voctogui/lib/videodisplay.py
@@ -6,7 +6,7 @@ from lib.config import Config
class VideoDisplay(object):
""" Displays a Voctomix-Video-Stream into a GtkWidget """
- def __init__(self, drawing_area, port, play_audio=False, level_callback=None):
+ def __init__(self, drawing_area, port, width=None, height=None, play_audio=False, level_callback=None):
self.log = logging.getLogger('VideoDisplay[%u]' % port)
self.drawing_area = drawing_area
@@ -61,11 +61,18 @@ class VideoDisplay(object):
"""
elif videosystem == 'x':
+ prescale_caps = 'video/x-raw'
+ if width and height:
+ prescale_caps += ',width=%u,height=%u' % (width, height)
+
pipeline += """
videoconvert !
videoscale !
+ {prescale_caps} !
ximagesink
- """
+ """.format(
+ prescale_caps=prescale_caps
+ )
else:
raise Exception('Invalid Videodisplay-System configured: %s'. system)
diff --git a/voctogui/lib/videopreviews.py b/voctogui/lib/videopreviews.py
index d80541f..fe41aea 100644
--- a/voctogui/lib/videopreviews.py
+++ b/voctogui/lib/videopreviews.py
@@ -52,7 +52,7 @@ class VideoPreviewsController(object):
video.set_size_request(width, height)
drawing_area.pack_start(preview, fill=False, expand=False, padding=0)
- player = VideoDisplay(video, port=13000 + idx)
+ player = VideoDisplay(video, port=13000 + idx, width=width, height=height)
uibuilder.find_widget_recursive(preview, 'label').set_label(source)
btn_a = uibuilder.find_widget_recursive(preview, 'btn_a')