示例#1
0
class TestNameConflicts(testsuite.TestCase):

    def setUp(self):
        self.save = AssistantSaver()

    def _addServer(self, name):
        server = HTTPServer('ondemand-server-worker', '/mount-point/')
        self.save.addServerConsumer(server, name)

    def testNameConflicts(self):
        self.save.setExistingComponentNames(['http-server-ondemand'])
        self._addServer('ondemand')
        self.save.getXML()

        components = self.save.getAtmosphereComponents()
        self.assertEquals(components[0].name, 'http-server-ondemand2')

    def testNameConflictsDoubleDigits(self):
        componentNames = ['http-server-ondemand'] + [
            'http-server-ondemand%d' % i for i in range(2, 10)]
        self.save.setExistingComponentNames(componentNames)
        self._addServer('ondemand')
        self.save.getXML()

        components = self.save.getAtmosphereComponents()
        self.assertEquals(components[0].name, 'http-server-ondemand10')
示例#2
0
class TestNameConflicts(testsuite.TestCase):
    def setUp(self):
        self.save = AssistantSaver()

    def _addServer(self, name):
        server = HTTPServer('ondemand-server-worker', '/mount-point/')
        self.save.addServerConsumer(server, name)

    def testNameConflicts(self):
        self.save.setExistingComponentNames(['http-server-ondemand'])
        self._addServer('ondemand')
        self.save.getXML()

        components = self.save.getAtmosphereComponents()
        self.assertEquals(components[0].name, 'http-server-ondemand2')

    def testNameConflictsDoubleDigits(self):
        componentNames = ['http-server-ondemand'] + [
            'http-server-ondemand%d' % i for i in range(2, 10)
        ]
        self.save.setExistingComponentNames(componentNames)
        self._addServer('ondemand')
        self.save.getXML()

        components = self.save.getAtmosphereComponents()
        self.assertEquals(components[0].name, 'http-server-ondemand10')
    def completed(self):
        saver = AssistantSaver()
        saver.setFlowName('default')
        saver.setExistingComponentNames(self._existingComponentNames)
        self._scenario.save(self, saver)

        xml = saver.getXML()
        self.emit('finished', xml)
示例#4
0
    def completed(self):
        saver = AssistantSaver()
        saver.setFlowName('default')
        saver.setExistingComponentNames(self._existingComponentNames)
        self._scenario.save(self, saver)

        xml = saver.getXML()
        self.emit('finished', xml)
示例#5
0
    def testOndemand(self):
        save = AssistantSaver()

        server = HTTPServer('ondemand-server-worker', '/mount-point/')
        save.addServerConsumer(server, 'ondemand')

        configuration = save.getXML()
        testsuite.diffStrings(
            ('<planet>\n'
             '  <atmosphere>\n'
             '    <component name="http-server-ondemand"\n'
             '               type="http-server"\n'
             '               project="flumotion"\n'
             '               worker="ondemand-server-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="mount-point">/mount-point/</property>\n'
             '    </component>\n'
             '  </atmosphere>\n'
             '</planet>\n' % dict(version=configure.version)),
            configuration)
示例#6
0
    def testOndemand(self):
        save = AssistantSaver()

        server = HTTPServer('ondemand-server-worker', '/mount-point/')
        save.addServerConsumer(server, 'ondemand')

        configuration = save.getXML()
        testsuite.diffStrings(
            XMLWriter.encoding + \
            ('<planet>\n'
             '  <atmosphere>\n'
             '    <component name="http-server-ondemand"\n'
             '               type="http-server"\n'
             '               project="flumotion"\n'
             '               worker="ondemand-server-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="mount-point">/mount-point/</property>\n'
             '    </component>\n'
             '  </atmosphere>\n'
             '</planet>\n' % dict(version=configure.version)),
            configuration)
