# Path: flumotion/component/feedcomponent.py
# T_ = gettexter()
#     DELIMITER = '@'
#     FDSRC_TMPL = 'fdsrc name=%(name)s'
#     DEPAY_TMPL = 'gdpdepay name=%(name)s-depay'
#     FEEDER_TMPL = 'gdppay name=%(name)s-pay ! multifdsink sync=false '\
#                       'name=%(name)s buffers-max=500 buffers-soft-max=450 '\
#                       'recover-policy=1'
#     EATER_TMPL = None
#     QUEUE_SIZE_BUFFERS = 16
#     LINK_MUXER = True
#     LINK_MUXER = False
# class FeedComponentMedium(basecomponent.BaseComponentMedium):
# class ParseLaunchComponent(FeedComponent):
# class Effect(log.Loggable):
# class PostProcEffect (Effect):
# class MultiInputParseLaunchComponent(ParseLaunchComponent):
# class ReconfigurableComponent(ParseLaunchComponent):
# class EncoderComponent(ParseLaunchComponent):
# class MuxerComponent(MultiInputParseLaunchComponent):
#     def __init__(self, component):
#     def remote_attachPadMonitorToFeeder(self, feederName):
#     def remote_setGstDebug(self, debug):
#     def remote_eatFrom(self, eaterAlias, fullFeedId, host, port):
#     def _getAuthenticatorForFeed(self, eaterAliasOrFeedName):
#     def connectEater(self, eaterAlias):
#         def gotFeed((feedId, fd)):
#     def remote_feedTo(self, feederName, fullFeedId, host, port):
#     def connectFeeder(self, feederName, fullFeedId):
#         def gotFeed((fullFeedId, fd)):
#     def remote_provideMasterClock(self, port):
#     def remote_getMasterClockInfo(self):
#     def remote_setMasterClock(self, ip, port, base_time):
#     def remote_effect(self, effectName, methodName, *args, **kwargs):
#     def remote_dumpGstreamerDotFile(self, filename):
#     def init(self):
#     def create_pipeline(self):
#     def set_pipeline(self, pipeline):
#     def get_pipeline_string(self, properties):
#     def configure_pipeline(self, pipeline, properties):
#     def add_default_eater_feeder(self, pipeline):
#     def parse_tmpl(self, pipeline, templatizers):
#     def parse_pipeline(self, pipeline):
#     def get_eater_template(self, eaterAlias):
#     def get_feeder_template(self, feederName):
#     def get_queue_string(self, eaterAlias):
#     def get_eater_srcpad(self, eaterAlias):
#     def get_feeder_sinkpad(self, feederAlias):
#     def __init__(self, name):
#     def setComponent(self, component):
#     def setUIState(self, state):
#     def getComponent(self):
#     def __init__(self, name, sourcePad, effectBin, pipeline):
#     def plug(self):
#     def get_muxer_string(self, properties):
#     def get_queue_string(self, eaterAlias):
#     def get_pipeline_string(self, properties):
#     def unblock_eater(self, eaterAlias):
#         def _block_cb(pad, blocked):
#         def _underrun_cb(element):
#     def _get_base_pipeline_string(self):
#     def init(self):
#     def setup_completed(self):
#     def get_output_elements(self):
#     def get_input_elements(self):
#     def get_base_pipeline_string(self):
#     def get_eater_srcpad(self, eaterAlias):
#     def _install_changes_probes(self):
#         def output_reset_event(pad, event):
#         def got_new_caps(pad, args):
#         def got_new_buffer(pad, buff, element):
#     def _block_eaters(self):
#     def _unblock_eaters(self):
#     def _unlink_pads(self, element, directions):
#     def _remove_pipeline(self, pipeline, element, end, done=None):
#     def _rebuild_pipeline(self):
#         def move_element(element, orig, dest):
#     def _on_pad_blocked(self, pad, blocked):
#     def _on_eater_blocked(self, pad, blocked):
#     def _on_pipeline_drained(self):
#     def setup_completed(self):
#     def handle_reset_event(self, pad, event):
#     def get_link_pad(self, muxer, srcpad, caps):
#     def buffer_probe_cb(self, pad, buffer, depay, eaterAlias):
#     def event_probe_cb(self, pad, event, depay, eaterAlias):
#     def configure_pipeline(self, pipeline, properties):
#     def is_blocked_cb(self, pad, is_blocked):


import sys
import gobject
import gst
from flumotion.common.i18n import gettexter
from flumotion.component import feedcomponent
from flumotion.common import gstreamer
        else:
            raise AttributeError('unknown property %s' % property.name)

    def eventfunc(self, pad, event):
        self.debug("Received event %r from %s" % (event, event.src))
        if gstreamer.event_is_flumotion_reset(event) and self._use_audiorate():
            self._audiorate.set_state(gst.STATE_READY)
            self._audiorate.set_state(gst.STATE_PLAYING)
        return self._srcPad.push_event(event)


class Audioconvert(feedcomponent.PostProcEffect):
    """
    I am an effect that can be added to any component that changes the
    samplerate of the audio output.
    """
    logCategory = "audioconvert-effect"

    def __init__(self, name, sourcePad, pipeline, channels=None,
                 samplerate=None, tolerance=DEFAULT_TOLERANCE,
                 use_audiorate=True):
        """
        @param element:     the video source element on which the post
                            processing effect will be added
        @param sourcePad:   source pad used for linking the effect
        @param pipeline:    the pipeline of the element
        @param channels:    number of output channels
        @param samplerate:  output samplerate
        @param tolerance:   tolerance to correct imperfect timestamps
        """

