aboutsummaryrefslogtreecommitdiffstats
path: root/android/camera
diff options
context:
space:
mode:
authorVladimir Chtchetkine <vchtchetkine@google.com>2012-01-06 10:31:41 -0800
committerVladimir Chtchetkine <vchtchetkine@google.com>2012-01-06 10:31:41 -0800
commitf8675c20db7625adc69800ca4ac54e72846ac9a8 (patch)
treee69cd28bfbf1990aa6634b209b559985ba6d3f5b /android/camera
parentd59f812d78fba533c93d3b092965872768d6d295 (diff)
downloadexternal_qemu-f8675c20db7625adc69800ca4ac54e72846ac9a8.zip
external_qemu-f8675c20db7625adc69800ca4ac54e72846ac9a8.tar.gz
external_qemu-f8675c20db7625adc69800ca4ac54e72846ac9a8.tar.bz2
Respect 'camera' flag in AVD
Turns of webcam emulation on condition that 'camera' AVD property is set to 'false'. Note that command line options (-webcam) will enable webcam emulation even if 'camera' AVD property is set to 'false' Change-Id: I493446f1d12b732ed49f9a5a9967b87b31b180f6
Diffstat (limited to 'android/camera')
-rw-r--r--android/camera/camera-service.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/android/camera/camera-service.c b/android/camera/camera-service.c
index 8f0e2ec..69b9524 100644
--- a/android/camera/camera-service.c
+++ b/android/camera/camera-service.c
@@ -438,6 +438,12 @@ _camera_service_init(CameraServiceDesc* csd)
memset(ci, 0, sizeof(CameraInfo) * MAX_CAMERA);
memset(csd->camera_info, 0, sizeof(CameraInfo) * MAX_CAMERA);
csd->camera_count = 0;
+
+ if (android_hw->hw_camera == 0) {
+ /* Camera emulation is disabled. Skip enumeration of webcameras. */
+ return;
+ }
+
connected_cnt = enumerate_camera_devices(ci, MAX_CAMERA);
if (connected_cnt <= 0) {
/* Nothing is connected - nothing to emulate. */