]> www.vanbest.org Git - motioneye-debian/commitdiff
remote camera device is now presented using
authorCalin Crisan <ccrisan@gmail.com>
Sat, 26 Oct 2013 16:13:54 +0000 (19:13 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Sat, 26 Oct 2013 16:13:54 +0000 (19:13 +0300)
http://host:port/config/camera_id

doc/todo.txt
src/handlers.py
src/remote.py

index 32515b76d57cecd53961bbc00d4bbcc4ce701fee..1d151b87fce6a13f753f0c46188251141742f688 100644 (file)
@@ -1,8 +1,6 @@
 -> add an autoupdate mechanism
--> the camera is not available on page load, it is never shown afterwards - increase the timeout
 -> click to zoom on cameras
 -> make camera frames positions configurable
--> remote cameras are presented as http:///dev/video0
 -> add a view log functionality
 -> add a previewer for movies
 -> add a previewer for snapshots
index 5ec4946ec685647ff7056f782da1b0f20fcb38c5..4b25dd26bd2b714a7382288534c03205eaa36557 100644 (file)
@@ -149,6 +149,11 @@ class ConfigHandler(BaseHandler):
                     for key, value in camera_config.items():
                         remote_ui_config[key.replace('@', '')] = value
                     
+                    remote_ui_config['device'] = remote.make_remote_camera_url(
+                            camera_config.get('@host'),
+                            camera_config.get('@port'),
+                            camera_config.get('@remote_camera_id'))
+                    
                     self.finish_json(remote_ui_config)
                 
                 remote.get_config(
@@ -351,9 +356,14 @@ class ConfigHandler(BaseHandler):
             def on_response_builder(camera_id, camera_config):
                 def on_response(remote_ui_config):
                     if remote_ui_config is None:
+                        camera_url = remote.make_remote_camera_url(
+                                camera_config.get('@host'),
+                                camera_config.get('@port'),
+                                camera_config.get('@remote_camera_id'))
+                        
                         cameras.append({
                             'id': camera_id,
-                            'name': '&lt;error&gt;', # TODO add the camera url here
+                            'name': '&lt;' + camera_url + '&gt;',
                             'enabled': False,
                             'streaming_framerate': 1,
                             'framerate': 1
index 870accc0589515a2b967d93f42a07c8927c76288..3f9b1f7b1bc473ac8eaeaf15ddfa6119f3af5991 100644 (file)
@@ -25,6 +25,14 @@ def _make_request(host, port, username, password, uri, method='GET', data=None,
     return request
 
 
+def make_remote_camera_url(host, port, camera_id):
+    return '%(host)s:%(port)s/config/%(camera_id)s' % {
+        'host': host,
+        'port': port,
+        'camera_id': camera_id
+    }
+
+
 def list_cameras(host, port, username, password, callback):
     logging.debug('listing remote cameras on %(host)s:%(port)s' % {
             'host': host,