Trees | Indices | Help |
---|
|
1 # -*- Mode: Python -*- 2 # vi:si:et:sw=4:sts=4:ts=4 3 4 # Flumotion - a streaming media server 5 # Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L. 6 # Copyright (C) 2010,2011 Flumotion Services, S.A. 7 # All rights reserved. 8 # 9 # This file may be distributed and/or modified under the terms of 10 # the GNU Lesser General Public License version 2.1 as published by 11 # the Free Software Foundation. 12 # This file is distributed without any warranty; without even the implied 13 # warranty of merchantability or fitness for a particular purpose. 14 # See "LICENSE.LGPL" in the source distribution for more information. 15 # 16 # Headers in this file shall remain intact. 17 18 from flumotion.component import feedcomponent 19 from flumotion.common import errors 20 21 from flumotion.component.combiners.switch import switch 22 23 __version__ = "$Rev$" 24 25 26 # These basic watchdog components switch to backup 27 # when the master eater(s) have gone hungry 28 2931 logCategory = "comb-single-basic-watchdog" 3263 6434 switch.SingleSwitch.init(self) 35 # startedFine is set to True when all sink pads to all switch elements 36 # have received data 37 self.startedFine = False 38 self._started = []3941 switch.SingleSwitch.feedSetInactive(self, feed) 42 if self.startedFine: 43 self.auto_switch() 44 else: 45 if feed in self._started: 46 self._started.remove(feed)4749 switch.SingleSwitch.feedSetActive(self, feed) 50 if self.startedFine: 51 self.auto_switch() 52 else: 53 self._started.append(feed) 54 allStarted = True 55 # check if all feeds started 56 for lf in self.logicalFeeds: 57 if lf not in self._started: 58 allStarted = False 59 break 60 if allStarted: 61 self.startedFine = True 62 self._started = []66 logCategory = "comb-av-basic-watchdog" 679869 switch.AVSwitch.init(self) 70 # startedFine is set to True when all sink pads to all switch elements 71 # have received data 72 self.startedFine = False 73 self._started = []7476 switch.AVSwitch.feedSetInactive(self, feed) 77 if self.startedFine: 78 self.auto_switch() 79 else: 80 if feed in self._started: 81 self._started.remove(feed)8284 switch.AVSwitch.feedSetActive(self, feed) 85 if self.startedFine: 86 self.auto_switch() 87 else: 88 self._started.append(feed) 89 allStarted = True 90 # check if all feeds started 91 for lf in self.logicalFeeds: 92 if lf not in self._started: 93 allStarted = False 94 break 95 if allStarted: 96 self.startedFine = True 97 self._started = []
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Tue Aug 13 06:17:31 2013 | http://epydoc.sourceforge.net |