# Path: flumotion/common/messages.py
# (ERROR,
#  WARNING,
#  INFO) = range(1, 4)
# class Message(pb.Copyable, pb.RemoteCopy, FancyEqMixin):
# class Result(pb.Copyable, pb.RemoteCopy):
#     def __init__(self, level, translatable, debug=None, mid=None, priority=50,
#         timestamp=None):
#     def __repr__(self):
#     def add(self, translatable):
#     def getTimeStamp(self):
#     def getDescription(self):
# def Error(*args, **kwargs):
# def Warning(*args, **kwargs):
# def Info(*args, **kwargs):
#     def __init__(self):
#     def succeed(self, value):
#     def add(self, message):
# 
# 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):


from flumotion.common import messages, errors
from flumotion.common.i18n import N_, gettexter
from flumotion.component import feedcomponent
            val = props.get(prop_name, None)
            if val is None:
                return
            if val < lower_limit or val > upper_limit:
                msg = messages.Error(T_(N_(
                    "The configuration property '%s' can only take "
                    "values from %d to %d"),
                    prop_name, lower_limit, upper_limit), mid='config')
                addMessage(msg)
                raise errors.ConfigError(msg)

        check_limit('speed', 0, 7)
        check_limit('threads', 1, 64)

    def get_pipeline_string(self, properties):
        return "ffmpegcolorspace ! vp8enc name=encoder"

    def configure_pipeline(self, pipeline, properties):
        element = pipeline.get_by_name('encoder')

        props = (('bitrate', 'bitrate', 400),
                 ('quality', 'quality', None),
                 ('speed', 'speed', 2),
                 ('threads', 'threads', 4),
                 ('keyframe-maxdistance', 'max-keyframe-distance', 50))

        for pproperty, eproperty, default in props:
            if eproperty is None:
                eproperty = properties


# Path: flumotion/common/messages.py
# (ERROR,
#  WARNING,
#  INFO) = range(1, 4)
# class Message(pb.Copyable, pb.RemoteCopy, FancyEqMixin):
# class Result(pb.Copyable, pb.RemoteCopy):
#     def __init__(self, level, translatable, debug=None, mid=None, priority=50,
#         timestamp=None):
#     def __repr__(self):
#     def add(self, translatable):
#     def getTimeStamp(self):
#     def getDescription(self):
# def Error(*args, **kwargs):
# def Warning(*args, **kwargs):
# def Info(*args, **kwargs):
#     def __init__(self):
#     def succeed(self, value):
#     def add(self, message):
# 
# 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/encoders/vp8/vp8.py
from flumotion.common import messages, errors
from flumotion.common.i18n import N_, gettexter
from flumotion.component import feedcomponent

            val = props.get(prop_name, None)
            if val is None:
                return
            if val < lower_limit or val > upper_limit:
                msg = messages.Error(T_(N_(
                    "The configuration property '%s' can only take "
                    "values from %d to %d"),
                    prop_name, lower_limit, upper_limit), mid='config')
                addMessage(msg)
                raise errors.ConfigError(msg)

        check_limit('speed', 0, 7)
        check_limit('threads', 1, 64)

    def get_pipeline_string(self, properties):
        return "ffmpegcolorspace ! vp8enc name=encoder"

    def configure_pipeline(self, pipeline, properties):
        element = pipeline.get_by_name('encoder')

        props = (('bitrate', 'bitrate', 400),
                 ('quality', 'quality', None),
                 ('speed', 'speed', 2),
                 ('threads', 'threads', 4),
                 ('keyframe-maxdistance', 'max-keyframe-distance', 50))

        for pproperty, eproperty, default in props:
            if eproperty is None:
                eproperty = properties


            if not pproperty in properties and default is None: