定義前後鏡:
device/fsl/sabresd_6dq/init.rc
setprop back_camera_name ov5640_mipi setprop back_camera_orient 0 setprop front_camera_name uvc,ov5642_camera,ov5640_camera setprop front_camera_orient 0hardware/imx/mx6/libcamera/CameraModule.cpp
#define FACE_BACK_CAMERA_NAME "back_camera_name" #define FACE_FRONT_CAMERA_NAME "front_camera_name" #define FACE_BACK_CAMERA_ORIENT "back_camera_orient" #define FACE_FRONT_CAMERA_ORIENT "front_camera_orient" #define UVC_NAME "uvc" static void GetCameraPropery(char *pFaceBackCameraName, char *pFaceFrontCameraName, int *pFaceBackOrient, int *pFaceFrontOrient) { char orientStr[92];透過property_get,取得init.rc裡的設定property_get(FACE_BACK_CAMERA_NAME, pFaceBackCameraName, DEFAULT_ERROR_NAME_str); property_get(FACE_BACK_CAMERA_ORIENT, orientStr, DEFAULT_ERROR_NAME_str); if (orientStr[0] == DEFAULT_ERROR_NAME) *pFaceBackOrient = 0; else *pFaceBackOrient = atoi(orientStr); ALOGI("Face Back Camera is %s, orient is %d", pFaceBackCameraName, *pFaceBackOrient); property_get(FACE_FRONT_CAMERA_NAME, pFaceFrontCameraName, DEFAULT_ERROR_NAME_str); property_get(FACE_FRONT_CAMERA_ORIENT, orientStr, DEFAULT_ERROR_NAME_str); ... ... }
沒有留言:
張貼留言