1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 from flumotion.common import gstreamer, messages, errors
19 from flumotion.common.i18n import N_, gettexter
20 from flumotion.component import feedcomponent
21
22 T_ = gettexter()
23 __version__ = "$Rev$"
24
25
26 -class Repeater(feedcomponent.ParseLaunchComponent):
27
29 dp = ""
30 if 'drop-probability' in properties:
31 vt = gstreamer.get_plugin_version('coreelements')
32 if not vt:
33 raise errors.MissingElementError('identity')
34 if not vt > (0, 10, 12, 0):
35 self.addMessage(
36 messages.Warning(T_(N_(
37 "The 'drop-probability' property is specified, but "
38 "it only works with GStreamer core newer than 0.10.12."
39 " You should update your version of GStreamer."))))
40 else:
41 drop_probability = properties['drop-probability']
42 if drop_probability < 0.0 or drop_probability > 1.0:
43 self.addMessage(
44 messages.Warning(T_(N_(
45 "The 'drop-probability' property can only be "
46 "between 0.0 and 1.0."))))
47 else:
48 dp = " drop-probability=%f" % drop_probability
49
50 return 'identity silent=true %s' % dp
51