def startGstreamerAudio(): spawnNonDaemonProcess(reactor, TerminalEchoProcessProtocol(), '/usr/bin/python', ['python', 'gstream_audio.py']) #spawnNonDaemonProcess(reactor, TerminalEchoProcessProtocol(), '/bin/sh', ['sh', 'gstream_audio_mod.sh']) log('Started gstreamer audio')
def startAudio(): spawnNonDaemonProcess(reactor, TerminalEchoProcessProtocol(), '/opt/janus/bin/janus', ['janus', '-F', '/opt/janus/etc/janus/']) log('Started Janus') def startGstreamerAudio(): spawnNonDaemonProcess(reactor, TerminalEchoProcessProtocol(), '/bin/sh', ['sh', 'gstream_audio.sh']) log('Started gstreamer audio') reactor.callLater(2, startGstreamerAudio)
def startGstreamerVideo(self): videosrc = '/dev/video0' try: out = subprocess.check_output(['v4l2-ctl', '--list-devices']) except subprocess.CalledProcessError as e: out = e.output lines = out.splitlines() for (idx, line) in enumerate(lines): if 'bcm2835' in line: nextline = lines[idx + 1] videosrc = nextline.strip() spawnNonDaemonProcess(reactor, TerminalEchoProcessProtocol(), '/bin/sh', ['sh', 'gstream_video.sh', videosrc]) log('Started gstreamer video using device %s' % videosrc)
def __init__(self, emulator): TerminalEchoProcessProtocol.__init__(self) self.emulator = emulator
def __init__(self, app): TerminalEchoProcessProtocol.__init__(self) self.app = app
def __init__(self, prefix): TerminalEchoProcessProtocol.__init__(self) self.prefix = prefix
#!/usr/bin/python import glob from twisted.internet import reactor from twisted.internet.serialport import SerialPort from ProcessProtocolUtils import TerminalEchoProcessProtocol devices = glob.glob('/dev/ttyUSB*') SerialPort(TerminalEchoProcessProtocol(), devices[0], reactor, timeout=3) reactor.run()
def __init__(self, app): TerminalEchoProcessProtocol.__init__(self) self.motionDetected = False self.motionSustained = False self.app = app