From 7768892c82f3b037c19c608c6d8309938fd5ca21 Mon Sep 17 00:00:00 2001 From: Chih-Chung Chang Date: Mon, 10 May 2010 14:36:24 +0800 Subject: Fix for build without a hardware camera. Change-Id: Ib5a0b58ea9e02ae1df9d258de541726189147567 --- camera/libcameraservice/Android.mk | 37 +++++++++++-------------------- camera/libcameraservice/CameraService.cpp | 10 ++++----- 2 files changed, 18 insertions(+), 29 deletions(-) (limited to 'camera') 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 #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 (*OpenCameraHardwareFunction)(); static OpenCameraHardwareFunction sOpenCameraTable[] = { -#ifdef USE_CAMERA_HARDWARE +#ifdef INCLUDE_CAMERA_HARDWARE &openCameraHardware, #endif -#ifdef USE_CAMERA_STUB +#ifdef INCLUDE_CAMERA_STUB &openCameraHardwareStub, #endif }; -- cgit v1.1