diff options
author | Vladimir Chtchetkine <vchtchetkine@google.com> | 2012-01-06 10:31:41 -0800 |
---|---|---|
committer | Vladimir Chtchetkine <vchtchetkine@google.com> | 2012-01-06 10:31:41 -0800 |
commit | f8675c20db7625adc69800ca4ac54e72846ac9a8 (patch) | |
tree | e69cd28bfbf1990aa6634b209b559985ba6d3f5b /android/main.c | |
parent | d59f812d78fba533c93d3b092965872768d6d295 (diff) | |
download | external_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/main.c')
-rw-r--r-- | android/main.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/android/main.c b/android/main.c index 56ae698..1adb6a1 100644 --- a/android/main.c +++ b/android/main.c @@ -1168,9 +1168,9 @@ int main(int argc, char **argv) } } + int webcam_num = 0; if (opts->webcam != NULL) { ParamList* pl = opts->webcam; - int webcam_num = 0; for ( ; pl != NULL; pl = pl->next ) { char webcam_name[64]; char webcam_dir[16]; @@ -1229,6 +1229,18 @@ int main(int argc, char **argv) hw->hw_webcam_count = webcam_num; } + /* Command line options related to webcam, and fake camera should + * override camera emulation flag, set in AVD. */ + if (hw->hw_camera == 0) { + /* Camera emulation is disabled in AVD. Lets see if command line enables + * webcam, or fake camera emulation. */ + if (webcam_num != 0 || + (opts->fake_camera && strcmp(hw->hw_fakeCamera, "off") != 0)) { + /* Command line parameters enable camera emulation. */ + hw->hw_camera = 1; + } + } + /* physical memory is now in hw->hw_ramSize */ hw->avd_name = ASTRDUP(avdInfo_getName(avd)); |