zaheer - in flumotion/trunk: . flumotion/component/combiners/switch

flumotion-commit at lists.fluendo.com flumotion-commit at lists.fluendo.com
Mon Jul 2 13:43:59 CEST 2007


Author: zaheer
Date: Mon Jul  2 13:43:55 2007
New Revision: 5280

Modified:
   flumotion/trunk/ChangeLog
   flumotion/trunk/flumotion/component/combiners/switch/patternswitch.py
   flumotion/trunk/flumotion/component/combiners/switch/switch.py
Log:
	* flumotion/component/combiners/switch/patternswitch.py
	  (PatternEventSwitcher, PatternEventSwitcher.do_check,
	  PatternEventSwitcher.checkConfig,
	  PatternEventSwitcher.configure_pipeline):
	Get the pad as the value stored is a string not a pad!
	Validate the eater-with-stream-markers property value passed
	in.
	* flumotion/component/combiners/switch/switch.py
	  (Switch.switch_to_for_event):
	Fix some stupid logic.



Modified: flumotion/trunk/ChangeLog
==============================================================================
--- flumotion/trunk/ChangeLog	(original)
+++ flumotion/trunk/ChangeLog	Mon Jul  2 13:43:55 2007
@@ -1,5 +1,18 @@
 2007-07-02  Zaheer Abbas Merali  <zaheerabbas at merali dot org>
 
+	* flumotion/component/combiners/switch/patternswitch.py
+	  (PatternEventSwitcher, PatternEventSwitcher.do_check,
+	  PatternEventSwitcher.checkConfig,
+	  PatternEventSwitcher.configure_pipeline):
+	Get the pad as the value stored is a string not a pad!
+	Validate the eater-with-stream-markers property value passed
+	in.
+	* flumotion/component/combiners/switch/switch.py
+	  (Switch.switch_to_for_event):
+	Fix some stupid logic.
+
+2007-07-02  Zaheer Abbas Merali  <zaheerabbas at merali dot org>
+
 	* flumotion/component/combiners/switch/Makefile.am:
 	* flumotion/component/combiners/switch/patternswitch.py
 	  (PatternEventSwitcher, PatternEventSwitcher.configure_pipeline,

Modified: flumotion/trunk/flumotion/component/combiners/switch/patternswitch.py
==============================================================================
--- flumotion/trunk/flumotion/component/combiners/switch/patternswitch.py	(original)
+++ flumotion/trunk/flumotion/component/combiners/switch/patternswitch.py	Mon Jul  2 13:43:55 2007
@@ -20,21 +20,40 @@
 # Headers in this file shall remain intact.
 
 from flumotion.component import feedcomponent
-from flumotion.common import errors
+from flumotion.common import errors, messages
 
 from flumotion.component.combiners.switch import basicwatchdog
 import gst
 
+from flumotion.common.messages import N_
+T_ = messages.gettexter('flumotion')
+
 class PatternEventSwitcher(basicwatchdog.AVBasicWatchdog):
     logCategory = "comb-av-pattern-switcher"
 
+    def do_check(self):
+        d = basicwatchdog.AVBasicWatchdog.do_check(self)
+        def checkConfig(result):
+            props = self.config['properties']
+            eaterName = props.get('eater-with-stream-markers', None)
+            if eaterName != 'video-master' and eaterName != 'video-backup':
+                warnStr = "The value provided for the " \
+                    "eater-with-stream-markers property " \
+                    "must be one of video-backup, video-master."
+                self.warning(warnStr)
+                self.addMessage(messages.Error(T_(N_(warnstr)), 
+                    id="eater-with-stream-markers-wrong"))
+            return result
+        d.addCallback(checkConfig)
+        return d
+
     def configure_pipeline(self, pipeline, properties):
         basicwatchdog.AVBasicWatchdog.configure_pipeline(self, pipeline, 
             properties)
         # set event probe to react to video mark events
         eaterName = properties.get('eater-with-stream-markers', 
             'video-backup')
-        sinkpad = self.switchPads[eaterName]
+        sinkpad = self.videoSwitchElement.get_pad(self.switchPads[eaterName])
         sinkpad.add_event_probe(self._markers_event_probe)
 
     def _markers_event_probe(self, element, event):

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	Mon Jul  2 13:43:55 2007
@@ -140,13 +140,13 @@
         @param eaterSubstring: either "master" or "backup"
         @param startOrStop: True if start of event, False if stop
         """
-        if eaterSubstring != "master" or eaterSubstring != "backup":
+        if eaterSubstring != "master" and eaterSubstring != "backup":
             self.warning("switch_to_for_event should be called with 'master'"
                 " or 'backup'")
             return
         self._idealEater = eaterSubstring
         res = self.switch_to(eaterSubstring)
-        if not res:
+        if res == False:
             startOrStopStr = "stopped"
             if startOrStop:
                 startOrStopStr = "started"


More information about the flumotion-commit mailing list