wingo - in flumotion/trunk: . flumotion/admin/gtk flumotion/common flumotion/component flumotion/component/combiners/switch

flumotion-commit at lists.fluendo.com flumotion-commit at lists.fluendo.com
Tue Dec 4 16:13:22 CET 2007


Author: wingo
Date: Tue Dec  4 16:13:14 2007
New Revision: 5966

Modified:
   flumotion/trunk/ChangeLog
   flumotion/trunk/flumotion/admin/gtk/client.py
   flumotion/trunk/flumotion/admin/gtk/parts.py
   flumotion/trunk/flumotion/common/gstreamer.py
   flumotion/trunk/flumotion/component/combiners/switch/switch.py
   flumotion/trunk/flumotion/component/feedcomponent.py
Log:
2007-12-04  Andy Wingo  <wingo at pobox.com>

	* flumotion/admin/gtk/client.py (Window._component_kill): 
	* flumotion/admin/gtk/parts.py (ComponentMenu.__init__): Add "kill
	job" to component right-click menu.

	* flumotion/component/feedcomponent.py
	(MultiInputParseLaunchComponent.get_pipeline_string): Put the
	muxer string at the end so that even if there are elements after
	the muxer element, a default ! @feeder:default@ will work.

	* flumotion/component/combiners/switch/switch.py
	(Switch.do_setup, Switch.create_pipeline): Fix some bugaboos.
	(Switch.configure_pipeline.getDownstreamElement): Element.pads is
	a function, not an attribute. Ghetto!
	(Switch.try_switch.set_switching): Return True on success.
	(Switch.try_switch.set_stop_time): Only update stop-value when it
	is not CLOCK_TIME_NONE.
	(Switch.try_switch.switch): Hrm, turns out active-pad is a string
	property, not an object property. Whoops!

	* flumotion/common/gstreamer.py (verbose_deep_notify_cb): %r
	instead of %s.

Modified: flumotion/trunk/ChangeLog
==============================================================================
--- flumotion/trunk/ChangeLog	(original)
+++ flumotion/trunk/ChangeLog	Tue Dec  4 16:13:14 2007
@@ -1,3 +1,27 @@
+2007-12-04  Andy Wingo  <wingo at pobox.com>
+
+	* flumotion/admin/gtk/client.py (Window._component_kill): 
+	* flumotion/admin/gtk/parts.py (ComponentMenu.__init__): Add "kill
+	job" to component right-click menu.
+
+	* flumotion/component/feedcomponent.py
+	(MultiInputParseLaunchComponent.get_pipeline_string): Put the
+	muxer string at the end so that even if there are elements after
+	the muxer element, a default ! @feeder:default@ will work.
+
+	* flumotion/component/combiners/switch/switch.py
+	(Switch.do_setup, Switch.create_pipeline): Fix some bugaboos.
+	(Switch.configure_pipeline.getDownstreamElement): Element.pads is
+	a function, not an attribute. Ghetto!
+	(Switch.try_switch.set_switching): Return True on success.
+	(Switch.try_switch.set_stop_time): Only update stop-value when it
+	is not CLOCK_TIME_NONE.
+	(Switch.try_switch.switch): Hrm, turns out active-pad is a string
+	property, not an object property. Whoops!
+
+	* flumotion/common/gstreamer.py (verbose_deep_notify_cb): %r
+	instead of %s.
+
 2007-12-04  Michael Smith <msmith at fluendo.com>
 
 	* flumotion/__init__.py:
@@ -368,7 +392,6 @@
 	    - add __version__ = "$Rev$"
 	    - set svn:keywords to substitute $Rev$
 
-
 2007-12-04  Johan Dahlin  <johan at gnome.org>
 
 	Revert commit:

Modified: flumotion/trunk/flumotion/admin/gtk/client.py
==============================================================================
--- flumotion/trunk/flumotion/admin/gtk/client.py	(original)
+++ flumotion/trunk/flumotion/admin/gtk/client.py	Tue Dec  4 16:13:14 2007
@@ -39,7 +39,7 @@
 from flumotion.admin.gtk import connections as gtkconnections
 from flumotion.configure import configure
 from flumotion.common import errors, log, planet, pygobject
-from flumotion.common import connection
+from flumotion.common import connection, common
 from flumotion.manager import admin # Register types
 from flumotion.twisted import flavors, pb as fpb
 from flumotion.ui import trayicon
@@ -610,6 +610,13 @@
         return self._component_do(state, '', 'Deleting', 'Deleted',
             'deleteComponent')
 