示例#7
0
    def testFirewireStreamerDifferentWorkers(self):
        save = AssistantSaver()
        porter = self._createPorter()
        save.addPorter(porter, 'audio-video')
        save.setFlowName('flow')

        audioProducer = self._createFirewireProducer()
        audioProducer.worker = 'audio-worker'
        save.setAudioProducer(audioProducer)
        videoProducer = self._createFirewireProducer()
        videoProducer.worker = 'video-worker'
        save.setVideoProducer(videoProducer)
        save.setVideoOverlay(self._createVideoOverlay(videoProducer))
        save.setAudioEncoder(self._createAudioEncoder())
        save.setVideoEncoder(self._createVideoEncoder())

        save.setMuxer('default-muxer', 'muxer-worker')

        streamer = self._createHTTPStreamer()
        streamer.has_bandwidth_limit = True
        streamer.bandwidth_limit = 123
        streamer.setPorter(porter)
        save.addConsumer(streamer, 'audio-video')

        server = HTTPServer('server-worker', '/mount/')
        save.addServerConsumer(server, 'audio-video')

        save.setUseCCLicense(True)

        configuration = save.getXML()
        testsuite.diffStrings(
            ('<planet>\n'
             '  <atmosphere>\n'
             '    <component name="http-server-audio-video"\n'
             '               type="http-server"\n'
             '               project="flumotion"\n'
             '               worker="server-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="mount-point">/mount/</property>\n'
             '    </component>\n'
             '    <component name="porter-audio-video"\n'
             '               type="porter"\n'
             '               project="flumotion"\n'
             '               worker="porter-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="password">password</property>\n'
             '      <property name="port">8080</property>\n'
             '      <property name="socket-path">flu-XXXX.socket</property>\n'
             '      <property name="username">username</property>\n'
             '    </component>\n'
             '  </atmosphere>\n'
             '  <flow name="flow">\n'
             '    <component name="producer-audio"\n'
             '               type="firewire-producer"\n'
             '               project="flumotion"\n'
             '               worker="audio-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="framerate">25/2</property>\n'
             '      <property name="height">480</property>\n'
             '      <property name="is-square">True</property>\n'
             '      <property name="width">640</property>\n'
             '    </component>\n'
             '    <component name="producer-video"\n'
             '               type="firewire-producer"\n'
             '               project="flumotion"\n'
             '               worker="video-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="framerate">25/2</property>\n'
             '      <property name="height">480</property>\n'
             '      <property name="is-square">True</property>\n'
             '      <property name="width">640</property>\n'
             '    </component>\n'
             '    <component name="overlay-video"\n'
             '               type="overlay-converter"\n'
             '               project="flumotion"\n'
             '               worker="overlay-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>producer-video:video</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="cc-logo">True</property>\n'
             '      <property name="fluendo-logo">True</property>\n'
             '      <property name="height">480</property>\n'
             '      <property name="show-text">True</property>\n'
             '      <property name="text">Flumotion</property>\n'
             '      <property name="width">640</property>\n'
             '    </component>\n'
             '    <component name="encoder-audio"\n'
             '               type="audio-encoder"\n'
             '               project="flumotion"\n'
             '               worker="audio-encoder-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>producer-audio:audio</feed>\n'
             '      </eater>\n'
             '    </component>\n'
             '    <component name="encoder-video"\n'
             '               type="video-encoder"\n'
             '               project="flumotion"\n'
             '               worker="video-encoder-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>overlay-video</feed>\n'
             '      </eater>\n'
             '    </component>\n'
             '    <component name="muxer-audio-video"\n'
             '               type="default-muxer"\n'
             '               project="flumotion"\n'
             '               worker="muxer-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>encoder-audio</feed>\n'
             '        <feed>encoder-video</feed>\n'
             '      </eater>\n'
             '    </component>\n'
             '    <component name="http-audio-video"\n'
             '               type="http-streamer"\n'
             '               project="flumotion"\n'
             '               worker="streamer-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>muxer-audio-video</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="bandwidth-limit">123000000</property>\n'
             '      <property name="burst-on-connect">False</property>\n'
             '      <property name="port">8080</property>\n'
             '      <property name="porter-password">password</property>\n'
             '      <property name="porter-socket-path">flu-XXXX.socket'
             '</property>\n'
             '      <property name="porter-username">username</property>\n'
             '      <property name="type">slave</property>\n'
             '    </component>\n'
             '  </flow>\n'
             '</planet>\n' % dict(version=configure.version)),
            configuration)
