zaheer - in flumotion/trunk: . flumotion/component flumotion/test flumotion/wizard

flumotion-commit at lists.fluendo.com flumotion-commit at lists.fluendo.com
Wed May 9 13:29:23 CEST 2007


Author: zaheer
Date: Wed May  9 13:29:17 2007
New Revision: 4905

Modified:
   flumotion/trunk/ChangeLog
   flumotion/trunk/flumotion/component/feedcomponent.py
   flumotion/trunk/flumotion/component/feedcomponent010.py
   flumotion/trunk/flumotion/test/test_component.py
   flumotion/trunk/flumotion/test/test_component_httpstreamer.py
   flumotion/trunk/flumotion/wizard/save.py
Log:
	* flumotion/component/feedcomponent.py
	  (MultiInputParseLaunchComponent.get_pipeline_string):
	* flumotion/component/feedcomponent010.py (FeedComponent.init,
	  FeedComponent.do_setup, FeedComponent.parseEaterConfig):
	Use the eater key not the source key for building up the
	eaters list. Build a mapping for feedId -> name of eater so
	we can quickly look it up in elements needing to find the eater
	name that a feedId (hence eater's element name) corresponds to.
	* flumotion/test/test_component.py (PipelineTest.__init__,
	  PipelineTest.config):
	* flumotion/test/test_component_httpstreamer.py
	  (TestOldProperties.setUp):
	Fix up tests to use eater key not source key.
	* flumotion/wizard/save.py (Component.toXML):
	Output non-deprecated config form for wizard.



Modified: flumotion/trunk/ChangeLog
==============================================================================
--- flumotion/trunk/ChangeLog	(original)
+++ flumotion/trunk/ChangeLog	Wed May  9 13:29:17 2007
@@ -1,3 +1,21 @@
+2007-05-09  Zaheer Abbas Merali  <<zaheerabbas at merali dot org>>
+
+	* flumotion/component/feedcomponent.py
+	  (MultiInputParseLaunchComponent.get_pipeline_string):
+	* flumotion/component/feedcomponent010.py (FeedComponent.init,
+	  FeedComponent.do_setup, FeedComponent.parseEaterConfig):
+	Use the eater key not the source key for building up the
+	eaters list. Build a mapping for feedId -> name of eater so
+	we can quickly look it up in elements needing to find the eater
+	name that a feedId (hence eater's element name) corresponds to.
+	* flumotion/test/test_component.py (PipelineTest.__init__,
+	  PipelineTest.config):
+	* flumotion/test/test_component_httpstreamer.py
+	  (TestOldProperties.setUp):
+	Fix up tests to use eater key not source key.
+	* flumotion/wizard/save.py (Component.toXML):
+	Output non-deprecated config form for wizard.
+
 2007-05-09  Michael Smith <msmith at fluendo.com>
 
 	* flumotion/component/producers/playlist/Makefile.am:

Modified: flumotion/trunk/flumotion/component/feedcomponent.py
==============================================================================
--- flumotion/trunk/flumotion/component/feedcomponent.py	(original)
+++ flumotion/trunk/flumotion/component/feedcomponent.py	Wed May  9 13:29:17 2007
@@ -549,12 +549,13 @@
             self.QUEUE_SIZE_BUFFERS)
 
     def get_pipeline_string(self, properties):
-        sources = self.config['source']
+        eaters = self.config['eater']
 
         pipeline = self.get_muxer_string(properties) + ' '
-        for eater in sources:
-            tmpl = '@ eater:%s @ ! muxer. '
-            pipeline += tmpl % eater
+        for e in eaters:
+            for feed in eaters[e]:
+                tmpl = '@ eater:%s @ ! muxer. '
+                pipeline += tmpl % feed
 
         pipeline += 'muxer.'
 

Modified: flumotion/trunk/flumotion/component/feedcomponent010.py
==============================================================================
--- flumotion/trunk/flumotion/component/feedcomponent010.py	(original)
+++ flumotion/trunk/flumotion/component/feedcomponent010.py	Wed May  9 13:29:17 2007
@@ -368,7 +368,6 @@
         # add extra keys to state
         self.state.addKey('eaterNames') # feedId of eaters
         self.state.addKey('feederNames') # feedId of feeders
-
         # add keys for eaters and feeders uiState
         self._feeders = {} # feeder feedId -> Feeder
         self._eaters = {} # eater feedId -> Eater
@@ -401,6 +400,8 @@
         self._stateChangeDeferreds = {}
 
         self._gotFirstNewSegment = {}
+        # feedId of eater -> eater name as specified in config
+        self._eaterMapping = {}
 
         # multifdsink's get-stats signal had critical bugs before this version
         tcppluginversion = gstreamer.get_plugin_version('tcp')
@@ -428,7 +429,7 @@
         Invokes the L{create_pipeline} and L{set_pipeline} vmethods,
         which subclasses can provide.
         """
-        eater_config = self.config.get('source', [])
+        eater_config = self.config.get('eater', {})
         feeder_config = self.config.get('feed', [])
 
         self.debug("FeedComponent.do_setup(): eater_config %r" % eater_config)
@@ -558,16 +559,20 @@
 
     def parseEaterConfig(self, eater_config):
         # the source feeder names come from the config
-        # they are specified under <component> as <source> elements in XML
+        # they are specified under <eater> as <feed> elements in XML
         # so if they don't specify a feed name, use "default" as the feed name
-        eater_names = []
-        for block in eater_config:
-            eater_name = block
-            if block.find(':') == -1:
-                eater_name = block + ':default'
-            eater_names.append(eater_name)
-        self.debug('parsed eater config, eater feedIds %r' % eater_names)
-        self.eater_names = eater_names
+        # there is also a deprecated way by specifying them under <component>
+        # as <source> elements in XML
+        feed_ids = []
+        for eater in eater_config:
+            for feed in eater_config[eater]:
+                feed_id = feed
+                if feed.find(':') == -1:
+                    feed_id = feed + ':default'
+                feed_ids.append(feed_id)
+                self._eaterMapping[feed_id] = eater
+        self.debug('parsed eater config, eater feedIds %r' % feed_ids)
+        self.eater_names = feed_ids
         self.state.set('eaterNames', self.eater_names)
             
     def parseFeederConfig(self, feeder_config):

Modified: flumotion/trunk/flumotion/test/test_component.py
==============================================================================
--- flumotion/trunk/flumotion/test/test_component.py	(original)
+++ flumotion/trunk/flumotion/test/test_component.py	Wed May  9 13:29:17 2007
@@ -37,14 +37,17 @@
 class PipelineTest(ParseLaunchComponent):
     def __init__(self, eaters=None, feeders=None, pipeline='test-pipeline'):
         self.__pipeline = pipeline
-        self._source = eaters or []
+        if eaters:
+            self._eater = {'default':eaters}
+        else:
+            self._eater = {}
         self._feed = feeders or []
 
         ParseLaunchComponent.__init__(self)
 
     def config(self):
         config = {'name': 'fake',
-                  'source': self._source,
+                  'eater': self._eater,
                   'feed': self._feed,
                   'plugs': {},
                   'properties': {}}

Modified: flumotion/trunk/flumotion/test/test_component_httpstreamer.py
==============================================================================
--- flumotion/trunk/flumotion/test/test_component_httpstreamer.py	(original)
+++ flumotion/trunk/flumotion/test/test_component_httpstreamer.py	Wed May  9 13:29:17 2007
@@ -44,7 +44,7 @@
             'feed': [],
             'name': 'http-video',
             'parent': 'default',
-            'source': ['muxer-video'],
+            'eater': {'default': ['muxer-video']},
             'avatarId': '/default/http-video',
             'clock-master': None,
             'plugs': {

Modified: flumotion/trunk/flumotion/wizard/save.py
==============================================================================
--- flumotion/trunk/flumotion/wizard/save.py	(original)
+++ flumotion/trunk/flumotion/wizard/save.py	Wed May  9 13:29:17 2007
@@ -78,9 +78,10 @@
         s = '    <component name="%s" type="%s" ' \
             'project="flumotion" version="%s"%s>\n' % (
             self.name, self.type, configure.version, extra)
-
+        s += '     <eater name="default">\n'
         for sourceName in self.getFeeders():
-            s += "      <source>%s</source>\n" % sourceName
+            s += "      <feed>%s</feed>\n" % sourceName
+        s+= '      </eater>\n'
                     
         if self.props:
             s += "\n"


More information about the flumotion-commit mailing list