+    def _component_kill(self, state):
+        workerName = state.get('workerRequested')
+        avatarId = common.componentId(state.get('parent').get('name'),
+                                      state.get('name'))
+        self._admin.callRemote('workerCallRemote', workerName, 'killJob',
+                               avatarId)
+
     def _component_do(self, state, action, doing, done,
         remoteMethodPrefix="component"):
         """

Modified: flumotion/trunk/flumotion/admin/gtk/parts.py
==============================================================================
--- flumotion/trunk/flumotion/admin/gtk/parts.py	(original)
+++ flumotion/trunk/flumotion/admin/gtk/parts.py	Tue Dec  4 16:13:14 2007
@@ -444,6 +444,10 @@
         self.append(i)
         self._items['modify'] = i
 
+        i = gtk.MenuItem(_('_Kill job'))
+        self.append(i)
+        self._items['kill'] = i
+
         # connect callback
         for name in self._items.keys():
             i = self._items[name]

Modified: flumotion/trunk/flumotion/common/gstreamer.py
==============================================================================
--- flumotion/trunk/flumotion/common/gstreamer.py	(original)
+++ flumotion/trunk/flumotion/common/gstreamer.py	Tue Dec  4 16:13:14 2007
@@ -65,7 +65,7 @@
     if pspec.name == 'caps' and output == 'None':
         return
 
-    component.debug('%s: %s = %s' % (orig.get_path_string(), pspec.name, output))
+    component.debug('%s: %s = %r', orig.get_path_string(), pspec.name, output)
 
 def element_factory_has_property(element_factory, property_name):
     """

Modified: flumotion/trunk/flumotion/component/combiners/switch/switch.py
==============================================================================
--- flumotion/trunk/flumotion/component/combiners/switch/switch.py	(original)
+++ flumotion/trunk/flumotion/component/combiners/switch/switch.py	Tue Dec  4 16:13:14 2007
@@ -178,9 +178,9 @@
         return d
 
     def do_setup(self):
-        icalFileName = self.config['properties']['ical-schedule']
-        if icalFileName:
-            args = {'properties': {'ical-schedule': icalFileName}}
+        ical = self.config['properties'].get('ical-schedule', None)
+        if ical:
+            args = {'properties': {'ical-schedule': ical}}
             self.icalScheduler = ICalSwitchPlug(args)
             self.icalScheduler.start(self)
 
@@ -193,7 +193,7 @@
             if self.idealFeed is None:
                 self.idealFeed = name
 
-        return feedcomponent.MultiInputParseLaunchComponent.create_pipeline()
+        return feedcomponent.MultiInputParseLaunchComponent.create_pipeline(self)
 
     def get_logical_feeds(self):
         raise errors.NotImplementedError('subclasses should implement '
@@ -201,7 +201,7 @@
 
     def configure_pipeline(self, pipeline, properties):
         def getDownstreamElement(e):
-            for pad in e.pads:
+            for pad in e.pads():
                 if pad.get_direction() is gst.PAD_SRC:
                     peer = pad.get_peer()
                     return peer, peer.get_parent()
@@ -300,6 +300,7 @@
                 self.warning('something went terribly wrong')
                 # fall thru
             self._switching = switching
+            return True
 
         def set_blocked(blocked):
             for pad, e in switchPads:
@@ -308,17 +309,19 @@
         def set_stop_time():
             times = [e.get_property('last-timestamp')
                      for pad, e in switchPads]
+            stop_time = max(times)
 
-            self.debug('last time = %u', max(times))
-            for pad, e in switchPads:
-                e.set_property('stop-value', max(times))
-
-            diff = max(times) - min(times)
-            if diff > gst.SECOND * 10:
-                fmt = N_("When switching to %s, feed timestamps out of"
-                         " sync by %u")
-                self.addWarning('large-timestamp-difference', fmt, feed,
-                                diff, priority=40)
+            if stop_time != gst.CLOCK_TIME_NONE:
+                self.debug('stop time = %u', stop_time)
+                for pad, e in switchPads:
+                    e.set_property('stop-value', stop_time)
+
+                diff = max(times) - min(times)
+                if diff > gst.SECOND * 10:
+                    fmt = N_("When switching to %s, feed timestamps out"
+                             " of sync by %u")
+                    self.addWarning('large-timestamp-difference', fmt,
+                                    feed, diff, priority=40)
 
         def set_queueing(queueing, start_time=None):
             for pad, e in switchPads:
@@ -328,7 +331,7 @@
 
         def switch():
             for pad, e in switchPads:
-                e.set_property('active-pad', pad)
+                e.set_property('active-pad', pad.get_name())
             self.activeFeed = feed
             self.uiState.set("active-eater", feed)
 
@@ -337,7 +340,6 @@
                 [pad for pad, e in switchPads],
                 lambda pad, buffer: buffer.timestamp)
 
-
         feed = self.idealFeed
 
         if feed == self.activeFeed:

Modified: flumotion/trunk/flumotion/component/feedcomponent.py
==============================================================================
--- flumotion/trunk/flumotion/component/feedcomponent.py	(original)
+++ flumotion/trunk/flumotion/component/feedcomponent.py	Tue Dec  4 16:13:14 2007
@@ -533,12 +533,12 @@
                 feeds.append(feed)
             eaters = { 'default': [(x, 'default') for x in feeds] }
 
-        pipeline = self.get_muxer_string(properties) + ' '
+        pipeline = ''
         for e in eaters:
             for feed, alias in eaters[e]:
                 pipeline += '@ eater:%s @ ! muxer. ' % alias
 
-        pipeline += 'muxer.'
+        pipeline += self.get_muxer_string(properties) + ' '
 
         return pipeline
 


More information about the flumotion-commit mailing list