示例#8
0
    def testAudioOnlyStream(self):
        save = AssistantSaver()
        porter = self._createPorter()
        save.addPorter(porter, 'audio-video')
        save.setFlowName('flow')

        audioProducer = TestAudioProducer()
        audioProducer.worker = 'worker'
        save.setAudioProducer(audioProducer)

        audioEncoder = VorbisAudioEncoder()
        audioEncoder.worker = 'worker'
        save.setAudioEncoder(audioEncoder)

        videoProducer = self._createVideoEncoder()
        self.assertRaises(ValueError, save.setVideoOverlay,
                          self._createVideoOverlay(videoProducer))

        save.setMuxer('ogg-muxer', 'muxer')

        streamer = self._createHTTPStreamer()
        streamer.setPorter(porter)
        save.addConsumer(streamer, 'audio')

        configuration = save.getXML()
        testsuite.diffStrings(
            ('<planet>\n'
             '  <atmosphere>\n'
             '    <component name="porter-audio-video"\n'
             '               type="porter"\n'
             '               project="flumotion"\n'
             '               worker="porter-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="password">password</property>\n'
             '      <property name="port">8080</property>\n'
             '      <property name="socket-path">flu-XXXX.socket</property>\n'
             '      <property name="username">username</property>\n'
             '    </component>\n'
             '  </atmosphere>\n'
             '  <flow name="flow">\n'
             '    <component name="producer-audio"\n'
             '               type="audiotest-producer"\n'
             '               project="flumotion"\n'
             '               worker="worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="samplerate">44100</property>\n'
             '    </component>\n'
             '    <component name="encoder-audio"\n'
             '               type="vorbis-encoder"\n'
             '               project="flumotion"\n'
             '               worker="worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>producer-audio</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="bitrate">64000</property>\n'
             '    </component>\n'
             '    <component name="muxer-audio"\n'
             '               type="ogg-muxer"\n'
             '               project="flumotion"\n'
             '               worker="muxer"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>encoder-audio</feed>\n'
             '      </eater>\n'
             '    </component>\n'
             '    <component name="http-audio"\n'
             '               type="http-streamer"\n'
             '               project="flumotion"\n'
             '               worker="streamer-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>muxer-audio</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="burst-on-connect">False</property>\n'
             '      <property name="port">8080</property>\n'
             '      <property name="porter-password">password</property>\n'
             '      <property name="porter-socket-path">flu-XXXX.socket'
             '</property>\n'
             '      <property name="porter-username">username</property>\n'
             '      <property name="type">slave</property>\n'
             '    </component>\n'
             '  </flow>\n'
             '</planet>\n' % dict(version=configure.version)),
            configuration)
