Hendrik Langer 4 years ago
parent
commit
166f68144d
  1. 6
      raspberry/roberto/camera/camera_gstreamer_webrtc.py
  2. 4
      raspberry/roberto/views/frontend/routes.py

6
raspberry/roberto/camera/camera_gstreamer_webrtc.py

@ -132,14 +132,16 @@ class WebRTCCamera(Thread):
while True:
try:
item = self._queue.get()
if item['job'] == "connect_client":
if item['sid'] == self.sid:
continue
if item['job'] == "connect_client":
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)

4
raspberry/roberto/views/frontend/routes.py

@ -1,6 +1,6 @@
from . import frontend_blueprint
from flask import current_app, render_template
from flask import current_app, render_template, send_file
from flask import Response
################
@ -44,4 +44,4 @@ def manifest_json():
@frontend_blueprint.route('/favicon.ico')
def favicon_ico():
return send_file('templates/favicon.ico', mimetype='image/x-icon')
return send_file('views/frontend/templates/favicon.ico', mimetype='image/x-icon')

Loading…
Cancel
Save