mirror of
https://github.com/S3NEO/android_device_samsung_msm8226-common.git
synced 2024-11-06 21:55:45 +00:00
camera: use standart stuff and use camera wrapper from 8930-common
back camera still works with this config
This commit is contained in:
parent
c5c5560011
commit
5566bf18f6
2 changed files with 258 additions and 259 deletions
|
@ -1,7 +1,6 @@
|
||||||
# Camera
|
# Camera
|
||||||
BOARD_CAMERA_SENSORS := s5k4h5_8196 imx175 # Dont know if s5k4h5_8226 exists
|
TARGET_HAS_LEGACY_CAMERA_HAL1 := true
|
||||||
BOARD_GLOBAL_CFLAGS += -DCAMERA_VENDOR_L_COMPAT # Do we really need this???
|
|
||||||
|
|
||||||
TARGET_NEEDS_PLATFORM_TEXT_RELOCATIONS := true
|
|
||||||
TARGET_USE_COMPAT_GRALLOC_ALIGN := true
|
|
||||||
TARGET_PROVIDES_CAMERA_HAL := true
|
TARGET_PROVIDES_CAMERA_HAL := true
|
||||||
|
USE_DEVICE_SPECIFIC_CAMERA := true
|
||||||
|
#Faceproc needs this to load
|
||||||
|
TARGET_NEEDS_PLATFORM_TEXT_RELOCATIONS := true
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2014, The CyanogenMod Project
|
* Copyright (C) 2013-2016, The CyanogenMod Project
|
||||||
|
* Copyright (C) 2017, The LineageOS Project
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -21,89 +22,97 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define LOG_NDEBUG 0
|
//#define LOG_NDEBUG 0
|
||||||
|
|
||||||
#define LOG_TAG "CameraWrapper"
|
#define LOG_TAG "CameraWrapper"
|
||||||
#include <cutils/log.h>
|
#include <cutils/log.h>
|
||||||
|
|
||||||
#include <utils/threads.h>
|
|
||||||
#include <utils/String8.h>
|
|
||||||
#include <hardware/hardware.h>
|
|
||||||
#include <hardware/camera.h>
|
|
||||||
#include <camera/Camera.h>
|
#include <camera/Camera.h>
|
||||||
#include <camera/CameraParameters2.h>
|
#include <camera/CameraParameters.h>
|
||||||
|
#include <hardware/camera.h>
|
||||||
|
#include <hardware/hardware.h>
|
||||||
|
#include <utils/String8.h>
|
||||||
|
#include <utils/threads.h>
|
||||||
|
|
||||||
static android::Mutex gCameraWrapperLock;
|
static android::Mutex gCameraWrapperLock;
|
||||||
static camera_module_t *gVendorModule = 0;
|
static camera_module_t* gVendorModule = 0;
|
||||||
|
|
||||||
static char **fixed_set_params = NULL;
|
static char** fixed_set_params = NULL;
|
||||||
|
|
||||||
static int camera_device_open(const hw_module_t *module, const char *name,
|
static int camera_device_open(const hw_module_t* module, const char* name, hw_device_t** device);
|
||||||
hw_device_t **device);
|
|
||||||
static int camera_get_number_of_cameras(void);
|
static int camera_get_number_of_cameras(void);
|
||||||
static int camera_get_camera_info(int camera_id, struct camera_info *info);
|
static int camera_get_camera_info(int camera_id, struct camera_info* info);
|
||||||
static int camera_send_command(struct camera_device *device, int32_t cmd,
|
static int camera_send_command(struct camera_device* device, int32_t cmd, int32_t arg1,
|
||||||
int32_t arg1, int32_t arg2);
|
int32_t arg2);
|
||||||
|
|
||||||
static struct hw_module_methods_t camera_module_methods = {
|
static struct hw_module_methods_t camera_module_methods = {
|
||||||
.open = camera_device_open
|
.open = camera_device_open,
|
||||||
};
|
};
|
||||||
|
|
||||||
camera_module_t HAL_MODULE_INFO_SYM = {
|
camera_module_t HAL_MODULE_INFO_SYM = {
|
||||||
.common = {
|
.common =
|
||||||
.tag = HARDWARE_MODULE_TAG,
|
{
|
||||||
.module_api_version = CAMERA_MODULE_API_VERSION_1_0,
|
.tag = HARDWARE_MODULE_TAG,
|
||||||
.hal_api_version = HARDWARE_HAL_API_VERSION,
|
.module_api_version = CAMERA_MODULE_API_VERSION_1_0,
|
||||||
.id = CAMERA_HARDWARE_MODULE_ID,
|
.hal_api_version = HARDWARE_HAL_API_VERSION,
|
||||||
.name = "Samsung MSM8226 Camera Wrapper",
|
.id = CAMERA_HARDWARE_MODULE_ID,
|
||||||
.author = "The CyanogenMod Project",
|
.name = "Samsung msm8226 Camera Wrapper",
|
||||||
.methods = &camera_module_methods,
|
.author = "The CyanogenMod Project",
|
||||||
.dso = NULL, /* remove compilation warnings */
|
.methods = &camera_module_methods,
|
||||||
.reserved = {0}, /* remove compilation warnings */
|
.dso = NULL, /* remove compilation warnings */
|
||||||
},
|
.reserved = {0}, /* remove compilation warnings */
|
||||||
|
},
|
||||||
|
|
||||||
.get_number_of_cameras = camera_get_number_of_cameras,
|
.get_number_of_cameras = camera_get_number_of_cameras,
|
||||||
.get_camera_info = camera_get_camera_info,
|
.get_camera_info = camera_get_camera_info,
|
||||||
.set_callbacks = NULL, /* remove compilation warnings */
|
.set_callbacks = NULL, /* remove compilation warnings */
|
||||||
.get_vendor_tag_ops = NULL, /* remove compilation warnings */
|
.get_vendor_tag_ops = NULL, /* remove compilation warnings */
|
||||||
.open_legacy = NULL, /* remove compilation warnings */
|
.open_legacy = NULL, /* remove compilation warnings */
|
||||||
.reserved = {0}, /* remove compilation warnings */
|
.set_torch_mode = NULL, /* remove compilation warnings */
|
||||||
|
.init = NULL, /* remove compilation warnings */
|
||||||
|
.reserved = {0}, /* remove compilation warnings */
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct wrapper_camera_device {
|
typedef struct wrapper_camera_device {
|
||||||
camera_device_t base;
|
camera_device_t base;
|
||||||
int id;
|
int id;
|
||||||
camera_device_t *vendor;
|
camera_device_t* vendor;
|
||||||
} wrapper_camera_device_t;
|
} wrapper_camera_device_t;
|
||||||
|
|
||||||
#define VENDOR_CALL(device, func, ...) ({ \
|
#define VENDOR_CALL(device, func, ...) \
|
||||||
wrapper_camera_device_t *__wrapper_dev = (wrapper_camera_device_t*) device; \
|
({ \
|
||||||
__wrapper_dev->vendor->ops->func(__wrapper_dev->vendor, ##__VA_ARGS__); \
|
wrapper_camera_device_t* __wrapper_dev = (wrapper_camera_device_t*)device; \
|
||||||
})
|
__wrapper_dev->vendor->ops->func(__wrapper_dev->vendor, ##__VA_ARGS__); \
|
||||||
|
})
|
||||||
|
|
||||||
#define CAMERA_ID(device) (((wrapper_camera_device_t *)(device))->id)
|
#define CAMERA_ID(device) (((wrapper_camera_device_t*)(device))->id)
|
||||||
|
|
||||||
static int check_vendor_module()
|
static int check_vendor_module() {
|
||||||
{
|
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
ALOGV("%s", __FUNCTION__);
|
ALOGV("%s", __FUNCTION__);
|
||||||
|
|
||||||
if (gVendorModule)
|
if (gVendorModule) return 0;
|
||||||
return 0;
|
|
||||||
|
|
||||||
rv = hw_get_module_by_class("camera", "vendor",
|
rv = hw_get_module_by_class("camera", "vendor", (const hw_module_t**)&gVendorModule);
|
||||||
(const hw_module_t **)&gVendorModule);
|
if (rv) ALOGE("failed to open vendor camera module");
|
||||||
|
|
||||||
if (rv)
|
|
||||||
ALOGE("failed to open vendor camera module");
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define KEY_VIDEO_HFR_VALUES "video-hfr-values"
|
const static char* iso_values[] = {
|
||||||
|
"auto,"
|
||||||
|
#ifdef ISO_MODE_50
|
||||||
|
"ISO50,"
|
||||||
|
#endif
|
||||||
|
#ifdef ISO_MODE_HJR
|
||||||
|
"ISO_HJR,"
|
||||||
|
#endif
|
||||||
|
"ISO100,ISO200,ISO400,ISO800"
|
||||||
|
#ifdef ISO_MODE_1600
|
||||||
|
",ISO1600"
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
const static char * iso_values[] = {"auto,ISO_HJR,ISO100,ISO200,ISO400,ISO800,ISO1600,auto"};
|
static char* camera_fixup_getparams(int id, const char* settings) {
|
||||||
|
|
||||||
static char *camera_fixup_getparams(int id, const char *settings)
|
|
||||||
{
|
|
||||||
android::CameraParameters params;
|
android::CameraParameters params;
|
||||||
params.unflatten(android::String8(settings));
|
params.unflatten(android::String8(settings));
|
||||||
|
|
||||||
|
@ -112,63 +121,77 @@ static char *camera_fixup_getparams(int id, const char *settings)
|
||||||
params.dump();
|
params.dump();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// fix params here
|
|
||||||
params.set(android::CameraParameters::KEY_SUPPORTED_ISO_MODES, iso_values[id]);
|
params.set(android::CameraParameters::KEY_SUPPORTED_ISO_MODES, iso_values[id]);
|
||||||
params.set(android::CameraParameters::KEY_EXPOSURE_COMPENSATION_STEP, "0.5");
|
params.set(android::CameraParameters::KEY_PREFERRED_PREVIEW_SIZE_FOR_VIDEO, "1280x720");
|
||||||
params.set(android::CameraParameters::KEY_MIN_EXPOSURE_COMPENSATION, "-4");
|
params.set(android::CameraParameters::KEY_SUPPORTED_SCENE_MODES,
|
||||||
params.set(android::CameraParameters::KEY_MAX_EXPOSURE_COMPENSATION, "4");
|
"auto,asd,action,portrait,landscape,night,night-portrait,theatre,beach,snow,sunset,"
|
||||||
|
"steadyphoto,fireworks,sports,party,candlelight,backlight,flowers,AR");
|
||||||
|
|
||||||
/* If the vendor has HFR values but doesn't also expose that
|
#ifdef FFC_PICTURE_FIXUP
|
||||||
* this can be turned off, fixup the params to tell the Camera
|
if (id == 1) {
|
||||||
* that it really is okay to turn it off.
|
params.set(android::CameraParameters::KEY_SUPPORTED_PICTURE_SIZES,
|
||||||
*/
|
"1392x1392,1280x720,640x480");
|
||||||
const char *hfrValues = params.get(KEY_VIDEO_HFR_VALUES);
|
|
||||||
if (hfrValues && *hfrValues && ! strstr(hfrValues, "off")) {
|
|
||||||
char tmp[strlen(hfrValues) + 4 + 1];
|
|
||||||
sprintf(tmp, "%s,off", hfrValues);
|
|
||||||
params.set(KEY_VIDEO_HFR_VALUES, tmp);
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef FFC_VIDEO_FIXUP
|
||||||
|
if (id == 1) {
|
||||||
|
if (!params.get(android::CameraParameters::KEY_SUPPORTED_VIDEO_SIZES)) {
|
||||||
|
params.set(android::CameraParameters::KEY_SUPPORTED_VIDEO_SIZES,
|
||||||
|
"1280x720,640x480,320x240,176x144");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Enforce video-snapshot-supported to true */
|
#ifdef DISABLE_FACE_DETECTION
|
||||||
params.set(android::CameraParameters::KEY_VIDEO_SNAPSHOT_SUPPORTED, "true");
|
#ifndef DISABLE_FACE_DETECTION_BOTH_CAMERAS
|
||||||
|
/* Disable face detection for front facing camera */
|
||||||
android::String8 strParams = params.flatten();
|
if (id == 1) {
|
||||||
char *ret = strdup(strParams.string());
|
#endif
|
||||||
|
params.remove(android::CameraParameters::KEY_QC_FACE_RECOGNITION);
|
||||||
|
params.remove(android::CameraParameters::KEY_QC_SUPPORTED_FACE_RECOGNITION);
|
||||||
|
params.remove(android::CameraParameters::KEY_QC_SUPPORTED_FACE_RECOGNITION_MODES);
|
||||||
|
params.remove(android::CameraParameters::KEY_QC_FACE_DETECTION);
|
||||||
|
params.remove(android::CameraParameters::KEY_QC_SUPPORTED_FACE_DETECTION);
|
||||||
|
params.remove(android::CameraParameters::KEY_FACE_DETECTION);
|
||||||
|
params.remove(android::CameraParameters::KEY_SUPPORTED_FACE_DETECTION);
|
||||||
|
#ifndef DISABLE_FACE_DETECTION_BOTH_CAMERAS
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !LOG_NDEBUG
|
#if !LOG_NDEBUG
|
||||||
ALOGV("%s: fixed parameters:", __FUNCTION__);
|
ALOGV("%s: fixed parameters:", __FUNCTION__);
|
||||||
params.dump();
|
params.dump();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
android::String8 strParams = params.flatten();
|
||||||
|
char* ret = strdup(strParams.string());
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *camera_fixup_setparams(struct camera_device *device, const char *settings)
|
static bool wasVideo = false;
|
||||||
{
|
|
||||||
|
static char* camera_fixup_setparams(struct camera_device* device, const char* settings) {
|
||||||
int id = CAMERA_ID(device);
|
int id = CAMERA_ID(device);
|
||||||
android::CameraParameters params;
|
android::CameraParameters params;
|
||||||
params.unflatten(android::String8(settings));
|
params.unflatten(android::String8(settings));
|
||||||
|
const char* camMode = params.get(android::CameraParameters::KEY_SAMSUNG_CAMERA_MODE);
|
||||||
|
|
||||||
|
const char* recordingHint = params.get(android::CameraParameters::KEY_RECORDING_HINT);
|
||||||
|
bool isVideo = false;
|
||||||
|
if (recordingHint) isVideo = !strcmp(recordingHint, "true");
|
||||||
|
|
||||||
#if !LOG_NDEBUG
|
#if !LOG_NDEBUG
|
||||||
ALOGV("%s: original parameters:", __FUNCTION__);
|
ALOGV("%s: original parameters:", __FUNCTION__);
|
||||||
params.dump();
|
params.dump();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const char *recordingHint = params.get(android::CameraParameters::KEY_RECORDING_HINT);
|
|
||||||
bool isVideo = recordingHint && !strcmp(recordingHint, "true");
|
|
||||||
|
|
||||||
if (isVideo) {
|
|
||||||
params.set(android::CameraParameters::KEY_DIS, android::CameraParameters::DIS_DISABLE);
|
|
||||||
params.set(android::CameraParameters::KEY_ZSL, android::CameraParameters::ZSL_OFF);
|
|
||||||
} else {
|
|
||||||
params.set(android::CameraParameters::KEY_ZSL, android::CameraParameters::ZSL_ON);
|
|
||||||
}
|
|
||||||
|
|
||||||
// fix params here
|
|
||||||
// No need to fix-up ISO_HJR, it is the same for userspace and the camera lib
|
|
||||||
if (params.get("iso")) {
|
if (params.get("iso")) {
|
||||||
const char *isoMode = params.get(android::CameraParameters::KEY_ISO_MODE);
|
const char* isoMode = params.get(android::CameraParameters::KEY_ISO_MODE);
|
||||||
if (strcmp(isoMode, "ISO100") == 0)
|
if (strcmp(isoMode, "ISO50") == 0)
|
||||||
|
params.set(android::CameraParameters::KEY_ISO_MODE, "50");
|
||||||
|
else if (strcmp(isoMode, "ISO100") == 0)
|
||||||
params.set(android::CameraParameters::KEY_ISO_MODE, "100");
|
params.set(android::CameraParameters::KEY_ISO_MODE, "100");
|
||||||
else if (strcmp(isoMode, "ISO200") == 0)
|
else if (strcmp(isoMode, "ISO200") == 0)
|
||||||
params.set(android::CameraParameters::KEY_ISO_MODE, "200");
|
params.set(android::CameraParameters::KEY_ISO_MODE, "200");
|
||||||
|
@ -180,18 +203,48 @@ static char *camera_fixup_setparams(struct camera_device *device, const char *se
|
||||||
params.set(android::CameraParameters::KEY_ISO_MODE, "1600");
|
params.set(android::CameraParameters::KEY_ISO_MODE, "1600");
|
||||||
}
|
}
|
||||||
|
|
||||||
android::String8 strParams = params.flatten();
|
#ifdef SAMSUNG_CAMERA_MODE
|
||||||
|
/* Samsung camcorder mode */
|
||||||
if (fixed_set_params[id])
|
if (id == 1) {
|
||||||
free(fixed_set_params[id]);
|
/* Enable for front camera only */
|
||||||
fixed_set_params[id] = strdup(strParams.string());
|
if (!(!strcmp(camMode, "1") && !isVideo) || wasVideo) {
|
||||||
char *ret = fixed_set_params[id];
|
/* Enable only if not already set (Snapchat) but do enable if the setting is left
|
||||||
|
over while switching from stills to video */
|
||||||
|
if ((!strcmp(params.get(android::CameraParameters::KEY_PREVIEW_FRAME_RATE), "15") ||
|
||||||
|
(!strcmp(params.get(android::CameraParameters::KEY_PREVIEW_SIZE), "320x240") &&
|
||||||
|
!strcmp(params.get(android::CameraParameters::KEY_JPEG_QUALITY), "96"))) &&
|
||||||
|
!isVideo) {
|
||||||
|
/* Do not set for video chat in Hangouts (Frame rate 15) or Skype (Preview size
|
||||||
|
320x240 and jpeg quality 96 */
|
||||||
|
} else {
|
||||||
|
/* "Normal case". Required to prevent distorted video and reboots
|
||||||
|
while taking snaps */
|
||||||
|
params.set(android::CameraParameters::KEY_SAMSUNG_CAMERA_MODE, isVideo ? "1" : "0");
|
||||||
|
}
|
||||||
|
wasVideo = (isVideo || wasVideo);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
wasVideo = false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef ENABLE_ZSL
|
||||||
|
if (id != 1) {
|
||||||
|
params.set(android::CameraParameters::KEY_ZSL, isVideo ? "off" : "on");
|
||||||
|
params.set(android::CameraParameters::KEY_CAMERA_MODE, isVideo ? "0" : "1");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if !LOG_NDEBUG
|
#if !LOG_NDEBUG
|
||||||
ALOGV("%s: fixed parameters:", __FUNCTION__);
|
ALOGV("%s: fixed parameters:", __FUNCTION__);
|
||||||
params.dump();
|
params.dump();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
android::String8 strParams = params.flatten();
|
||||||
|
|
||||||
|
if (fixed_set_params[id]) free(fixed_set_params[id]);
|
||||||
|
fixed_set_params[id] = strdup(strParams.string());
|
||||||
|
char* ret = fixed_set_params[id];
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,285 +252,240 @@ static char *camera_fixup_setparams(struct camera_device *device, const char *se
|
||||||
* implementation of camera_device_ops functions
|
* implementation of camera_device_ops functions
|
||||||
*******************************************************************/
|
*******************************************************************/
|
||||||
|
|
||||||
static int camera_set_preview_window(struct camera_device *device,
|
static int camera_set_preview_window(struct camera_device* device,
|
||||||
struct preview_stream_ops *window)
|
struct preview_stream_ops* window) {
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return -EINVAL;
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
return VENDOR_CALL(device, set_preview_window, window);
|
return VENDOR_CALL(device, set_preview_window, window);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void camera_set_callbacks(struct camera_device *device,
|
static void camera_set_callbacks(struct camera_device* device, camera_notify_callback notify_cb,
|
||||||
camera_notify_callback notify_cb,
|
camera_data_callback data_cb,
|
||||||
camera_data_callback data_cb,
|
camera_data_timestamp_callback data_cb_timestamp,
|
||||||
camera_data_timestamp_callback data_cb_timestamp,
|
camera_request_memory get_memory, void* user) {
|
||||||
camera_request_memory get_memory,
|
|
||||||
void *user)
|
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return;
|
||||||
return;
|
|
||||||
|
|
||||||
VENDOR_CALL(device, set_callbacks, notify_cb, data_cb, data_cb_timestamp, get_memory, user);
|
VENDOR_CALL(device, set_callbacks, notify_cb, data_cb, data_cb_timestamp, get_memory, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void camera_enable_msg_type(struct camera_device *device,
|
static void camera_enable_msg_type(struct camera_device* device, int32_t msg_type) {
|
||||||
int32_t msg_type)
|
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return;
|
||||||
return;
|
|
||||||
|
|
||||||
VENDOR_CALL(device, enable_msg_type, msg_type);
|
VENDOR_CALL(device, enable_msg_type, msg_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void camera_disable_msg_type(struct camera_device *device,
|
static void camera_disable_msg_type(struct camera_device* device, int32_t msg_type) {
|
||||||
int32_t msg_type)
|
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return;
|
||||||
return;
|
|
||||||
|
|
||||||
VENDOR_CALL(device, disable_msg_type, msg_type);
|
VENDOR_CALL(device, disable_msg_type, msg_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int camera_msg_type_enabled(struct camera_device *device,
|
static int camera_msg_type_enabled(struct camera_device* device, int32_t msg_type) {
|
||||||
int32_t msg_type)
|
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return 0;
|
||||||
return 0;
|
|
||||||
|
|
||||||
return VENDOR_CALL(device, msg_type_enabled, msg_type);
|
return VENDOR_CALL(device, msg_type_enabled, msg_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int camera_start_preview(struct camera_device *device)
|
static int camera_start_preview(struct camera_device* device) {
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return -EINVAL;
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
return VENDOR_CALL(device, start_preview);
|
return VENDOR_CALL(device, start_preview);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void camera_stop_preview(struct camera_device *device)
|
static void camera_stop_preview(struct camera_device* device) {
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return;
|
||||||
return;
|
|
||||||
|
|
||||||
VENDOR_CALL(device, stop_preview);
|
VENDOR_CALL(device, stop_preview);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int camera_preview_enabled(struct camera_device *device)
|
static int camera_preview_enabled(struct camera_device* device) {
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return -EINVAL;
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
return VENDOR_CALL(device, preview_enabled);
|
return VENDOR_CALL(device, preview_enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int camera_store_meta_data_in_buffers(struct camera_device *device,
|
static int camera_store_meta_data_in_buffers(struct camera_device* device, int enable) {
|
||||||
int enable)
|
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return -EINVAL;
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
return VENDOR_CALL(device, store_meta_data_in_buffers, enable);
|
return VENDOR_CALL(device, store_meta_data_in_buffers, enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int camera_start_recording(struct camera_device *device)
|
static int camera_start_recording(struct camera_device* device) {
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return EINVAL;
|
||||||
return EINVAL;
|
|
||||||
|
|
||||||
return VENDOR_CALL(device, start_recording);
|
return VENDOR_CALL(device, start_recording);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void camera_stop_recording(struct camera_device *device)
|
static void camera_stop_recording(struct camera_device* device) {
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return;
|
||||||
return;
|
|
||||||
|
|
||||||
VENDOR_CALL(device, stop_recording);
|
VENDOR_CALL(device, stop_recording);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int camera_recording_enabled(struct camera_device *device)
|
static int camera_recording_enabled(struct camera_device* device) {
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return -EINVAL;
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
return VENDOR_CALL(device, recording_enabled);
|
return VENDOR_CALL(device, recording_enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void camera_release_recording_frame(struct camera_device *device,
|
static void camera_release_recording_frame(struct camera_device* device, const void* opaque) {
|
||||||
const void *opaque)
|
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return;
|
||||||
return;
|
|
||||||
|
|
||||||
VENDOR_CALL(device, release_recording_frame, opaque);
|
VENDOR_CALL(device, release_recording_frame, opaque);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int camera_auto_focus(struct camera_device *device)
|
static int camera_auto_focus(struct camera_device* device) {
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return -EINVAL;
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
return VENDOR_CALL(device, auto_focus);
|
return VENDOR_CALL(device, auto_focus);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int camera_cancel_auto_focus(struct camera_device *device)
|
static int camera_cancel_auto_focus(struct camera_device* device) {
|
||||||
{
|
int ret = 0;
|
||||||
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return -EINVAL;
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
return VENDOR_CALL(device, cancel_auto_focus);
|
/* APEXQ/EXPRESS: Calling cancel_auto_focus causes the camera to crash for unknown reasons.
|
||||||
|
* Disabling it has no adverse effect. For others, only call cancel_auto_focus when the
|
||||||
|
* preview is enabled. This is needed so some 3rd party camera apps don't lock up. */
|
||||||
|
#ifndef DISABLE_AUTOFOCUS
|
||||||
|
if (camera_preview_enabled(device)) ret = VENDOR_CALL(device, cancel_auto_focus);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int camera_take_picture(struct camera_device *device)
|
static int camera_take_picture(struct camera_device* device) {
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return -EINVAL;
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
return VENDOR_CALL(device, take_picture);
|
return VENDOR_CALL(device, take_picture);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int camera_cancel_picture(struct camera_device *device)
|
static int camera_cancel_picture(struct camera_device* device) {
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return -EINVAL;
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
return VENDOR_CALL(device, cancel_picture);
|
return VENDOR_CALL(device, cancel_picture);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int camera_set_parameters(struct camera_device *device, const char *params)
|
static int camera_set_parameters(struct camera_device* device, const char* params) {
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return -EINVAL;
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
char *tmp = NULL;
|
char* tmp = NULL;
|
||||||
tmp = camera_fixup_setparams(device, params);
|
tmp = camera_fixup_setparams(device, params);
|
||||||
|
|
||||||
int ret = VENDOR_CALL(device, set_parameters, tmp);
|
int ret = VENDOR_CALL(device, set_parameters, tmp);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *camera_get_parameters(struct camera_device *device)
|
static char* camera_get_parameters(struct camera_device* device) {
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return NULL;
|
||||||
return NULL;
|
|
||||||
|
|
||||||
char *params = VENDOR_CALL(device, get_parameters);
|
char* params = VENDOR_CALL(device, get_parameters);
|
||||||
|
|
||||||
char *tmp = camera_fixup_getparams(CAMERA_ID(device), params);
|
char* tmp = camera_fixup_getparams(CAMERA_ID(device), params);
|
||||||
VENDOR_CALL(device, put_parameters, params);
|
VENDOR_CALL(device, put_parameters, params);
|
||||||
params = tmp;
|
params = tmp;
|
||||||
|
|
||||||
return params;
|
return params;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void camera_put_parameters(struct camera_device *device, char *params)
|
static void camera_put_parameters(struct camera_device* device, char* params) {
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (params)
|
if (params) free(params);
|
||||||
free(params);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int camera_send_command(struct camera_device *device,
|
static int camera_send_command(struct camera_device* device, int32_t cmd, int32_t arg1,
|
||||||
int32_t cmd, int32_t arg1, int32_t arg2)
|
int32_t arg2) {
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return -EINVAL;
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
return VENDOR_CALL(device, send_command, cmd, arg1, arg2);
|
return VENDOR_CALL(device, send_command, cmd, arg1, arg2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void camera_release(struct camera_device *device)
|
static void camera_release(struct camera_device* device) {
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return;
|
||||||
return;
|
|
||||||
|
|
||||||
VENDOR_CALL(device, release);
|
VENDOR_CALL(device, release);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int camera_dump(struct camera_device *device, int fd)
|
static int camera_dump(struct camera_device* device, int fd) {
|
||||||
{
|
|
||||||
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
ALOGV("%s->%08X->%08X", __FUNCTION__, (uintptr_t)device,
|
||||||
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
(uintptr_t)(((wrapper_camera_device_t*)device)->vendor));
|
||||||
|
|
||||||
if (!device)
|
if (!device) return -EINVAL;
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
return VENDOR_CALL(device, dump, fd);
|
return VENDOR_CALL(device, dump, fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void heaptracker_free_leaked_memory(void);
|
extern "C" void heaptracker_free_leaked_memory(void);
|
||||||
|
|
||||||
static int camera_device_close(hw_device_t *device)
|
static int camera_device_close(hw_device_t* device) {
|
||||||
{
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
wrapper_camera_device_t *wrapper_dev = NULL;
|
wrapper_camera_device_t* wrapper_dev = NULL;
|
||||||
|
|
||||||
ALOGV("%s", __FUNCTION__);
|
ALOGV("%s", __FUNCTION__);
|
||||||
|
|
||||||
|
@ -489,15 +497,13 @@ static int camera_device_close(hw_device_t *device)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < camera_get_number_of_cameras(); i++) {
|
for (int i = 0; i < camera_get_number_of_cameras(); i++) {
|
||||||
if (fixed_set_params[i])
|
if (fixed_set_params[i]) free(fixed_set_params[i]);
|
||||||
free(fixed_set_params[i]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wrapper_dev = (wrapper_camera_device_t*) device;
|
wrapper_dev = (wrapper_camera_device_t*)device;
|
||||||
|
|
||||||
wrapper_dev->vendor->common.close((hw_device_t*)wrapper_dev->vendor);
|
wrapper_dev->vendor->common.close((hw_device_t*)wrapper_dev->vendor);
|
||||||
if (wrapper_dev->base.ops)
|
if (wrapper_dev->base.ops) free(wrapper_dev->base.ops);
|
||||||
free(wrapper_dev->base.ops);
|
|
||||||
free(wrapper_dev);
|
free(wrapper_dev);
|
||||||
done:
|
done:
|
||||||
#ifdef HEAPTRACKER
|
#ifdef HEAPTRACKER
|
||||||
|
@ -516,38 +522,37 @@ done:
|
||||||
* so this function will always only be called once per camera instance
|
* so this function will always only be called once per camera instance
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int camera_device_open(const hw_module_t *module, const char *name,
|
static int camera_device_open(const hw_module_t* module, const char* name, hw_device_t** device) {
|
||||||
hw_device_t **device)
|
|
||||||
{
|
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
int num_cameras = 0;
|
int num_cameras = 0;
|
||||||
int cameraid;
|
int cameraid;
|
||||||
wrapper_camera_device_t *camera_device = NULL;
|
wrapper_camera_device_t* camera_device = NULL;
|
||||||
camera_device_ops_t *camera_ops = NULL;
|
camera_device_ops_t* camera_ops = NULL;
|
||||||
|
wasVideo = false;
|
||||||
|
|
||||||
android::Mutex::Autolock lock(gCameraWrapperLock);
|
android::Mutex::Autolock lock(gCameraWrapperLock);
|
||||||
|
|
||||||
ALOGV("%s", __FUNCTION__);
|
ALOGV("%s", __FUNCTION__);
|
||||||
|
|
||||||
if (name != NULL) {
|
if (name != NULL) {
|
||||||
if (check_vendor_module())
|
if (check_vendor_module()) return -EINVAL;
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
cameraid = atoi(name);
|
cameraid = atoi(name);
|
||||||
num_cameras = gVendorModule->get_number_of_cameras();
|
num_cameras = gVendorModule->get_number_of_cameras();
|
||||||
|
|
||||||
fixed_set_params = (char **) malloc(sizeof(char *) * num_cameras);
|
fixed_set_params = (char**)malloc(sizeof(char*) * num_cameras);
|
||||||
if (!fixed_set_params) {
|
if (!fixed_set_params) {
|
||||||
ALOGE("parameter memory allocation fail");
|
ALOGE("parameter memory allocation fail");
|
||||||
rv = -ENOMEM;
|
rv = -ENOMEM;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
memset(fixed_set_params, 0, sizeof(char *) * num_cameras);
|
memset(fixed_set_params, 0, sizeof(char*) * num_cameras);
|
||||||
|
|
||||||
if (cameraid > num_cameras) {
|
if (cameraid > num_cameras) {
|
||||||
ALOGE("camera service provided cameraid out of bounds, "
|
ALOGE(
|
||||||
"cameraid = %d, num supported = %d",
|
"camera service provided cameraid out of bounds, "
|
||||||
cameraid, num_cameras);
|
"cameraid = %d, num supported = %d",
|
||||||
|
cameraid, num_cameras);
|
||||||
rv = -EINVAL;
|
rv = -EINVAL;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
@ -561,15 +566,14 @@ static int camera_device_open(const hw_module_t *module, const char *name,
|
||||||
memset(camera_device, 0, sizeof(*camera_device));
|
memset(camera_device, 0, sizeof(*camera_device));
|
||||||
camera_device->id = cameraid;
|
camera_device->id = cameraid;
|
||||||
|
|
||||||
rv = gVendorModule->common.methods->open(
|
rv = gVendorModule->common.methods->open((const hw_module_t*)gVendorModule, name,
|
||||||
(const hw_module_t*)gVendorModule, name,
|
(hw_device_t**)&(camera_device->vendor));
|
||||||
(hw_device_t**)&(camera_device->vendor));
|
|
||||||
if (rv) {
|
if (rv) {
|
||||||
ALOGE("vendor camera open fail");
|
ALOGE("vendor camera open fail");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
ALOGV("%s: got vendor camera device 0x%08X",
|
ALOGV("%s: got vendor camera device 0x%08X", __FUNCTION__,
|
||||||
__FUNCTION__, (uintptr_t)(camera_device->vendor));
|
(uintptr_t)(camera_device->vendor));
|
||||||
|
|
||||||
camera_ops = (camera_device_ops_t*)malloc(sizeof(*camera_ops));
|
camera_ops = (camera_device_ops_t*)malloc(sizeof(*camera_ops));
|
||||||
if (!camera_ops) {
|
if (!camera_ops) {
|
||||||
|
@ -582,7 +586,7 @@ static int camera_device_open(const hw_module_t *module, const char *name,
|
||||||
|
|
||||||
camera_device->base.common.tag = HARDWARE_DEVICE_TAG;
|
camera_device->base.common.tag = HARDWARE_DEVICE_TAG;
|
||||||
camera_device->base.common.version = HARDWARE_DEVICE_API_VERSION(1, 0);
|
camera_device->base.common.version = HARDWARE_DEVICE_API_VERSION(1, 0);
|
||||||
camera_device->base.common.module = (hw_module_t *)(module);
|
camera_device->base.common.module = (hw_module_t*)(module);
|
||||||
camera_device->base.common.close = camera_device_close;
|
camera_device->base.common.close = camera_device_close;
|
||||||
camera_device->base.ops = camera_ops;
|
camera_device->base.ops = camera_ops;
|
||||||
|
|
||||||
|
@ -628,18 +632,14 @@ fail:
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int camera_get_number_of_cameras(void)
|
static int camera_get_number_of_cameras(void) {
|
||||||
{
|
|
||||||
ALOGV("%s", __FUNCTION__);
|
ALOGV("%s", __FUNCTION__);
|
||||||
if (check_vendor_module())
|
if (check_vendor_module()) return 0;
|
||||||
return 0;
|
|
||||||
return gVendorModule->get_number_of_cameras();
|
return gVendorModule->get_number_of_cameras();
|
||||||
}
|
}
|
||||||
|
|
||||||
static int camera_get_camera_info(int camera_id, struct camera_info *info)
|
static int camera_get_camera_info(int camera_id, struct camera_info* info) {
|
||||||
{
|
|
||||||
ALOGV("%s", __FUNCTION__);
|
ALOGV("%s", __FUNCTION__);
|
||||||
if (check_vendor_module())
|
if (check_vendor_module()) return 0;
|
||||||
return 0;
|
|
||||||
return gVendorModule->get_camera_info(camera_id, info);
|
return gVendorModule->get_camera_info(camera_id, info);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue