From 9db8a0fc2669c73018122887b88c523e14f404d7 Mon Sep 17 00:00:00 2001 From: Wu-cheng Li Date: Thu, 25 Jun 2009 16:48:11 +0800 Subject: [PATCH 1/3] Add preview size 384x288. --- libcamera2/QualcommCameraHardware.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libcamera2/QualcommCameraHardware.cpp b/libcamera2/QualcommCameraHardware.cpp index 3a10260..212b3f0 100644 --- a/libcamera2/QualcommCameraHardware.cpp +++ b/libcamera2/QualcommCameraHardware.cpp @@ -123,6 +123,7 @@ static preview_size_type preview_sizes[] = { { 800, 480 }, // WVGA { 640, 480 }, // VGA { 480, 320 }, // HVGA + { 384, 288 }, { 352, 288 }, // CIF { 320, 240 }, // QVGA { 240, 160 }, // SQVGA From fd3bc52cfec908c230db7a2df887c15f1c792662 Mon Sep 17 00:00:00 2001 From: Dima Zavin Date: Fri, 12 Jun 2009 15:13:14 -0700 Subject: [PATCH 2/3] copybit: also build for qsd8k --- libcopybit/Android.mk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/libcopybit/Android.mk b/libcopybit/Android.mk index f6a1b4b..f326038 100644 --- a/libcopybit/Android.mk +++ b/libcopybit/Android.mk @@ -16,6 +16,8 @@ LOCAL_PATH:= $(call my-dir) # HAL module implemenation, not prelinked and stored in # hw/..so + +ifeq ($(TARGET_BOARD_PLATFORM),msm7k) include $(CLEAR_VARS) LOCAL_PRELINK_MODULE := false LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw @@ -23,3 +25,14 @@ LOCAL_SHARED_LIBRARIES := liblog LOCAL_SRC_FILES := copybit.c LOCAL_MODULE := copybit.msm7k include $(BUILD_SHARED_LIBRARY) +endif + +ifeq ($(TARGET_BOARD_PLATFORM),qsd8k) +include $(CLEAR_VARS) +LOCAL_PRELINK_MODULE := false +LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw +LOCAL_SHARED_LIBRARIES := liblog +LOCAL_SRC_FILES := copybit.c +LOCAL_MODULE := copybit.qsd8k +include $(BUILD_SHARED_LIBRARY) +endif From 3c05a4483c4c5f9eba830fb3b626d97a68c0d4a2 Mon Sep 17 00:00:00 2001 From: Iliyan Malchev Date: Mon, 29 Jun 2009 13:09:24 -0700 Subject: [PATCH 3/3] libcamera: dlopen() libqcamera in the AF thread Signed-off-by: Iliyan Malchev --- libcamera2/QualcommCameraHardware.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/libcamera2/QualcommCameraHardware.cpp b/libcamera2/QualcommCameraHardware.cpp index 212b3f0..c5ca2cf 100644 --- a/libcamera2/QualcommCameraHardware.cpp +++ b/libcamera2/QualcommCameraHardware.cpp @@ -678,7 +678,7 @@ void QualcommCameraHardware::runFrameThread(void *data) // lifetime of this object. We do not want to dlclose() libqcamera while // LINK_cam_frame is still running. void *libhandle = ::dlopen("libqcamera.so", RTLD_NOW); - LOGV("loading libqcamera at %p", libhandle); + LOGV("FRAME: loading libqcamera at %p", libhandle); if (!libhandle) { LOGE("FATAL ERROR: could not dlopen libqcamera.so: %s", dlerror()); } @@ -1097,6 +1097,23 @@ void QualcommCameraHardware::runAutoFocus() return; } +#if DLOPEN_LIBMMCAMERA + // We need to maintain a reference to libqcamera.so for the duration of the + // AF thread, because we do not know when it will exit relative to the + // lifetime of this object. We do not want to dlclose() libqcamera while + // LINK_cam_frame is still running. + void *libhandle = ::dlopen("libqcamera.so", RTLD_NOW); + LOGV("AF: loading libqcamera at %p", libhandle); + if (!libhandle) { + LOGE("FATAL ERROR: could not dlopen libqcamera.so: %s", dlerror()); + close(mAutoFocusFd); + mAutoFocusFd = -1; + mAutoFocusThreadRunning = false; + mAutoFocusThreadLock.unlock(); + return; + } +#endif + /* This will block until either AF completes or is cancelled. */ LOGV("af start (fd %d)", mAutoFocusFd); bool status = native_set_afmode(mAutoFocusFd, AF_MODE_AUTO); @@ -1117,6 +1134,13 @@ void QualcommCameraHardware::runAutoFocus() mAutoFocusCallback = NULL; mAutoFocusCallbackCookie = NULL; mCallbackLock.unlock(); + +#if DLOPEN_LIBMMCAMERA + if (libhandle) { + ::dlclose(libhandle); + LOGV("AF: dlclose(libqcamera)"); + } +#endif } void QualcommCameraHardware::cancelAutoFocus()