From 7485c2989d727a1d0c14a66fb75e140f885a1583 Mon Sep 17 00:00:00 2001 From: Vladimir Chtchetkine Date: Mon, 19 Mar 2012 11:35:29 -0700 Subject: Refactor HW config to use hw.camera_back, and hw.camera_front properties. This is a continuation of an effort to simplify HW config, and make the UI for it clearer. This CL gets rid of multiple camera emulation properties, combining everything into just two properties: - hw.camera_back that controls emulation of a camera facing back, and - hw.camera_front that controls emulation of a camera facing front. Change-Id: Ia114ae4caf2053685cbff00f39088e5b5be2952c --- vl-android.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'vl-android.c') diff --git a/vl-android.c b/vl-android.c index ebff1eb..1ec910b 100644 --- a/vl-android.c +++ b/vl-android.c @@ -3764,10 +3764,21 @@ int main(int argc, char **argv, char **envp) //android_hw_opengles_init(); /* Initialize fake camera */ - if (android_hw->hw_fakeCamera) { - boot_property_add("qemu.sf.fake_camera", android_hw->hw_fakeCamera); + if (strcmp(android_hw->hw_camera_back, "emulated") && + strcmp(android_hw->hw_camera_front, "emulated")) { + /* Fake camera is not used for camera emulation. */ + boot_property_add("qemu.sf.fake_camera", "none"); } else { - boot_property_add("qemu.sf.fake_camera", "back"); + /* Fake camera is used for at least one camera emulation. */ + if (!strcmp(android_hw->hw_camera_back, "emulated") && + !strcmp(android_hw->hw_camera_front, "emulated")) { + /* Fake camera is used for both, front and back camera emulation. */ + boot_property_add("qemu.sf.fake_camera", "both"); + } else if (!strcmp(android_hw->hw_camera_back, "emulated")) { + boot_property_add("qemu.sf.fake_camera", "back"); + } else { + boot_property_add("qemu.sf.fake_camera", "front"); + } } /* Initialize camera emulation. */ -- cgit v1.1