HTC Nexus One

This is building passion's memo :-)
IMPORTANT: I don't know it's work or not. OK, it's work fine!

Referer sites

Gingerbread Build Tips

Quick resolved linking error building 'gingerbread' for passion.
Camera HAL has been changed since gingerbread for multi-camera support.

  • undefined reference to 'HAL_openCameraHardware'
  • undefined reference to 'HAL_getCameraInfo'

How to ?

  1. mkdir -p gingerbread/myapp/libpassioncameraif
  2. copy cameraif.cpp and Android.mk.
  3. cd gingerbread/myapp/libpassioncameraif
  4. mm
  5. cd gingerbread/frameworks/base/services/camera/libcameraservice
  6. edit Android.mk
LOCAL_SHARED_LIBRARIES += libpassioncameraif  <<< add this line
include $(BUILD_SHARED_LIBRARY)

cameraif.cpp

//
//  passion-cameraif/cameraif.cpp
//    passion(froyo) 'libcamera.so' wrapper for gingerbread
//
#include <camera/CameraHardwareInterface.h>
#include <binder/MemoryBase.h>
#include <binder/MemoryHeapBase.h>
 
using namespace android;
 
// passion(froyo) libcamera.so
extern "C" sp<CameraHardwareInterface> openCameraHardware();
 
static CameraInfo sCameraInfo[] = {
    {
        CAMERA_FACING_BACK,
        90,  /* orientation */
    },
};
 
extern "C" int HAL_getNumberOfCameras()
{
    return sizeof(sCameraInfo) / sizeof(sCameraInfo[0]);
}
 
extern "C" void HAL_getCameraInfo(int cameraId, struct CameraInfo *cameraInfo)
{
    memcpy(cameraInfo, &sCameraInfo[cameraId], sizeof(CameraInfo));
}
 
extern "C" sp<CameraHardwareInterface> HAL_openCameraHardware(int /*cameraId*/)
{
    return openCameraHardware();
}

Android.mk

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
 
LOCAL_SRC_FILES:= cameraif.cpp
 
LOCAL_SHARED_LIBRARIES:= libcamera libutils liblog libcutils
LOCAL_MODULE:= libpassioncameraif
LOCAL_MODULE_TAGS := optional
LOCAL_PRELINK_MODULE := false
 
include $(BUILD_SHARED_LIBRARY)
android/nexusone.txt · 最終更新: 2010/12/22 02:29 by ldr
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0