X-Git-Url: https://git.rvb.name/vpproxy.git/blobdiff_plain/1e2c0e679beb33f10c2e551768c17ccd77576b54..1074f7e8729c2ff065d73960c5450c9356c2fd11:/vlcclient/vlcclient.py?ds=sidebyside diff --git a/vlcclient/vlcclient.py b/vlcclient/vlcclient.py index ebe83f7..dbe6f3f 100644 --- a/vlcclient/vlcclient.py +++ b/vlcclient/vlcclient.py @@ -25,8 +25,8 @@ class VlcClient(object): ''' def __init__( - self, host='127.0.0.1', port=4212, password='admin', connect_timeout=5, - result_timeout=5, out_port=8081): + self, host='127.0.0.1', port=4212, password='admin', connect_timeout=10, + result_timeout=10, out_port=8081): # Receive buffer self._recvbuffer = None # Output port @@ -98,18 +98,21 @@ class VlcClient(object): pass def _write(self, message): + + logger = logging.getLogger("VlcClient_write") + # Return if in the middle of destroying if self._shuttingDown.isSet(): return try: # Write message - print 'VLC command:',message + logger.debug('VLC command:',message) self._socket.write(message + "\r\n") except EOFError as e: raise VlcException("Vlc Write error! ERROR: " + repr(e)) - def _broadcast(self, brtype, stream_name, input=None, muxer='ts', pre_access=''): + def _broadcast(self, brtype, stream_name, input=None, muxer='ts', pre_access='', qtype='default'): if self._shuttingDown.isSet(): return @@ -127,8 +130,8 @@ class VlcClient(object): self._resultlock.acquire() # Write message to VLC socket if brtype == True: - self._write(VlcMessage.request.startBroadcast( - stream_name, input, self._out_port, muxer, pre_access)) + msg = VlcMessage.request.startBroadcast(stream_name, input, self._out_port, muxer, pre_access, qtype) + self._write(msg) else: self._write(VlcMessage.request.stopBroadcast(stream_name)) @@ -149,8 +152,9 @@ class VlcClient(object): else: logger.debug("Broadcast stopped") - def startBroadcast(self, stream_name, input, muxer='ts', pre_access=''): - return self._broadcast(True, stream_name, input, muxer, pre_access) + def startBroadcast(self, stream_name, input, muxer='ts', pre_access='', qtype='default'): + logger.debig("Starting broadcast......") + return self._broadcast(True, stream_name, input, muxer, pre_access, qtype) def stopBroadcast(self, stream_name): return self._broadcast(False, stream_name)