Beispiel #1
0
def videoChatHandler(command, args):
    global video_process
    global video_bitrate

    if len(command) > 1:
        if extended_command.is_authed(args['sender']) == 2: # Owner
            if command[1] == 'start':
                if not video_process.returncode == None:
                    watchdog.start("FFmpegCameraProcess", startVideoCapture)
            elif command[1] == 'stop':
                stopVideoCapture()
            elif command[1] == 'restart':
                restartVideoCapture()
            elif command[1] == 'bitrate':
                if len(command) > 1:
                    if len(command) == 3:
                        try:
                            int(command[2])
                            video_bitrate = command[2]
                            restartVideoCapture()
                        except ValueError: # Catch someone passing not a number
                            pass
                    networking.sendChatMessage(".Video bitrate is %s" % video_bitrate)
        else:
            networking.sendChatMessge("command only available to owner")
Beispiel #2
0
def audioChatHandler(command, args):
    global audio_process
    global audio_bitrate
    global mic_off

    if len(command) > 1:
        if extended_command.is_authed(args['sender']) == 2: # Owner
            if command[1] == 'start':
#                mic_off = False
                if audio_process.returncode != None:
                    watchdog.start("FFmpegAudioProcess", startAudioCapture)
            elif command[1] == 'stop':
                stopAudioCapture()
            elif command[1] == 'restart':
#                mic_off = False
                stopAudioCapture()
                watchdog.start("FFmpegAudioProcess", startAudioCapture)
            elif command[1] == 'bitrate':
                if len(command) > 1:
                    if len(command) == 3:
                        try:
                            int(command[2])
                            audio_bitrate = command[2]
                            restartAudioCapture()
                        except ValueError: # Catch someone passing not a number
                            pass
                    networking.sendChatMessage(".Audio bitrate is %s" % audio_bitrate)
Beispiel #3
0
def start():
    if not no_camera:
        watchdog.start("FFmpegCameraProcess", startVideoCapture)
        
    if not no_mic:
        if not mic_off:
#        watchdog.start("FFmpegAudioProcess", startAudioCapture)
            watchdog.start("FFmpegAudioProcess", startAudioCapture)
Beispiel #4
0
def start():
    if not no_camera:
        watchdog.start("FFmpegCameraProcess", startVideoCapture)
        schedule.task(90, networking.sendOnlineState, True)
        atexit.register(networking.sendOnlineState, False)

    if not no_mic:
        if not mic_off:
            #        watchdog.start("FFmpegAudioProcess", startAudioCapture)
            watchdog.start("FFmpegAudioProcess", startAudioCapture)
Beispiel #5
0
def startListenForChatServer():
    global chatSocket

    chatSocket = SocketIO(chatHostPort['host'], chatHostPort['port'], LoggingNamespace, transports='websocket')

    log.info("Connected to chat socket.io")
    chatSocket.on('chat_message_with_name', onHandleChatMessage)
    chatSocket.on('connect', onHandleChatConnect)
    chatSocket.on('reconnect', onHandleChatReconnect)
    chatSocket.on('disconnect', onHandleChatDisconnect)
    watchdog.start("ChatServerListen", waitForChatServer)
    return chatSocket
Beispiel #6
0
def startListenForMessengerServer():
    global messengerSocket

    cookie = getMessengerAuthToken()

    if not cookie.status_code == 200:
        log.error('ERROR : Messenger username / password rejected by server')
        sys.exit()

    messengerSocket = SocketIO('https://%s' % messengerHost, messengerPort, LoggingNamespace, cookies={'connect.sid': cookie.cookies['connect.sid']}, transports='websocket')

    log.info("Connected to messenger chat socket.io")
    messengerSocket.on('connect', onHandleMessengerConnect)
    messengerSocket.on('reconnect', onHandleMessengerReconnect)
    messengerSocket.on('disconnect', onHandleMessengerDisconnect)

    watchdog.start("MessengerServerListen", waitForMessengerServer)
    return messengerSocket
Beispiel #7
0
def restartAudioCapture():
    stopAudioCapture()
    if not mic_off:
        watchdog.start("FFmpegAudioProcess", startAudioCapture)
Beispiel #8
0
def restartVideoCapture(): 
    stopVideoCapture()
    watchdog.start("FFmpegCameraProcess", startVideoCapture)
Beispiel #9
0
 def run(self):
   watchdog.start()
Beispiel #10
0
def startListenForWebSocket():
    global webSocket

    watchdog.start("WebSocketListen", waitForWebSocket)
Beispiel #11
0
def startListenForChatServer():
    #   thread.start_new_thread(waitForChatServer, ())
    watchdog.start("ChatServerListen", waitForChatServer)
Beispiel #12
0
def startListenForControlServer():
    watchdog.start("ControlServerListen", waitForControlServer)
Beispiel #13
0
def startListenForAppServer():
    watchdog.start("AppServerListen", waitForAppServer)