From 29496e32996e5fd304608d63ed2dd19589cb57e9 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 13 Oct 2013 17:42:42 +0300 Subject: [PATCH] js framerate is now the minimum of the streaming and device framerate --- doc/todo.txt | 2 -- src/handlers.py | 3 ++- static/js/main.js | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/todo.txt b/doc/todo.txt index e7d1645..73448ee 100644 --- a/doc/todo.txt +++ b/doc/todo.txt @@ -1,5 +1,3 @@ --> js framerate should be the minimum between the two framerates - -> style scroll bars -> hint text next to section titles -> clickable hints diff --git a/src/handlers.py b/src/handlers.py index cf5a479..6c5e04c 100644 --- a/src/handlers.py +++ b/src/handlers.py @@ -355,7 +355,8 @@ class ConfigHandler(BaseHandler): 'id': camera_id, 'name': '<error>', 'enabled': False, - 'streaming_framerate': 1 + 'streaming_framerate': 1, + 'framerate': 1 }) else: diff --git a/static/js/main.js b/static/js/main.js index 2c62872..6277bd9 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -1249,10 +1249,10 @@ function recreateCameraFrames(cameras) { camera = cameras[i]; var cameraFrame = pageContainer.find('div.camera-frame#camera' + camera.id); if (cameraFrame.length === 0) { /* not existing, add a new one */ - addCameraFrameUi(camera.id, camera.name, camera.streaming_framerate); + addCameraFrameUi(camera.id, camera.name, Math.min(camera.streaming_framerate, camera.framerate)); } else { /* existing, update params */ - cameraFrame[0].framerate = camera.streaming_framerate; + cameraFrame[0].framerate = Math.min(camera.streaming_framerate, camera.framerate); } } -- 2.39.5