summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2010-05-10 14:36:24 +0800
committerChih-Chung Chang <chihchung@google.com>2010-05-10 14:36:24 +0800
commit7768892c82f3b037c19c608c6d8309938fd5ca21 (patch)
tree947c3641443572adf1c18b3ddb42d25fced9c9b5 /camera
parente25cc656392d8866e163f78b60c7791455d0fb44 (diff)
downloadframeworks_base-7768892c82f3b037c19c608c6d8309938fd5ca21.zip
frameworks_base-7768892c82f3b037c19c608c6d8309938fd5ca21.tar.gz
frameworks_base-7768892c82f3b037c19c608c6d8309938fd5ca21.tar.bz2
Fix for build without a hardware camera.
Change-Id: Ib5a0b58ea9e02ae1df9d258de541726189147567
Diffstat (limited to 'camera')
-rw-r--r--camera/libcameraservice/Android.mk37
-rw-r--r--camera/libcameraservice/CameraService.cpp10
2 files changed, 18 insertions, 29 deletions
diff --git a/camera/libcameraservice/Android.mk b/camera/libcameraservice/Android.mk
index a9489ac..624b23a 100644
--- a/camera/libcameraservice/Android.mk
+++ b/camera/libcameraservice/Android.mk
@@ -1,27 +1,16 @@
LOCAL_PATH:= $(call my-dir)
-# Set USE_CAMERA_STUB if you want to use the fake camera.
-# Set USE_CAMERA_HARDWARE if you want to use the hardware camera.
-# For emulator or simulator builds, we use the fake camera only by default.
-
-ifneq ($(filter sooner generic sim,$(TARGET_DEVICE)),)
- ifeq ($(USE_CAMERA_STUB),)
- USE_CAMERA_STUB:=true
- endif
- ifeq ($(USE_CAMERA_HARDWARE),)
- USE_CAMERA_HARDWARE:=false
- endif
+# Set USE_CAMERA_STUB if you don't want to use the hardware camera.
+
+ifeq ($(USE_CAMERA_STUB),true)
+ INCLUDE_CAMERA_STUB:=true
+ INCLUDE_CAMERA_HARDWARE:=false
else
-# force USE_CAMERA_STUB for testing temporarily
-# ifeq ($(USE_CAMERA_STUB),)
- USE_CAMERA_STUB:=true
-# endif
- ifeq ($(USE_CAMERA_HARDWARE),)
- USE_CAMERA_HARDWARE:=true
- endif
+ INCLUDE_CAMERA_STUB:=true # set this to true temporarily for testing
+ INCLUDE_CAMERA_HARDWARE:=true
endif
-ifeq ($(USE_CAMERA_STUB),true)
+ifeq ($(INCLUDE_CAMERA_STUB),true)
#
# libcamerastub
#
@@ -41,7 +30,7 @@ endif
LOCAL_SHARED_LIBRARIES:= libui
include $(BUILD_STATIC_LIBRARY)
-endif # USE_CAMERA_STUB
+endif # INCLUDE_CAMERA_STUB
#
# libcameraservice
@@ -67,13 +56,13 @@ ifeq ($(TARGET_SIMULATOR),true)
LOCAL_CFLAGS += -DSINGLE_PROCESS
endif
-ifeq ($(USE_CAMERA_STUB), true)
+ifeq ($(INCLUDE_CAMERA_STUB), true)
LOCAL_STATIC_LIBRARIES += libcamerastub
-LOCAL_CFLAGS += -DUSE_CAMERA_STUB
+LOCAL_CFLAGS += -DINCLUDE_CAMERA_STUB
endif
-ifeq ($(USE_CAMERA_HARDWARE),true)
-LOCAL_CFLAGS += -DUSE_CAMERA_HARDWARE
+ifeq ($(INCLUDE_CAMERA_HARDWARE),true)
+LOCAL_CFLAGS += -DINCLUDE_CAMERA_HARDWARE
LOCAL_SHARED_LIBRARIES += libcamera
endif
diff --git a/camera/libcameraservice/CameraService.cpp b/camera/libcameraservice/CameraService.cpp
index e8ab34f..4f684b7 100644
--- a/camera/libcameraservice/CameraService.cpp
+++ b/camera/libcameraservice/CameraService.cpp
@@ -37,16 +37,16 @@
#include <utils/String16.h>
#include "CameraService.h"
-#ifdef USE_CAMERA_STUB
+#ifdef INCLUDE_CAMERA_STUB
#include "CameraHardwareStub.h"
#endif
namespace android {
/* This determines the number of cameras available */
-#if defined(USE_CAMERA_HARDWARE) && defined(USE_CAMERA_STUB)
+#if defined(INCLUDE_CAMERA_HARDWARE) && defined(INCLUDE_CAMERA_STUB)
#define NUM_CAMERAS 2
-#elif defined(USE_CAMERA_HARDWARE) || defined(USE_CAMERA_STUB)
+#elif defined(INCLUDE_CAMERA_HARDWARE) || defined(INCLUDE_CAMERA_STUB)
#define NUM_CAMERAS 1
#else
#error "Should have at least one camera"
@@ -60,10 +60,10 @@ namespace android {
/* This defines the "open" function for each camera */
extern "C" typedef sp<CameraHardwareInterface> (*OpenCameraHardwareFunction)();
static OpenCameraHardwareFunction sOpenCameraTable[] = {
-#ifdef USE_CAMERA_HARDWARE
+#ifdef INCLUDE_CAMERA_HARDWARE
&openCameraHardware,
#endif
-#ifdef USE_CAMERA_STUB
+#ifdef INCLUDE_CAMERA_STUB
&openCameraHardwareStub,
#endif
};