# Path: flumotion/component/feedcomponent.py
# T_ = gettexter()
#     DELIMITER = '@'
#     FDSRC_TMPL = 'fdsrc name=%(name)s'
#     DEPAY_TMPL = 'gdpdepay name=%(name)s-depay'
#     FEEDER_TMPL = 'gdppay name=%(name)s-pay ! multifdsink sync=false '\
#                       'name=%(name)s buffers-max=500 buffers-soft-max=450 '\
#                       'recover-policy=1'
#     EATER_TMPL = None
#     QUEUE_SIZE_BUFFERS = 16
#     LINK_MUXER = True
#     LINK_MUXER = False
# class FeedComponentMedium(basecomponent.BaseComponentMedium):
# class ParseLaunchComponent(FeedComponent):
# class Effect(log.Loggable):
# class PostProcEffect (Effect):
# class MultiInputParseLaunchComponent(ParseLaunchComponent):
# class ReconfigurableComponent(ParseLaunchComponent):
# class EncoderComponent(ParseLaunchComponent):
# class MuxerComponent(MultiInputParseLaunchComponent):
#     def __init__(self, component):
#     def remote_attachPadMonitorToFeeder(self, feederName):
#     def remote_setGstDebug(self, debug):
#     def remote_eatFrom(self, eaterAlias, fullFeedId, host, port):
#     def _getAuthenticatorForFeed(self, eaterAliasOrFeedName):
#     def connectEater(self, eaterAlias):
#         def gotFeed((feedId, fd)):
#     def remote_feedTo(self, feederName, fullFeedId, host, port):
#     def connectFeeder(self, feederName, fullFeedId):
#         def gotFeed((fullFeedId, fd)):
#     def remote_provideMasterClock(self, port):
#     def remote_getMasterClockInfo(self):
#     def remote_setMasterClock(self, ip, port, base_time):
#     def remote_effect(self, effectName, methodName, *args, **kwargs):
#     def remote_dumpGstreamerDotFile(self, filename):
#     def init(self):
#     def create_pipeline(self):
#     def set_pipeline(self, pipeline):
#     def get_pipeline_string(self, properties):
#     def configure_pipeline(self, pipeline, properties):
#     def add_default_eater_feeder(self, pipeline):
#     def parse_tmpl(self, pipeline, templatizers):
#     def parse_pipeline(self, pipeline):
#     def get_eater_template(self, eaterAlias):
#     def get_feeder_template(self, feederName):
#     def get_queue_string(self, eaterAlias):
#     def get_eater_srcpad(self, eaterAlias):
#     def get_feeder_sinkpad(self, feederAlias):
#     def __init__(self, name):
#     def setComponent(self, component):
#     def setUIState(self, state):
#     def getComponent(self):
#     def __init__(self, name, sourcePad, effectBin, pipeline):
#     def plug(self):
#     def get_muxer_string(self, properties):
#     def get_queue_string(self, eaterAlias):
#     def get_pipeline_string(self, properties):
#     def unblock_eater(self, eaterAlias):
#         def _block_cb(pad, blocked):
#         def _underrun_cb(element):
#     def _get_base_pipeline_string(self):
#     def init(self):
#     def setup_completed(self):
#     def get_output_elements(self):
#     def get_input_elements(self):
#     def get_base_pipeline_string(self):
#     def get_eater_srcpad(self, eaterAlias):
#     def _install_changes_probes(self):
#         def output_reset_event(pad, event):
#         def got_new_caps(pad, args):
#         def got_new_buffer(pad, buff, element):
#     def _block_eaters(self):
#     def _unblock_eaters(self):
#     def _unlink_pads(self, element, directions):
#     def _remove_pipeline(self, pipeline, element, end, done=None):
#     def _rebuild_pipeline(self):
#         def move_element(element, orig, dest):
#     def _on_pad_blocked(self, pad, blocked):
#     def _on_eater_blocked(self, pad, blocked):
#     def _on_pipeline_drained(self):
#     def setup_completed(self):
#     def handle_reset_event(self, pad, event):
#     def get_link_pad(self, muxer, srcpad, caps):
#     def buffer_probe_cb(self, pad, buffer, depay, eaterAlias):
#     def event_probe_cb(self, pad, event, depay, eaterAlias):
#     def configure_pipeline(self, pipeline, properties):
#     def is_blocked_cb(self, pad, is_blocked):


# Path: flumotion/component/effects/audioconvert/audioconvert.py
import sys
import gobject
import gst
from flumotion.common.i18n import gettexter
from flumotion.component import feedcomponent
from flumotion.common import gstreamer

        else:
            raise AttributeError('unknown property %s' % property.name)

    def eventfunc(self, pad, event):
        self.debug("Received event %r from %s" % (event, event.src))
        if gstreamer.event_is_flumotion_reset(event) and self._use_audiorate():
            self._audiorate.set_state(gst.STATE_READY)
            self._audiorate.set_state(gst.STATE_PLAYING)
        return self._srcPad.push_event(event)


class Audioconvert(feedcomponent.PostProcEffect):
    """
    I am an effect that can be added to any component that changes the
    samplerate of the audio output.
    """
    logCategory = "audioconvert-effect"

    def __init__(self, name, sourcePad, pipeline, channels=None,
                 samplerate=None, tolerance=DEFAULT_TOLERANCE,
                 use_audiorate=True):
        """
        @param element:     the video source element on which the post
                            processing effect will be added
        @param sourcePad:   source pad used for linking the effect
        @param pipeline:    the pipeline of the element
        @param channels:    number of output channels
        @param samplerate:  output samplerate
        @param tolerance:   tolerance to correct imperfect timestamps
        """

        feedcomponent.PostProcEffect.__init__(self, name, sourcePad,