def __init__(self): AGService.__init__(self) self.capabilities = [Capability(Capability.PRODUCER, Capability.VIDEO)] if IsWindows(): vic = "smash-5.2.exe" else: vic = "smash-5.2" self.executable = os.path.join(os.getcwd(), vic) self.sysConf = SystemConfig.instance() # Set configuration parameters # note: the datatype of the port parameter changes when a resource is set! self.streamname = TextParameter("streamname", "Video") self.port = TextParameter("port", "") self.encoding = OptionSetParameter("encoding", "h261", VideoProducerService.encodings) self.standard = OptionSetParameter("standard", "NTSC", VideoProducerService.standards) self.bandwidth = RangeParameter("bandwidth", 800, 0, 3072) self.framerate = RangeParameter("framerate", 24, 1, 30) self.quality = RangeParameter("quality", 75, 1, 100) self.configuration.append(self.streamname) self.configuration.append(self.port) self.configuration.append(self.encoding) self.configuration.append(self.standard) self.configuration.append(self.bandwidth) self.configuration.append(self.framerate) self.configuration.append(self.quality) self.profile = None
def __init__(self): AGService.__init__(self) self.capabilities = [Capability(Capability.PRODUCER, Capability.VIDEO)] self.executable = os.path.join(os.getcwd(), 'qtStream.app/Contents/MacOS/qtStream') self.sysConf = SystemConfig.instance() # Set configuration parameters # note: the datatype of the port parameter changes when a resource is set! self.streamname = TextParameter("streamname", "Video") self.port = TextParameter("port", "") self.encoding = OptionSetParameter("encoding", "h261", MacVideoProducerService.encodings) self.bandwidth = RangeParameter("bandwidth", 1200, 0, 3072) self.framerate = RangeParameter("framerate", 15, 1, 30) self.quality = RangeParameter("quality", 90, 1, 100) self.transmitOnStart = OptionSetParameter( "transmitonstartup", "On", MacVideoProducerService.onOffOptions) self.configuration.append(self.streamname) self.configuration.append(self.port) self.configuration.append(self.encoding) self.configuration.append(self.bandwidth) self.configuration.append(self.framerate) self.configuration.append(self.quality) self.configuration.append(self.transmitOnStart) self.profile = None
def __init__(self): AGService.__init__(self) self.log.debug("DebugService.__init__: Init Service") self.id = str(GUID()) # Set capabilities self.capabilities = [ Capability(Capability.CONSUMER, Capability.AUDIO), Capability(Capability.CONSUMER, Capability.VIDEO), Capability(Capability.PRODUCER, "debug") ] # Set executable self.executable = None # Set configuration parameters self.param1 = OptionSetParameter("Configuration Parameter 1: ", "On", ["On", "Off"]) self.param2 = RangeParameter("Configuration Parameter 2: ", 0, 0, 100) self.param3 = TextParameter("Configuration Parameter 3: ", "DebugService") self.param4 = ValueParameter("Configuration Parameter 4: ", 25) # Append parameters to the configuration list self.configuration.append(self.param1) self.configuration.append(self.param2) self.configuration.append(self.param3) self.configuration.append(self.param4)
def __init__(self): AGService.__init__(self) self.thepath = os.getcwd() self.windowGeometry = None self.capabilities = [ Capability(Capability.CONSUMER, Capability.AUDIO, "L16", 16000, self.id), Capability(Capability.CONSUMER, Capability.AUDIO, "L16", 8000, self.id), Capability(Capability.CONSUMER, Capability.AUDIO, "L8", 16000, self.id), Capability(Capability.CONSUMER, Capability.AUDIO, "L8", 8000, self.id), Capability(Capability.CONSUMER, Capability.AUDIO, "PCMU", 16000, self.id), Capability(Capability.CONSUMER, Capability.AUDIO, "PCMU", 8000, self.id), Capability(Capability.CONSUMER, Capability.AUDIO, "GSM", 16000, self.id), Capability(Capability.CONSUMER, Capability.AUDIO, "GSM", 8000, self.id), Capability(Capability.PRODUCER, Capability.AUDIO, "L16", 16000, self.id) ] if Platform.IsWindows(): rat = "rat.exe" ratmedia = "ratmedia.exe" ratui = "rat-ui.exe" ratkill = "rat-kill.exe" else: rat = "rat" ratmedia = "ratmedia" ratui = "rat-ui" ratkill = "rat-kill" self.executable = os.path.join(os.getcwd(), rat) self.rat_media = os.path.join(os.getcwd(), ratmedia) self.rat_ui = os.path.join(os.getcwd(), ratui) self.rat_kill = os.path.join(os.getcwd(), ratkill) if not os.path.isfile(self.executable): self.executable = rat self.rat_media = ratmedia self.rat_ui = ratui self.rat_kill = ratkill # For some reason, a full path is need for ratkill for dir in os.getenv("PATH").split(":"): ratkill_fullpath = os.path.join(dir, ratkill) if os.access(ratkill_fullpath, os.X_OK): self.rat_kill = ratkill_fullpath break self.sysConf = SystemConfig.instance() # Set configuration parameters self.talk = OptionSetParameter("Talk", "Off", ["On", "Off"]) self.inputGain = RangeParameter("Input Gain", 50, 0, 100) if Platform.isOSX(): self.outputGain = RangeParameter("Output Gain", 4, 0, 100) else: self.outputGain = RangeParameter("Output Gain", 50, 0, 100) self.silenceSuppression = OptionSetParameter( "Silence Suppression", "Off", ["Off", "Automatic", "Manual"]) self.positionWindow = OptionSetParameter( 'Position Window', 'Off', ['Off', 'Justify Left', 'Justify Right']) self.configuration.append(self.talk) self.configuration.append(self.inputGain) self.configuration.append(self.outputGain) self.configuration.append(self.silenceSuppression) self.configuration.append(self.positionWindow) if Platform.isLinux() or Platform.isFreeBSD(): # note: the forceOSSAC97 attribute will only exist for the above platforms self.forceOSSAC97 = OptionSetParameter("Force AC97", "False", ["True", "False"]) self.configuration.append(self.forceOSSAC97) self.useSiteId = OptionSetParameter("Use site id", "On", ["On", "Off"]) self.configuration.append(self.useSiteId) self.profile = None
def __init__(self): AGService.__init__(self) self.thepath = os.getcwd() if IsWindows(): vic = "vic.exe" else: vic = "vic" self.executable = os.path.join(os.getcwd(), vic) if not os.path.isfile(self.executable): self.executable = vic proc = subprocess.Popen([self.executable, '-Q'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) self.deviceDOM = xml.dom.minidom.parse(proc.stdout) self.encodingOptions = [] self.capabilities = [] codecs = self.deviceDOM.getElementsByTagName("codec") for codec in codecs: if codec.childNodes[0].nodeType == xml.dom.minidom.Node.TEXT_NODE: if codec.childNodes[0].data in ['h263', 'h263+', 'raw', 'pvh']: continue self.encodingOptions.append(codec.childNodes[0].data) self.capabilities.append( Capability(Capability.CONSUMER, Capability.VIDEO, codec.childNodes[0].data.upper(), 90000, self.id)) self.capabilities.append( Capability(Capability.PRODUCER, Capability.VIDEO, codec.childNodes[0].data.upper(), 90000, self.id)) self.sysConf = SystemConfig.instance() self.profile = None self.windowGeometry = None self.startPriority = '7' self.startPriorityOption.value = self.startPriority self.id = str(GUID()) self.resolution = None # Set configuration parameters # note: the datatype of the port, standard and inputsize parameters change when a resource is set! self.streamname = TextParameter("Stream Name", "") self.port = TextParameter("port", "") self.encoding = OptionSetParameter("Encoding", "mpeg4", self.encodingOptions) self.standard = TextParameter("standard", "") self.tiles = OptionSetParameter("Thumbnail Columns", "4", VideoServiceH264.tileOptions) self.bandwidth = RangeParameter("Bandwidth", 2500, 0, 10240) self.framerate = RangeParameter("Frame Rate", 24, 1, 30) self.quality = RangeParameter("Quality", 75, 1, 100) self.transmitOnStart = OptionSetParameter( "Transmit on Startup", "On", VideoServiceH264.onOffOptions) self.muteSources = OptionSetParameter("Mute Sources", "Off", VideoServiceH264.onOffOptions) self.inputsize = TextParameter("inputsize", "") self.positionWindow = OptionSetParameter( 'Position Window', 'Justify Left', ['Off', 'Justify Left', 'Justify Right']) self.encodingDeinterlacer = OptionSetParameter( "Encoding Deinterlacer", "Off", VideoServiceH264.onOffOptions) self.configuration.append(self.streamname) self.configuration.append(self.port) self.configuration.append(self.encoding) self.configuration.append(self.standard) self.configuration.append(self.tiles) self.configuration.append(self.bandwidth) self.configuration.append(self.framerate) self.configuration.append(self.quality) self.configuration.append(self.transmitOnStart) self.configuration.append(self.muteSources) self.configuration.append(self.inputsize) self.configuration.append(self.positionWindow) self.configuration.append(self.encodingDeinterlacer) if IsWindows(): try: import win32api # get number of processors systemInfo = win32api.GetSystemInfo() numprocs = systemInfo[5] self.allProcsMask = 2**numprocs - 1 self.procOptions = ['All'] for i in range(numprocs): self.procOptions.append(str(i + 1)) self.processorUsage = OptionSetParameter( "Processor usage", self.procOptions[0], self.procOptions) self.configuration.append(self.processorUsage) except: self.log.exception( 'Error initializing processor usage options') self.__GetResources() self.deviceDOM.unlink()
def __init__(self): AGService.__init__(self) self.capabilities = [ Capability(Capability.PRODUCER, Capability.VIDEO, "H261", 90000, self.id) ] if IsWindows(): vic = "vic.exe" else: vic = "vic" self.executable = os.path.join(os.getcwd(), vic) if not os.path.isfile(self.executable): self.executable = vic self.sysConf = SystemConfig.instance() self.startPriority = '5' self.startPriorityOption.value = self.startPriority self.id = str(GUID()) # Set configuration parameters # note: the datatype of the port parameter changes when a resource is set! self.streamname = TextParameter("Stream Name", "") self.port = TextParameter("Port", "") self.encoding = OptionSetParameter("Encoding", "h261", VideoProducerService.encodings) if IsWindows(): standard = "PAL" else: standard = "NTSC" self.standard = OptionSetParameter("Standard", standard, VideoProducerService.standards) self.bandwidth = RangeParameter("Bandwidth", 800, 0, 3072) self.framerate = RangeParameter("Frame Rate", 24, 1, 30) self.quality = RangeParameter("Quality", 75, 1, 100) self.configuration.append(self.streamname) self.configuration.append(self.port) self.configuration.append(self.encoding) self.configuration.append(self.standard) self.configuration.append(self.bandwidth) self.configuration.append(self.framerate) self.configuration.append(self.quality) if IsWindows(): try: import win32api # get number of processors systemInfo = win32api.GetSystemInfo() numprocs = systemInfo[5] self.allProcsMask = 2**numprocs - 1 self.procOptions = ['All'] for i in range(numprocs): self.procOptions.append(str(i + 1)) self.processorUsage = OptionSetParameter( "Processor usage", self.procOptions[0], self.procOptions) self.configuration.append(self.processorUsage) except: self.log.exception( 'Error initializing processor usage options') self.profile = None self.resource = '' self.__GetResources()
def __init__( self ): AGService.__init__( self ) self.thepath = os.getcwd() self.capabilities = [ Capability( Capability.CONSUMER, Capability.VIDEO, "H261", 90000, self.id), Capability( Capability.PRODUCER, Capability.VIDEO, "H261", 90000, self.id)] if IsWindows(): vic = "vic.exe" else: vic = "vic" self.executable = os.path.join(os.getcwd(),vic) if not os.path.isfile(self.executable): self.executable = vic self.sysConf = SystemConfig.instance() self.profile = None self.windowGeometry = None self.startPriority = '7' self.startPriorityOption.value = self.startPriority self.id = str(GUID()) # Set configuration parameters # note: the datatype of the port parameter changes when a resource is set! self.streamname = TextParameter( "Stream Name", "" ) self.port = TextParameter( "port", "" ) self.encoding = OptionSetParameter( "Encoding", "h261", VideoService.encodingOptions ) if IsWindows(): standard = "PAL" else: standard = "NTSC" self.standard = OptionSetParameter( "Standard", standard, VideoService.standardOptions ) self.tiles = OptionSetParameter( "Thumbnail Columns", "4", VideoService.tileOptions ) self.bandwidth = RangeParameter( "Bandwidth", 800, 0, 3072 ) self.framerate = RangeParameter( "Frame Rate", 24, 1, 30 ) self.quality = RangeParameter( "Quality", 75, 1, 100 ) self.transmitOnStart = OptionSetParameter( "Transmit on Startup", "On", VideoService.onOffOptions ) self.muteSources = OptionSetParameter( "Mute Sources", "Off", VideoService.onOffOptions ) self.positionWindow = OptionSetParameter( 'Position Window', 'Justify Left', ['Off', 'Justify Left', 'Justify Right']) self.configuration.append( self.streamname ) self.configuration.append( self.port ) self.configuration.append( self.encoding ) self.configuration.append( self.standard ) self.configuration.append( self.tiles ) self.configuration.append( self.bandwidth ) self.configuration.append( self.framerate ) self.configuration.append (self.quality ) self.configuration.append (self.transmitOnStart ) self.configuration.append (self.muteSources ) self.configuration.append (self.positionWindow ) if IsWindows(): try: import win32api # get number of processors systemInfo = win32api.GetSystemInfo() numprocs = systemInfo[5] self.allProcsMask = 2**numprocs-1 self.procOptions = ['All'] for i in range(numprocs): self.procOptions.append(str(i+1)) self.processorUsage = OptionSetParameter( "Processor usage", self.procOptions[0], self.procOptions ) self.configuration.append( self.processorUsage ) except: self.log.exception('Error initializing processor usage options') self.__GetResources()