[SCM] morituri/master: * gstreamer.py: * task.py: Don't rely on the log module; users that want to log should first subclass from a log class that implements warning/info/debug/log
js at users.alioth.debian.org
js at users.alioth.debian.org
Sun Oct 19 20:09:32 UTC 2014
The following commit has been merged in the master branch:
commit b5e1e8da7dc805fedc26b934b818ab72ca5083eb
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date: Fri Aug 5 20:21:31 2011 +0000
* gstreamer.py:
* task.py:
Don't rely on the log module; users that want to log
should first subclass from a log class that implements
warning/info/debug/log
diff --git a/morituri/extern/task/ChangeLog b/morituri/extern/task/ChangeLog
index 6999323..d1ce6ce 100644
--- a/morituri/extern/task/ChangeLog
+++ b/morituri/extern/task/ChangeLog
@@ -1,6 +1,14 @@
2011-08-05 Thomas Vander Stichele <thomas at apestaart dot org>
* gstreamer.py:
+ * task.py:
+ Don't rely on the log module; users that want to log
+ should first subclass from a log class that implements
+ warning/info/debug/log
+
+2011-08-05 Thomas Vander Stichele <thomas at apestaart dot org>
+
+ * gstreamer.py:
Document bus and pipeline. Make bus public.
2011-08-05 Thomas Vander Stichele <thomas at apestaart dot org>
diff --git a/morituri/extern/task/gstreamer.py b/morituri/extern/task/gstreamer.py
index 986d6b1..e5e735c 100644
--- a/morituri/extern/task/gstreamer.py
+++ b/morituri/extern/task/gstreamer.py
@@ -126,6 +126,17 @@ class GstPipelineTask(task.Task):
def stop(self):
self.debug('stopping')
+
+ # FIXME: in theory this should help clean up properly,
+ # but in practice we can still get
+ # python: /builddir/build/BUILD/Python-2.7/Python/pystate.c:595: PyGILState_Ensure: Assertion `autoInterpreterState' failed.
+
+ self.pipeline.set_state(self.gst.STATE_READY)
+ self.debug('set pipeline to READY')
+ # FIXME: this can block
+ ret = self.pipeline.get_state()
+ self.debug('got pipeline to READY: %r', ret)
+
self.debug('setting state to NULL')
self.pipeline.set_state(self.gst.STATE_NULL)
self.debug('set state to NULL')
diff --git a/morituri/extern/task/task.py b/morituri/extern/task/task.py
index 0263f0e..21fcbe5 100644
--- a/morituri/extern/task/task.py
+++ b/morituri/extern/task/task.py
@@ -38,7 +38,7 @@ class TaskException(Exception):
self.exceptionMessage = message
self.args = (exception, message, )
-class Task(object, log.Loggable):
+class Task(object):
"""
I wrap a task in an asynchronous interface.
I can be listened to for starting, stopping, description changes
@@ -67,6 +67,19 @@ class Task(object, log.Loggable):
_listeners = None
+ ### log stubs
+ def warning(self, message, *args):
+ pass
+
+ def info(self, message, *args):
+ pass
+
+ def debug(self, message, *args):
+ pass
+
+ def log(self, message, *args):
+ pass
+
### subclass methods
def start(self, runner):
"""
@@ -90,6 +103,7 @@ class Task(object, log.Loggable):
def stop(self):
"""
Stop the task.
+ Also resets the runner on the task.
Subclasses should chain up to me at the end.
--
morituri packaging
More information about the pkg-multimedia-commits
mailing list