Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Drake <dsd@laptop.org>2011-02-16 22:55:06 (GMT)
committer Daniel Drake <dsd@laptop.org>2011-02-16 22:55:06 (GMT)
commit61480e2adeb70f84d0ad8b556a24b47929926266 (patch)
tree17d54a2e19efac635e1a707fab170aa811e65529
parentbd03b66578068394917791671db5794f8451b1c6 (diff)
Fix X to Xv switching
Returning from video playback would continue using X instead of Xv for the live camera feed.
-rw-r--r--glive.py5
-rw-r--r--model.py7
2 files changed, 11 insertions, 1 deletions
diff --git a/glive.py b/glive.py
index 4bfece9..07d187b 100644
--- a/glive.py
+++ b/glive.py
@@ -277,8 +277,11 @@ class Glive:
def _thumb_element(self, name):
return self._thumb_pipes[-1].get_by_name(name)
+ def is_using_xv(self):
+ return self._pipeline.get_by_name("xsink") == self._xvsink
+
def _configure_xv(self):
- if self._pipeline.get_by_name("xsink") == self._xvsink:
+ if self.is_using_xv():
# nothing to do, Xv already configured
return self._xvsink
diff --git a/model.py b/model.py
index f40061e..e6c90c9 100644
--- a/model.py
+++ b/model.py
@@ -126,6 +126,13 @@ class Model:
if state == constants.STATE_READY:
self.gplay.stop()
+
+ # if we aren't using Xv (e.g. glive is playing as PIP in video
+ # mode), then stop the pipeline so that we switch back to Xv
+ # in the call that follows.
+ if not self.glive.is_using_xv():
+ self.glive.stop()
+
self.glive.play()
self.activity.set_state(state)