|
|
@ -132,14 +132,16 @@ class WebRTCCamera(Thread): |
|
|
|
while True: |
|
|
|
try: |
|
|
|
item = self._queue.get() |
|
|
|
if item['sid'] == self.sid: |
|
|
|
continue |
|
|
|
if item['job'] == "connect_client": |
|
|
|
if item['sid'] == self.sid: |
|
|
|
continue |
|
|
|
if not self.pipe: |
|
|
|
self.start_global_pipeline() |
|
|
|
self.start_client_pipeline(item['sid']) |
|
|
|
self._num_clients += 1 |
|
|
|
elif item['job'] == "disconnect_client": |
|
|
|
if item['sid'] == self.sid: |
|
|
|
continue |
|
|
|
self.close_client_pipeline(item['sid']) |
|
|
|
self._num_clients -= 1 |
|
|
|
if self._num_clients == 0: |
|
|
@ -196,7 +198,7 @@ class WebRTCCamera(Thread): |
|
|
|
def emit_async(self, event, data): |
|
|
|
self._queue.put({'job':'emit', 'event':event, 'data':data}) |
|
|
|
|
|
|
|
def send_battery(val, arg): |
|
|
|
def send_battery(self, val, arg): |
|
|
|
print("sending battery value %s" % val) |
|
|
|
self.emit_async('battery', val) |
|
|
|
|
|
|
|