[pitivi: 5/14] application: render: Catch errors while rendering
- From: Edward Hervey <edwardrv src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pitivi: 5/14] application: render: Catch errors while rendering
- Date: Mon, 20 Sep 2010 09:44:04 +0000 (UTC)
commit be53a967954d4a32246b0b76ce4b8da6b7b56ace
Author: Robert Swain <robert swain collabora co uk>
Date: Fri Aug 20 17:43:33 2010 +0200
application: render: Catch errors while rendering
This shuts down pitivi when running from the command line to render a project.
pitivi/application.py | 2 ++
pitivi/render.py | 15 ++++++++++++++-
2 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/pitivi/application.py b/pitivi/application.py
index 0cb482d..6700e25 100644
--- a/pitivi/application.py
+++ b/pitivi/application.py
@@ -249,6 +249,8 @@ When -r is specified, the given project file is rendered without opening the GUI
# create renderer and set output file
self.renderer = Renderer(self.current, pipeline=None, outfile=self.output_file)
self.renderer.connect("eos", self._eosCb)
+ # on error, all we need to do is shutdown which is the same as we do for EOS
+ self.renderer.connect("error", self._eosCb)
# configure the renderer and start rendering!
self.renderer.startRender()
diff --git a/pitivi/render.py b/pitivi/render.py
index 468eb5f..6c752fe 100644
--- a/pitivi/render.py
+++ b/pitivi/render.py
@@ -40,7 +40,8 @@ class Renderer(Loggable, Signallable):
""" Rendering helper methods """
__signals__ = {
- "eos" : None
+ "eos" : None,
+ "error" : None
}
def __init__(self, project, pipeline=None, outfile=None):
@@ -88,6 +89,16 @@ class Renderer(Loggable, Signallable):
def updateUIOnEOS(self):
pass
+ def _errorCb(self, pipeline, error, detail):
+ self.debug("error !")
+ self.rendering = False
+ self.updateUIOnError()
+ self.removeRecordAction()
+ self.emit("error")
+
+ def updateUIOnError(self):
+ pass
+
def _positionCb(self, unused_pipeline, position):
self.debug("%r %r", unused_pipeline, position)
fraction = None
@@ -115,6 +126,7 @@ class Renderer(Loggable, Signallable):
if self.renderaction == None:
self.pipeline.connect('position', self._positionCb)
self.pipeline.connect('eos', self._eosCb)
+ self.pipeline.connect('error', self._errorCb)
self.debug("Setting pipeline to STOP")
self.pipeline.stop()
settings = export_settings_to_render_settings(self.settings,
@@ -155,6 +167,7 @@ class Renderer(Loggable, Signallable):
self.pipeline.pause()
self.pipeline.disconnect_by_function(self._positionCb)
self.pipeline.disconnect_by_function(self._eosCb)
+ self.pipeline.disconnect_by_function(self._errorCb)
self.renderaction = None
def startRender(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]