zaheer - in flumotion/branches/eaters-info-1: . flumotion/component

flumotion-commit at lists.fluendo.com flumotion-commit at lists.fluendo.com
Thu Mar 8 19:14:12 CET 2007


Author: zaheer
Date: Thu Mar  8 19:14:10 2007
New Revision: 4606

Modified:
   flumotion/branches/eaters-info-1/ChangeLog
   flumotion/branches/eaters-info-1/flumotion/component/feedcomponent010.py
Log:
2007-03-08  Zaheer Abbas Merali  <zaheerabbas at merali dot org>

        * flumotion/component/feedcomponent010.py:
        Add eater class and uiState for eaters.  Does not yet fill it.



Modified: flumotion/branches/eaters-info-1/ChangeLog
==============================================================================
--- flumotion/branches/eaters-info-1/ChangeLog	(original)
+++ flumotion/branches/eaters-info-1/ChangeLog	Thu Mar  8 19:14:10 2007
@@ -1,6 +1,11 @@
 2007-03-08  Zaheer Abbas Merali  <zaheerabbas at merali dot org>
 
 	* flumotion/component/feedcomponent010.py:
+	Add eater class and uiState for eaters.  Does not yet fill it.
+
+2007-03-08  Zaheer Abbas Merali  <zaheerabbas at merali dot org>
+
+	* flumotion/component/feedcomponent010.py:
 	Duh, identity needs to be in the DEPAY_TMPL after the depayloader!
 
 2007-03-08  Zaheer Abbas Merali  <zaheerabbas at merali dot org>

Modified: flumotion/branches/eaters-info-1/flumotion/component/feedcomponent010.py
==============================================================================
--- flumotion/branches/eaters-info-1/flumotion/component/feedcomponent010.py	(original)
+++ flumotion/branches/eaters-info-1/flumotion/component/feedcomponent010.py	Thu Mar  8 19:14:10 2007
@@ -205,6 +205,30 @@
                 self.uiState.set('buffersDroppedCurrent', 0)
         reactor.callFromThread(updateUIState)
 
+class Eater:
+    """
+    This class groups eater-related information as used by a Feed Component.
+
+    @ivar eaterId:  id of the feed this is eating from
+    @ivar uiState: the serializable UI State for this eater
+    """
+    def __init__(self, eaterId):
+        self.eaterId = eaterId
+        self.uiState = componentui.WorkerComponentUIState()
+        self.uiState.addKey('eaterId')
+        self.uiState.set('eaterId', eaterId)
+        connectionDict = { "lastDiscontinuity":None,
+            "lastTimeDifference":None,
+            "lastSizeDifference":None,
+            "totalTimeDifference":None,
+            "totalSizeDifference":None,
+            "numDiscontinuities":None }
+        self.uiState.addDictKey('connection', connectionDict)
+        self.uiState.addKey('connectionsMade')
+        self.uiState.addKey('numDiscontinuities')
+        self.uiState.addKey('totalSizeDiscontinuity')
+        self.uiState.addKey('totalTimeDiscontinuity')
+
 class FeedComponent(basecomponent.BaseComponent):
     """
     I am a base class for all Flumotion feed components.
@@ -238,7 +262,9 @@
 
         # add keys for uiState
         self._feeders = {}
+        self._eaters = {}
         self.uiState.addListKey('feeders')
+        self.uiState.addListKey('eaters')
 
         self.pipeline = None
         self.pipeline_signals = []
@@ -295,7 +321,8 @@
                 'checkEaterDC': None
             }
             self._eaterStatus[name] = d
-
+            self._eaters[name] = Eater(name)
+            self.uiState.append('eaters', self._eaters[name].uiState)
             self._eaterReconnectDC['eater:' + name] = None
 
         # this sets self.feeder_names
@@ -533,6 +560,16 @@
                 self.eaterSetInactive(feedId)
                 # start reconnection
                 self._reconnectEater(feedId)
+        elif t == gst.MESSAGE_ELEMENT:
+            if message.structure.get_name() == 'imperfect':
+                self.log("we have an imperfect stream from %s" % src.get_name())
+                # figure out the discontinuity
+                s = message.structure
+                timediscont = s["cur-timestamp"] - \
+                    (s["prev-timestamp"] + s["prev-duration"])
+                sizediscont = s["cur-offset"] - s["prev-offset-end"]
+                self.log("we have a discont of time: %d and size: %d" % (
+                    timediscont, sizediscont))
         else:
             self.log('message received: %r' % message)
 
@@ -551,7 +588,6 @@
         bus = self.pipeline.get_bus()
         bus.add_signal_watch()
         self.bus_watch_id = bus.connect('message', self.bus_watch_func)
-
         sig_id = self.pipeline.connect('deep-notify',
                                        gstreamer.verbose_deep_notify_cb, self)
         self.pipeline_signals.append(sig_id)


More information about the flumotion-commit mailing list