Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adjust camera HAL source to build with our setup

  * need to copy prebuilt libcamera to :obj/lib/ and :system/lib/
  • Loading branch information...
commit c63e35e751fe437cc910de57fc09392c2578b306 1 parent 3fb54dc
@MongooseHelix MongooseHelix authored
View
14 Android.mk
@@ -1,5 +1,5 @@
LOCAL_PATH := $(call my-dir)
-LIBCAMERA_BUILD := nexus
+
include $(call all-subdir-makefiles)
include $(CLEAR_VARS)
@@ -7,17 +7,15 @@ include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
LOCAL_MODULE := camera.$(TARGET_BOARD_PLATFORM)
-LOCAL_SRC_FILES := cameraHal.cpp
-LOCAL_PRELINK_MODULE := false
-CAMERA_LIB := camera-inc
-ifeq ($(LIBCAMERA_BUILD),nexus)
-CAMERA_LIB := camera-nexus
-endif
+LOCAL_SRC_FILES := cameraHal.cpp
-TARGET_GLOBAL_LD_DIRS += -L$(LOCAL_PATH) -l${CAMERA_LIB}
+TARGET_GLOBAL_LD_DIRS += -L$(LOCAL_PATH)
LOCAL_SHARED_LIBRARIES := liblog libdl libutils libcamera_client libbinder libcutils libhardware
+LOCAL_SHARED_LIBRARIES += libcamera
LOCAL_C_INCLUDES := frameworks/base/services/ frameworks/base/include
LOCAL_C_INCLUDES += hardware/libhardware/include/ hardware/libhardware/modules/gralloc/
+LOCAL_PRELINK_MODULE := false
+
include $(BUILD_SHARED_LIBRARY)
View
1  README
@@ -1 +0,0 @@
-This directory contains code for the ICS Camera HAL
View
3  cameraHal.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#define LOG_NDEBUG 0
#define LOG_TAG "CameraHAL"
#include <CameraHardwareInterface.h>
@@ -124,7 +125,7 @@ CameraHAL_CopyBuffers_Hw(int srcFd, int destFd,
LOGV("CameraHAL_CopyBuffers_Hw: srcFD:%d destFD:%d srcOffset:%#x"
" destOffset:%#x x:%d y:%d w:%d h:%d\n", srcFd, destFd, srcOffset,
- dstOffset, x, y, w, h);
+ destOffset, x, y, w, h);
memset(&blit, 0, sizeof(blit));
blit.count = 1;
View
BIN  libcamera-nexus.so
Binary file not shown

3 comments on commit c63e35e

@mantera

When you build with your setup with these HAL camera files, do you get errors such as this?

prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld: out/target/product/triumph/obj/SHARED_LIBRARIES/camera.msm7x30_intermediates/cameraHal.o: in function qcamera_device_open(hw_module_t const, char const, hw_device_t**):hardware/qcom/camera/cameraHal.cpp:589: error: undefined reference to 'openCameraHardware'

If so, how did you fix it? Thanks for your help.

@MongooseHelix

Since it looks like you are building for a msm7x30 device, you will most likely want to use the following hacked up camera HAL:
http://forum.xda-developers.com/showthread.php?t=1448303

Also see these posts:
http://forum.xda-developers.com/showpost.php?p=21728373&postcount=122
http://forum.xda-developers.com/showpost.php?p=21734698&postcount=125

I imagine the error you are getting is due to the libcamera.so you are using to build with but not positive about that.

@mantera
Please sign in to comment.
Something went wrong with that request. Please try again.