Exemplo n.º 1
0
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Public License version 2.1 as published by
# the Free Software Foundation.
# This file is distributed without any warranty; without even the implied
# warranty of merchantability or fitness for a particular purpose.
# See "LICENSE.LGPL" in the source distribution for more information.
#
# Headers in this file shall remain intact.

import os

from flumotion.common.i18n import gettexter, N_
from flumotion.common import errors, messages
from flumotion.component import feedcomponent

T_ = gettexter('flumotion')


class VP6Encoder(feedcomponent.EncoderComponent):
    checkTimestamp = True
    checkOffset = True

    def get_pipeline_string(self, properties):
        return "ffmpegcolorspace ! videoflip method=5 ! fluvp6enc name=encoder"

    def configure_pipeline(self, pipeline, properties):
        element = pipeline.get_by_name('encoder')
        if 'encoder-state' in properties:
            element.set_property('encoder-state', properties['encoder-state'])
        if 'bitrate' in properties:
            element.set_property('bitrate', int(properties['bitrate'] / 1000))
Exemplo n.º 2
0
import os

from twisted.python import util
from twisted.internet import defer

from flumotion.common import log
from flumotion.common.errors import SleepingComponentError
from flumotion.common.i18n import getLL, gettexter
from flumotion.component.base.componentnode import ComponentAdminGtkNode
from flumotion.component.base.eatersnode import EatersAdminGtkNode
from flumotion.component.base.feedersnode import FeedersAdminGtkNode
from flumotion.component.base.propertiesnode import PropertiesAdminGtkNode

_ = gettext.gettext
__version__ = "$Rev$"
T_ = gettexter()

# stupid pychecker
dir(locale)


class BaseAdminGtk(log.Loggable):
    """
    I am a base class for all GTK+-based Admin views.
    I am a view on one component's properties.

    @type nodes: L{twisted.python.util.OrderedDict}
    @ivar nodes: an ordered dict of name -> L{BaseAdminGtkNode}
    """

    logCategory = "admingtk"
from twisted.cred import credentials
from twisted.internet import reactor, defer, error, protocol
from twisted.protocols import basic
from twisted.web import server, http

from flumotion.common import log, errors, keycards
from flumotion.common.i18n import gettexter, N_
from flumotion.common.messages import Error
from flumotion.component import feedcomponent
from flumotion.component.component import moods
from flumotion.component.misc.porter import porterclient
from flumotion.component.producers.wms import asfparse
from flumotion.twisted import fdserver

T_ = gettexter('flumotion-windowsmedia')


class DigestAuth(log.Loggable):
    logCategory = "digestauth"

    timeout = 60*60*3  # 3 hours.
    _qop_type = 'auth' # Others not implemented
    _algorithm = "MD5"

    def __init__(self, component):
        self._outstanding = {} # opaque -> (nonce, timestamp)
        self._pushIds = {} # pushid -> authenticated

        self._realm = None
        self._component = component
Exemplo n.º 4
0
# Licensees having purchased or holding a valid Flumotion Advanced
# Streaming Server license may use this file in accordance with the
# Flumotion Advanced Streaming Server Commercial License Agreement.
# See "LICENSE.Flumotion" in the source distribution for more information.

# Headers in this file shall remain intact.

import gettext

from flumotion.admin.assistant.models import VideoConverter
from flumotion.common import documentation, messages
from flumotion.common.i18n import N_, gettexter, ngettext
from flumotion.admin.gtk.workerstep import WorkerWizardStep

__version__ = "$Rev: 6228 $"
T_ = gettexter()
_ = gettext.gettext


class Overlay(VideoConverter):
    componentType = 'overlay-converter'

    def __init__(self, video_producer):
        super(Overlay, self).__init__()
        self._videoProducer = video_producer
        self.can_overlay = False
        self.show_logo = True
        self.properties.show_text = True
        self.properties.text = _("Flumotion")

    # Public API
Exemplo n.º 5
0
from rtmpy import server, exc

from twisted.internet import reactor, error, defer
from twisted.internet.task import LoopingCall
from twisted.python import util

from flumotion.common import log, errors
from flumotion.common.i18n import gettexter, N_
from flumotion.common import messages
from flumotion.component import feedcomponent
from flumotion.component.component import moods