示例#9
0
    def testOggStream(self):
        save = AssistantSaver()
        save.setFlowName('flow')

        audioProducer = TestAudioProducer()
        audioProducer.worker = 'worker'
        save.setAudioProducer(audioProducer)
        videoProducer = TestVideoProducer()
        videoProducer.worker = 'worker'
        videoProducer.properties.width = 320
        videoProducer.properties.height = 240
        save.setVideoProducer(videoProducer)

        save.setVideoOverlay(self._createVideoOverlay(videoProducer))

        audioEncoder = VorbisAudioEncoder()
        audioEncoder.worker = 'worker'
        save.setAudioEncoder(audioEncoder)
        videoEncoder = TheoraVideoEncoder()
        videoEncoder.worker = 'worker'
        save.setVideoEncoder(videoEncoder)

        save.setMuxer('ogg-muxer', 'muxer-worker')

        porter = self._createPorter()
        save.addPorter(porter, 'audio-video')
        streamer = self._createHTTPStreamer()
        streamer.setPorter(porter)
        save.addConsumer(streamer, 'audio-video')

        configuration = save.getXML()
        testsuite.diffStrings(
            ('<planet>\n'
             '  <atmosphere>\n'
             '    <component name="porter-audio-video"\n'
             '               type="porter"\n'
             '               project="flumotion"\n'
             '               worker="porter-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="password">password</property>\n'
             '      <property name="port">8080</property>\n'
             '      <property name="socket-path">flu-XXXX.socket</property>\n'
             '      <property name="username">username</property>\n'
             '    </component>\n'
             '  </atmosphere>\n'
             '  <flow name="flow">\n'
             '    <component name="producer-audio"\n'
             '               type="audiotest-producer"\n'
             '               project="flumotion"\n'
             '               worker="worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="samplerate">44100</property>\n'
             '    </component>\n'
             '    <component name="producer-video"\n'
             '               type="videotest-producer"\n'
             '               project="flumotion"\n'
             '               worker="worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="height">240</property>\n'
             '      <property name="pattern">0</property>\n'
             '      <property name="width">320</property>\n'
             '    </component>\n'
             '    <component name="overlay-video"\n'
             '               type="overlay-converter"\n'
             '               project="flumotion"\n'
             '               worker="overlay-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>producer-video</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="fluendo-logo">True</property>\n'
             '      <property name="height">240</property>\n'
             '      <property name="show-text">True</property>\n'
             '      <property name="text">Flumotion</property>\n'
             '      <property name="width">320</property>\n'
             '      <property name="xiph-logo">True</property>\n'
             '    </component>\n'
             '    <component name="encoder-video"\n'
             '               type="theora-encoder"\n'
             '               project="flumotion"\n'
             '               worker="worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>overlay-video</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="bitrate">400000</property>\n'
             '      <property name="keyframe-maxdistance">50</property>\n'
             '      <property name="noise-sensitivity">1</property>\n'
             '      <property name="sharpness">0</property>\n'
             '    </component>\n'
             '    <component name="encoder-audio"\n'
             '               type="vorbis-encoder"\n'
             '               project="flumotion"\n'
             '               worker="worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>producer-audio</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="bitrate">64000</property>\n'
             '    </component>\n'
             '    <component name="muxer-audio-video"\n'
             '               type="ogg-muxer"\n'
             '               project="flumotion"\n'
             '               worker="muxer-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>encoder-audio</feed>\n'
             '        <feed>encoder-video</feed>\n'
             '      </eater>\n'
             '    </component>\n'
             '    <component name="http-audio-video"\n'
             '               type="http-streamer"\n'
             '               project="flumotion"\n'
             '               worker="streamer-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>muxer-audio-video</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="burst-on-connect">False</property>\n'
             '      <property name="port">8080</property>\n'
             '      <property name="porter-password">password</property>\n'
             '      <property name="porter-socket-path">flu-XXXX.socket'
             '</property>\n'
             '      <property name="porter-username">username</property>\n'
             '      <property name="type">slave</property>\n'
             '    </component>\n'
             '  </flow>\n'
             '</planet>\n' % dict(version=configure.version)),
            configuration)
