summaryrefslogtreecommitdiff
path: root/bin
diff options
authorSylvain Pineau <sylvain.pineau@canonical.com>2016-02-13 14:21:18 +0100
committerSylvain Pineau <sylvain.pineau@canonical.com>2016-02-13 14:21:18 +0100
commitf76d5b5ce3a3cd29a26909235dd030927f6e3f51 (patch)
tree7fb84574d0f51bd16b16c798a133c969aa670a48 /bin
parent3c366421891f45047ef8b5830828b708c0e35f7d (diff)
providers:checkbox:bin:camera_test: Display the still picture using GST (not eog)
Fixes: https://bugs.launchpad.net/plainbox-provider-checkbox/+bug/1078884
Diffstat (limited to 'bin')
-rwxr-xr-xbin/camera_test16
1 files changed, 12 insertions, 4 deletions
diff --git a/bin/camera_test b/bin/camera_test
index 235eaaf..794578b 100755
--- a/bin/camera_test
+++ b/bin/camera_test
@@ -303,10 +303,18 @@ class CameraTest:
self._pipeline.set_state(Gst.State.NULL)
if not quiet:
- try:
- check_call(["timeout", "-k", "11", "10", "eog", filename])
- except CalledProcessError:
- pass
+ import imghdr
+ image_type = imghdr.what(filename)
+ pipespec = ("filesrc location=%(filename)s ! "
+ "%(type)sdec ! "
+ "videoscale ! "
+ "imagefreeze ! autovideosink"
+ % {'filename': filename,
+ 'type': image_type})
+ self._pipeline = Gst.parse_launch(pipespec)
+ self._pipeline.set_state(Gst.State.PLAYING)
+ time.sleep(10)
+ self._pipeline.set_state(Gst.State.NULL)
def _supported_resolutions_to_string(self, supported_resolutions):
"""