Package flumotion :: Package component :: Package consumers :: Package shout2 :: Module shout2
[hide private]

Source Code for Module flumotion.component.consumers.shout2.shout2

 1  # -*- Mode: Python -*- 
 2  # vi:si:et:sw=4:sts=4:ts=4 
 3  # 
 4  # flumotion/component/consumers/shout2/shout2.py: stream to icecast2 
 5  # 
 6  # Flumotion - a streaming media server 
 7  # Copyright (C) 2005,2007 Fluendo, S.L. (www.fluendo.com). All rights reserved. 
 8   
 9  # This file may be distributed and/or modified under the terms of 
10  # the GNU General Public License version 2 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.GPL" in the source distribution for more information. 
15   
16  # Licensees having purchased or holding a valid Flumotion Advanced 
17  # Streaming Server license may use this file in accordance with the 
18  # Flumotion Advanced Streaming Server Commercial License Agreement. 
19  # See "LICENSE.Flumotion" in the source distribution for more information. 
20   
21  # Headers in this file shall remain intact. 
22   
23  from flumotion.component import feedcomponent 
24   
25  __version__ = "$Rev: 6550 $" 
26   
27   
28 -class Shout2Consumer(feedcomponent.ParseLaunchComponent):
29 - def get_pipeline_string(self, properties):
30 pipestr = 'shout2send name=shout2-streamer sync=1 protocol=3' 31 32 elprops = (('mount-point', 'mount'), 33 ('port', 'port'), 34 ('ip', 'ip'), 35 ('password', 'password'), 36 ('description', 'description'), 37 ('url', 'url'), 38 ('short-name', 'streamname')) 39 for k, v in elprops: 40 if k in properties: 41 # mind the gap, quote the values 42 pipestr += ' %s="%s"' % (v, properties[k]) 43 44 return pipestr
45
46 - def configure_pipeline(self, pipeline, properties):
47 def _connection_problem(self, error): 48 # apparently error is an int 49 self.warning('Connection problem: %r', error)
50 51 element = pipeline.get_by_name('shout2-streamer') 52 element.connect('connection-problem', _connection_problem)
53