示例#10
0
    def testMultiFeedProducer(self):
        save = AssistantSaver()
        save.setFlowName('flow')

        save.setAudioProducer(self._createAudioProducer(
            worker='both-producer-worker',
            componentType='both-producer'))
        save.setVideoProducer(self._createVideoProducer(
            componentType='both-producer',
            worker='both-producer-worker'))

        save.setAudioEncoder(self._createAudioEncoder())
        save.setVideoEncoder(self._createVideoEncoder())

        save.setMuxer('default-muxer', 'muxer-worker')

        porter = self._createPorter()
        save.addPorter(porter, 'audio-video')

        streamer = self._createHTTPStreamer()
        streamer.setPorter(porter)
        save.addConsumer(streamer, 'audio-video')

        configuration = save.getXML()
        testsuite.diffStrings(
            ('<planet>\n'
             '  <atmosphere>\n'
             '    <component name="porter-audio-video"\n'
             '               type="porter"\n'
             '               project="flumotion"\n'
             '               worker="porter-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="password">password</property>\n'
             '      <property name="port">8080</property>\n'
             '      <property name="socket-path">flu-XXXX.socket</property>\n'
             '      <property name="username">username</property>\n'
             '    </component>\n'
             '  </atmosphere>\n'
             '  <flow name="flow">\n'
             '    <component name="producer-audio-video"\n'
             '               type="both-producer"\n'
             '               project="flumotion"\n'
             '               worker="both-producer-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="height">480</property>\n'
             '      <property name="width">640</property>\n'
             '    </component>\n'
             '    <component name="encoder-audio"\n'
             '               type="audio-encoder"\n'
             '               project="flumotion"\n'
             '               worker="audio-encoder-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>producer-audio-video</feed>\n'
             '      </eater>\n'
             '    </component>\n'
             '    <component name="encoder-video"\n'
             '               type="video-encoder"\n'
             '               project="flumotion"\n'
             '               worker="video-encoder-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>producer-audio-video</feed>\n'
             '      </eater>\n'
             '    </component>\n'
             '    <component name="muxer-audio-video"\n'
             '               type="default-muxer"\n'
             '               project="flumotion"\n'
             '               worker="muxer-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>encoder-audio</feed>\n'
             '        <feed>encoder-video</feed>\n'
             '      </eater>\n'
             '    </component>\n'
             '    <component name="http-audio-video"\n'
             '               type="http-streamer"\n'
             '               project="flumotion"\n'
             '               worker="streamer-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>muxer-audio-video</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="burst-on-connect">False</property>\n'
             '      <property name="port">8080</property>\n'
             '      <property name="porter-password">password</property>\n'
             '      <property name="porter-socket-path">flu-XXXX.socket'
             '</property>\n'
             '      <property name="porter-username">username</property>\n'
             '      <property name="type">slave</property>\n'
             '    </component>\n'
             '  </flow>\n'
             '</planet>\n' % dict(version=configure.version)),
            configuration)
示例#11
0
    def testFirewireStreamerDifferentWorkers(self):
        save = AssistantSaver()
        porter = self._createPorter()
        save.addPorter(porter, 'audio-video')
        save.setFlowName('flow')

        audioProducer = self._createFirewireProducer()
        audioProducer.worker = 'audio-worker'
        save.setAudioProducer(audioProducer)
        videoProducer = self._createFirewireProducer()
        videoProducer.worker = 'video-worker'
        save.setVideoProducer(videoProducer)
        save.setVideoOverlay(self._createVideoOverlay(videoProducer))
        save.setAudioEncoder(self._createAudioEncoder())
        save.setVideoEncoder(self._createVideoEncoder())

        save.setMuxer('default-muxer', 'muxer-worker')

        streamer = self._createHTTPStreamer()
        streamer.has_bandwidth_limit = True
        streamer.bandwidth_limit = 123
        streamer.setPorter(porter)
        save.addConsumer(streamer, 'audio-video')

        server = HTTPServer('server-worker', '/mount/')
        save.addServerConsumer(server, 'audio-video')

        save.setUseCCLicense(True)

        configuration = save.getXML()
        testsuite.diffStrings(
            XMLWriter.encoding + \
            ('<planet>\n'
             '  <atmosphere>\n'
             '    <component name="http-server-audio-video"\n'
             '               type="http-server"\n'
             '               project="flumotion"\n'
             '               worker="server-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="mount-point">/mount/</property>\n'
             '    </component>\n'
             '    <component name="porter-audio-video"\n'
             '               type="porter"\n'
             '               project="flumotion"\n'
             '               worker="porter-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="password">password</property>\n'
             '      <property name="port">8080</property>\n'
             '      <property name="socket-path">flu-XXXX.socket</property>\n'
             '      <property name="username">username</property>\n'
             '    </component>\n'
             '  </atmosphere>\n'
             '  <flow name="flow">\n'
             '    <component name="producer-audio"\n'
             '               type="firewire-producer"\n'
             '               project="flumotion"\n'
             '               worker="audio-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="decoder">ffdec_dvvideo</property>\n'
           '      <property name="deinterlace-method">ffmpeg</property>\n'
             '      <property name="deinterlace-mode">auto</property>\n'
             '      <property name="framerate">25/2</property>\n'
             '      <property name="height">480</property>\n'
             '      <property name="is-square">True</property>\n'
             '      <property name="width">640</property>\n'
             '    </component>\n'
             '    <component name="producer-video"\n'
             '               type="firewire-producer"\n'
             '               project="flumotion"\n'
             '               worker="video-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="decoder">ffdec_dvvideo</property>\n'
           '      <property name="deinterlace-method">ffmpeg</property>\n'
             '      <property name="deinterlace-mode">auto</property>\n'
             '      <property name="framerate">25/2</property>\n'
             '      <property name="height">480</property>\n'
             '      <property name="is-square">True</property>\n'
             '      <property name="width">640</property>\n'
             '    </component>\n'
             '    <component name="overlay-video"\n'
             '               type="overlay-converter"\n'
             '               project="flumotion"\n'
             '               worker="overlay-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>producer-video:video</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="cc-logo">True</property>\n'
             '      <property name="fluendo-logo">True</property>\n'
             '      <property name="show-text">True</property>\n'
             '      <property name="text">Flumotion</property>\n'
             '    </component>\n'
             '    <component name="encoder-audio"\n'
             '               type="audio-encoder"\n'
             '               project="flumotion"\n'
             '               worker="audio-encoder-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>producer-audio:audio</feed>\n'
             '      </eater>\n'
             '    </component>\n'
             '    <component name="encoder-video"\n'
             '               type="video-encoder"\n'
             '               project="flumotion"\n'
             '               worker="video-encoder-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>overlay-video</feed>\n'
             '      </eater>\n'
             '    </component>\n'
             '    <component name="muxer-audio-video"\n'
             '               type="default-muxer"\n'
             '               project="flumotion"\n'
             '               worker="muxer-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>encoder-audio</feed>\n'
             '        <feed>encoder-video</feed>\n'
             '      </eater>\n'
             '    </component>\n'
             '    <component name="http-audio-video"\n'
             '               type="http-streamer"\n'
             '               project="flumotion"\n'
             '               worker="streamer-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>muxer-audio-video</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="bandwidth-limit">123000000</property>\n'
             '      <property name="burst-on-connect">False</property>\n'
             '      <property name="port">8080</property>\n'
             '      <property name="porter-password">password</property>\n'
             '      <property name="porter-socket-path">flu-XXXX.socket'
             '</property>\n'
             '      <property name="porter-username">username</property>\n'
             '      <property name="type">slave</property>\n'
             '    </component>\n'
             '  </flow>\n'
             '</planet>\n' % dict(version=configure.version)),
            configuration)
