2010년 7월 15일 목요일

Customize Android.mk for libcameraservice to use a real camera hardware not fake camera

  • Android.mk under frameworks/base/camera/libcameraservice/
LOCAL_PATH:= $(call my-dir)

#
# Set USE_CAMERA_STUB for non-emulator and non-simulator builds, if you want
# the camera service to use the fake camera. For emulator or simulator builds,
# we always use the fake camera.

ifeq ($(USE_CAMERA_STUB),)
USE_CAMERA_STUB:=false
ifneq ($(filter sooner generic sim,$(TARGET_DEVICE)),)
USE_CAMERA_STUB:=true
endif #libcamerastub
endif

ifeq ($(USE_CAMERA_STUB),true)
#
# libcamerastub
#

include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
CameraHardwareStub.cpp \
FakeCamera.cpp

LOCAL_MODULE:= libcamerastub

ifeq ($(TARGET_SIMULATOR),true)
LOCAL_CFLAGS += -DSINGLE_PROCESS
endif

LOCAL_SHARED_LIBRARIES:= libui

include $(BUILD_STATIC_LIBRARY)
else
#
# libcamera
#

include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
CameraHardware.cpp \
V4L2Camera.cpp

LOCAL_MODULE:= libcamera

LOCAL_SHARED_LIBRARIES:= \
libui \
libutils \
libcutils

LOCAL_STATIC_LIBRARIES:= \
libjpeg

LOCAL_C_INCLUDES += \
external/jpeg

include $(BUILD_STATIC_LIBRARY)
endif # USE_CAMERA_STUB

#
# libcameraservice
#

include $(CLEAR_VARS)

LOCAL_SRC_FILES:= \
CameraService.cpp

LOCAL_SHARED_LIBRARIES:= \
libui \
libutils \
libbinder \
libcutils \
libmedia

LOCAL_MODULE:= libcameraservice

LOCAL_CFLAGS += -DLOG_TAG=\"CameraService\"

ifeq ($(TARGET_SIMULATOR),true)
LOCAL_CFLAGS += -DSINGLE_PROCESS
endif

ifeq ($(USE_CAMERA_STUB), true)
LOCAL_STATIC_LIBRARIES += libcamerastub
LOCAL_CFLAGS += -include CameraHardwareStub.h
else
LOCAL_STATIC_LIBRARIES += libcamera
LOCAL_CFLAGS += -include CameraHardware.h
endif

include $(BUILD_SHARED_LIBRARY)

  • init.rc under vendor/0xlab/devkit8000
# add these lines
chown root camera /dev/video0
chmod 0660 /dev/video0

The CameraHardwareInterface class has some changes in eclair version compare to donut version; Callback functions attached to individual function are removed but are handled by predefined messages.

댓글 없음:

댓글 쓰기