from flumotion.component.producers.fms import live


T_ = gettexter('flumotion-flashmedia')

sound_format_has_headers = {SOUND_FORMAT_AAC: True}
codec_id_has_headers = {CODEC_ID_H264: True}

UI_UPDATE_THROTTLE_PERIOD = 5.0
UI_MAX_ACTIONS_KEPT = 100


#TODO: Factor out the application logic from the part that actually handles the
# flv chunks and does all the processing. Right now the application is at the
# same time the subscriber.

STARTCODE = "\x00\x00\x00\x01"

NAL_UNIT_TYPE_SPS = 7
Exemplo n.º 6
0
from flumotion.inhouse import log
from flumotion.inhouse.errors import FlumotionError

from flumotion.ovp.utils import safe_mkdirs

from flumotion.component.component import BaseComponentMedium, BaseComponent
from flumotion.transcoder.enums import MonitorFileStateEnum
from flumotion.transcoder.errors import TranscoderError
from flumotion.transcoder.local import Local
from flumotion.transcoder.virtualpath import VirtualPath
from flumotion.ovp.fileutils import checksum, magic_mimetype
from flumotion.inhouse.fileutils import PathAttributes


_ = gettexter('flumotion-transcoder')

IReactorThreads(reactor).suggestThreadPoolSize(2)
#---------------------- prevents from computing too many md5 at the same time




class MonitorMedium(BaseComponentMedium):

    def remote_setFileState(self, profile_name, relFile, status):
        self.comp.setFileState(profile_name, relFile, status)

    def remote_setFilesState(self, states):
        for state in states:
            self.comp.setFileState(*state)
Exemplo n.º 7
0
import gtk

from zope.interface import implements

from flumotion.common import messages
from flumotion.common.i18n import N_, gettexter
from flumotion.admin.gtk.basesteps import AudioProducerStep, VideoProducerStep
from flumotion.admin.assistant.interfaces import IProducerPlugin
from flumotion.admin.assistant.models import AudioProducer, VideoProducer, \
     AudioEncoder, VideoEncoder, VideoConverter
from flumotion.ui.fileselector import FileSelectorDialog

__pychecker__ = 'no-returnvalues'
__version__ = "$Rev: 6583 $"
_ = gettext.gettext
T_ = gettexter('flumotion')


class LoopProducer(AudioProducer, VideoProducer):
    componentType = 'loop-producer'

    def __init__(self):
        super(LoopProducer, self).__init__()
        self.properties.location = None
        self.properties.framerate = 5.0
        self.properties.width = 320
        self.properties.height = 240

    def getFeederName(self, component):
        if isinstance(component, AudioEncoder):
            return 'audio'
Exemplo n.º 8
0
Arquivo: rrd.py Projeto: flyapen/UgFlu
import types
import os

# FIXME: use a variable like HAS_RRDTOOL like we do in similar code
try:
    import rrdtool
except ImportError:
    rrdtool = None

from flumotion.component.plugs import base
from flumotion.common import common, messages, i18n, log
from flumotion.common.poller import Poller

from flumotion.common.i18n import N_
T_ = i18n.gettexter()

_DEFAULT_POLL_INTERVAL = 60 # in seconds
_DEFAULT_STEP_SIZE = 300 # in seconds

__version__ = "$Rev: 7162 $"


class ComponentRRDPlug(base.ComponentPlug):
    """Class to create or update a RRD file with statistics"""

    ### ComponentPlug methods

    def start(self, component):
        self._rrdpoller = None
Exemplo n.º 9
0
import os

# FIXME: use a variable like HAS_RRDTOOL like we do in similar code
try:
    import rrdtool
except ImportError:
    rrdtool = None

from flumotion.component.plugs import base
from flumotion.common import messages, i18n, log
from flumotion.common.poller import Poller

from flumotion.common.i18n import N_

T_ = i18n.gettexter()

_DEFAULT_POLL_INTERVAL = 60  # in seconds
_DEFAULT_STEP_SIZE = 300  # in seconds

__version__ = "$Rev: 7162 $"


class ComponentRRDPlug(base.ComponentPlug):
    """Class to create or update a RRD file with statistics"""

    ### ComponentPlug methods

    def start(self, component):
        self._rrdpoller = None