示例#12
0
    def testAudioOnlyStream(self):
        save = AssistantSaver()
        porter = self._createPorter()
        save.addPorter(porter, 'audio-video')
        save.setFlowName('flow')

        audioProducer = TestAudioProducer()
        audioProducer.worker = 'worker'
        save.setAudioProducer(audioProducer)

        audioEncoder = VorbisAudioEncoder()
        audioEncoder.worker = 'worker'
        save.setAudioEncoder(audioEncoder)

        videoProducer = self._createVideoEncoder()
        self.assertRaises(ValueError, save.setVideoOverlay,
                          self._createVideoOverlay(videoProducer))

        save.setMuxer('ogg-muxer', 'muxer')

        streamer = self._createHTTPStreamer()
        streamer.setPorter(porter)
        save.addConsumer(streamer, 'audio')

        configuration = save.getXML()
        testsuite.diffStrings(
            XMLWriter.encoding + \
            ('<planet>\n'
             '  <atmosphere>\n'
             '    <component name="porter-audio-video"\n'
             '               type="porter"\n'
             '               project="flumotion"\n'
             '               worker="porter-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="password">password</property>\n'
             '      <property name="port">8080</property>\n'
             '      <property name="socket-path">flu-XXXX.socket</property>\n'
             '      <property name="username">username</property>\n'
             '    </component>\n'
             '  </atmosphere>\n'
             '  <flow name="flow">\n'
             '    <component name="producer-audio"\n'
             '               type="audiotest-producer"\n'
             '               project="flumotion"\n'
             '               worker="worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="samplerate">44100</property>\n'
             '    </component>\n'
             '    <component name="encoder-audio"\n'
             '               type="vorbis-encoder"\n'
             '               project="flumotion"\n'
             '               worker="worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>producer-audio</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="bitrate">64000</property>\n'
             '    </component>\n'
             '    <component name="muxer-audio"\n'
             '               type="ogg-muxer"\n'
             '               project="flumotion"\n'
             '               worker="muxer"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>encoder-audio</feed>\n'
             '      </eater>\n'
             '    </component>\n'
             '    <component name="http-audio"\n'
             '               type="http-streamer"\n'
             '               project="flumotion"\n'
             '               worker="streamer-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>muxer-audio</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="burst-on-connect">False</property>\n'
             '      <property name="port">8080</property>\n'
             '      <property name="porter-password">password</property>\n'
             '      <property name="porter-socket-path">flu-XXXX.socket'
             '</property>\n'
             '      <property name="porter-username">username</property>\n'
             '      <property name="type">slave</property>\n'
             '    </component>\n'
             '  </flow>\n'
             '</planet>\n' % dict(version=configure.version)),
            configuration)
