while camera_id in camera_ids:
camera_id += 1
- logging.info('adding new %(prt)s camera with id %(id)s...' % {'prt': proto, 'id': camera_id})
+ logging.info('adding new %(proto)s camera with id %(id)s...' % {'proto': proto, 'id': camera_id})
# prepare a default camera config
camera_config = {'@enabled': True}
configured_devices.add(data['videodevice'])
cameras = [{'id': d[1], 'name': d[2]} for d in v4l2ctl.list_devices()
- if (d[0] not in configured_devices) and (d[1] not in configured_devices)]
+ if (d[0] not in configured_devices) and (d[1] not in configured_devices)]
self.finish_json({'cameras': cameras})
if "vc.ril.camera" not in configured_devices:
cameras = [{'id': "vc.ril.camera", 'name': "VideoCore Camera (vc.ril.camera)"}]
+
else:
- cameras = []
-
+ cameras = []
+
self.finish_json({'cameras': cameras})
else: # assuming local motionEye camera listing
self.finish_json({'cameras': cameras})
def on_response_builder(camera_id, local_config):
+
def on_response(remote_ui_config=None, error=None):
if error:
cameras.append({
'<tr>' +
'<td class="dialog-item-label"><span class="dialog-item-label">Camera Type</span></td>' +
'<td class="dialog-item-value"><select class="styled" id="typeSelect">' +
- (hasLocalCamSupport ? '<option value="v4l2">Local Camera</option>' : '') +
+ (hasLocalCamSupport ? '<option value="v4l2">Local V4L2 Camera</option>' : '') +
(hasLocalCamSupport ? '<option value="mmal">Local MMAL Camera</option>' : '') +
(hasNetCamSupport ? '<option value="netcam">Network Camera</option>' : '') +
'<option value="motioneye">Remote motionEye Camera</option>' +
else { /* assuming v4l2 */
content.find('tr.v4l2').css('display', 'table-row');
addCameraInfo.html(
- 'Local cameras are camera devices that are connected directly to your motionEye system. ' +
- 'These are usually USB webcams or board-specific cameras.');
+ 'Local V4L2 cameras are camera devices that are connected directly to your motionEye system, ' +
+ 'usually via USB.');
}
updateModalDialogPosition();
"""Tells if a camera is managed by the local motion instance."""
return bool(config.get('videodevice') or config.get('netcam_url') or config.get('mmalcam_name'))
+
def is_remote_camera(config):
"""Tells if a camera is managed by a remote motionEye server."""
return config.get('@proto') == 'motioneye'
"""Tells if a camera is a v4l2 device managed by the local motion instance."""
return bool(config.get('videodevice'))
+
def is_mmal_camera(config):
'''Tells if a camera is mmal device managed by the local motion instance.'''
return bool(config.get('mmalcam_name'))
+
def is_net_camera(config):
"""Tells if a camera is a network camera managed by the local motion instance."""
return bool(config.get('netcam_url'))