# 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 gst
from twisted.internet import defer
from flumotion.component import feedcomponent
from flumotion.twisted.defer import RetryingDeferred
from flumotion.common import errors
        typefind = pipeline.get_by_name('tf')
        self.signal_id = typefind.connect('have-type',\
                self._typefind_have_caps_cb)

        if not self.configured:
            self.attachPadMonitorToElement('src',
                                           self._src_connected,
                                           self._src_disconnected)
        self.reconnecting = False
        self.reconnector = RetryingDeferred(self.connect)
        self.reconnector.initialDelay = 1.0
        self.reconnector.maxDelay = 300
        self.attemptD = None

        def _drop_eos(pad, event):
            self.debug('Swallowing event %r', event)
            if event.type == gst.EVENT_EOS:
                return False
            return True
        self.configured = True
        self.src.get_pad('src').add_event_probe(_drop_eos)

    def bus_message_received_cb(self, bus, message):
        if message.type == gst.MESSAGE_ERROR and message.src == self.src:
            gerror, debug = message.parse_error()
            self.warning('element %s error %s %s',
                    message.src.get_path_string(), gerror, debug)
            if self.reconnecting:
                self._retry()
            return True

# 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/producers/icecast/icecast.py
import gst
from twisted.internet import defer
from flumotion.component import feedcomponent
from flumotion.twisted.defer import RetryingDeferred
from flumotion.common import errors

        typefind = pipeline.get_by_name('tf')
        self.signal_id = typefind.connect('have-type',\
                self._typefind_have_caps_cb)

        if not self.configured:
            self.attachPadMonitorToElement('src',
                                           self._src_connected,
                                           self._src_disconnected)
        self.reconnecting = False
        self.reconnector = RetryingDeferred(self.connect)
        self.reconnector.initialDelay = 1.0
        self.reconnector.maxDelay = 300
        self.attemptD = None

        def _drop_eos(pad, event):
            self.debug('Swallowing event %r', event)
            if event.type == gst.EVENT_EOS:
                return False
            return True
        self.configured = True
        self.src.get_pad('src').add_event_probe(_drop_eos)

    def bus_message_received_cb(self, bus, message):
        if message.type == gst.MESSAGE_ERROR and message.src == self.src:
            gerror, debug = message.parse_error()
            self.warning('element %s error %s %s',
                    message.src.get_path_string(), gerror, debug)
            if self.reconnecting:
                self._retry()
            return True

        feedcomponent.ParseLaunchComponent.bus_message_received_cb(