示例#13
0
    def testOggStream(self):
        save = AssistantSaver()
        save.setFlowName('flow')

        audioProducer = TestAudioProducer()
        audioProducer.worker = 'worker'
        save.setAudioProducer(audioProducer)
        videoProducer = TestVideoProducer()
        videoProducer.worker = 'worker'
        videoProducer.properties.width = 320
        videoProducer.properties.height = 240
        save.setVideoProducer(videoProducer)

        save.setVideoOverlay(self._createVideoOverlay(videoProducer))

        audioEncoder = VorbisAudioEncoder()
        audioEncoder.worker = 'worker'
        save.setAudioEncoder(audioEncoder)
        videoEncoder = TheoraVideoEncoder()
        videoEncoder.worker = 'worker'
        save.setVideoEncoder(videoEncoder)

        save.setMuxer('ogg-muxer', 'muxer-worker')

        porter = self._createPorter()
        save.addPorter(porter, 'audio-video')
        streamer = self._createHTTPStreamer()
        streamer.setPorter(porter)
        save.addConsumer(streamer, 'audio-video')

        configuration = save.getXML()
        testsuite.diffStrings(
            XMLWriter.encoding + \
            ('<planet>\n'
             '  <atmosphere>\n'
             '    <component name="porter-audio-video"\n'
             '               type="porter"\n'
             '               project="flumotion"\n'
             '               worker="porter-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="password">password</property>\n'
             '      <property name="port">8080</property>\n'
             '      <property name="socket-path">flu-XXXX.socket</property>\n'
             '      <property name="username">username</property>\n'
             '    </component>\n'
             '  </atmosphere>\n'
             '  <flow name="flow">\n'
             '    <component name="producer-audio"\n'
             '               type="audiotest-producer"\n'
             '               project="flumotion"\n'
             '               worker="worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="samplerate">44100</property>\n'
             '    </component>\n'
             '    <component name="producer-video"\n'
             '               type="videotest-producer"\n'
             '               project="flumotion"\n'
             '               worker="worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="height">240</property>\n'
             '      <property name="pattern">0</property>\n'
             '      <property name="width">320</property>\n'
             '    </component>\n'
             '    <component name="overlay-video"\n'
             '               type="overlay-converter"\n'
             '               project="flumotion"\n'
             '               worker="overlay-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>producer-video</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="fluendo-logo">True</property>\n'
             '      <property name="show-text">True</property>\n'
             '      <property name="text">Flumotion</property>\n'
             '      <property name="xiph-logo">True</property>\n'
             '    </component>\n'
             '    <component name="encoder-video"\n'
             '               type="theora-encoder"\n'
             '               project="flumotion"\n'
             '               worker="worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>overlay-video</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="bitrate">400000</property>\n'
             '      <property name="keyframe-maxdistance">50</property>\n'
             '      <property name="speed">3</property>\n'
             '    </component>\n'
             '    <component name="encoder-audio"\n'
             '               type="vorbis-encoder"\n'
             '               project="flumotion"\n'
             '               worker="worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>producer-audio</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="bitrate">64000</property>\n'
             '    </component>\n'
             '    <component name="muxer-audio-video"\n'
             '               type="ogg-muxer"\n'
             '               project="flumotion"\n'
             '               worker="muxer-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>encoder-audio</feed>\n'
             '        <feed>encoder-video</feed>\n'
             '      </eater>\n'
             '    </component>\n'
             '    <component name="http-audio-video"\n'
             '               type="http-streamer"\n'
             '               project="flumotion"\n'
             '               worker="streamer-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>muxer-audio-video</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="burst-on-connect">False</property>\n'
             '      <property name="port">8080</property>\n'
             '      <property name="porter-password">password</property>\n'
             '      <property name="porter-socket-path">flu-XXXX.socket'
             '</property>\n'
             '      <property name="porter-username">username</property>\n'
             '      <property name="type">slave</property>\n'
             '    </component>\n'
             '  </flow>\n'
             '</planet>\n' % dict(version=configure.version)),
            configuration)
示例#14
0
    def testMultiFeedProducer(self):
        save = AssistantSaver()
        save.setFlowName('flow')

        save.setAudioProducer(
            self._createAudioProducer(worker='both-producer-worker',
                                      componentType='both-producer'))
        save.setVideoProducer(
            self._createVideoProducer(componentType='both-producer',
                                      worker='both-producer-worker'))

        save.setAudioEncoder(self._createAudioEncoder())
        save.setVideoEncoder(self._createVideoEncoder())

        save.setMuxer('default-muxer', 'muxer-worker')

        porter = self._createPorter()
        save.addPorter(porter, 'audio-video')

        streamer = self._createHTTPStreamer()
        streamer.setPorter(porter)
        save.addConsumer(streamer, 'audio-video')

        configuration = save.getXML()
        testsuite.diffStrings(
            XMLWriter.encoding + \
            ('<planet>\n'
             '  <atmosphere>\n'
             '    <component name="porter-audio-video"\n'
             '               type="porter"\n'
             '               project="flumotion"\n'
             '               worker="porter-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="password">password</property>\n'
             '      <property name="port">8080</property>\n'
             '      <property name="socket-path">flu-XXXX.socket</property>\n'
             '      <property name="username">username</property>\n'
             '    </component>\n'
             '  </atmosphere>\n'
             '  <flow name="flow">\n'
             '    <component name="producer-audio-video"\n'
             '               type="both-producer"\n'
             '               project="flumotion"\n'
             '               worker="both-producer-worker"\n'
             '               version="%(version)s">\n'
             '      \n'
             '      <property name="height">480</property>\n'
             '      <property name="width">640</property>\n'
             '    </component>\n'
             '    <component name="encoder-audio"\n'
             '               type="audio-encoder"\n'
             '               project="flumotion"\n'
             '               worker="audio-encoder-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>producer-audio-video</feed>\n'
             '      </eater>\n'
             '    </component>\n'
             '    <component name="encoder-video"\n'
             '               type="video-encoder"\n'
             '               project="flumotion"\n'
             '               worker="video-encoder-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>producer-audio-video</feed>\n'
             '      </eater>\n'
             '    </component>\n'
             '    <component name="muxer-audio-video"\n'
             '               type="default-muxer"\n'
             '               project="flumotion"\n'
             '               worker="muxer-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>encoder-audio</feed>\n'
             '        <feed>encoder-video</feed>\n'
             '      </eater>\n'
             '    </component>\n'
             '    <component name="http-audio-video"\n'
             '               type="http-streamer"\n'
             '               project="flumotion"\n'
             '               worker="streamer-worker"\n'
             '               version="%(version)s">\n'
             '      <eater name="default">\n'
             '        <feed>muxer-audio-video</feed>\n'
             '      </eater>\n'
             '      \n'
             '      <property name="burst-on-connect">False</property>\n'
             '      <property name="port">8080</property>\n'
             '      <property name="porter-password">password</property>\n'
             '      <property name="porter-socket-path">flu-XXXX.socket'
             '</property>\n'
             '      <property name="porter-username">username</property>\n'
             '      <property name="type">slave</property>\n'
             '    </component>\n'
             '  </flow>\n'
             '</planet>\n' % dict(version=configure.version)),
            configuration)