summaryrefslogtreecommitdiffstats
path: root/services/camera/libcameraservice/CameraService.cpp
diff options
context:
space:
mode:
authorYin-Chia Yeh <yinchiayeh@google.com>2015-03-24 22:41:04 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-03-24 22:41:04 +0000
commit40272963eb8f8d8d7a1f39e6a25ae73bc755e553 (patch)
treea1d36d5b80c35f7168c592fb03c07f644b253970 /services/camera/libcameraservice/CameraService.cpp
parent1147314379fccebdb072cd0c1a246b505839a2b0 (diff)
parent676b21b30edbd74d7b9aae247961a1ffde1b8993 (diff)
downloadframeworks_av-40272963eb8f8d8d7a1f39e6a25ae73bc755e553.zip
frameworks_av-40272963eb8f8d8d7a1f39e6a25ae73bc755e553.tar.gz
frameworks_av-40272963eb8f8d8d7a1f39e6a25ae73bc755e553.tar.bz2
Merge "camera: update CameraModule"
Diffstat (limited to 'services/camera/libcameraservice/CameraService.cpp')
-rw-r--r--services/camera/libcameraservice/CameraService.cpp27
1 files changed, 12 insertions, 15 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 58512eb..c2df489 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -149,8 +149,7 @@ void CameraService::onFirstRef()
}
else {
mModule = new CameraModule(rawModule);
- const hw_module_t *common = mModule->getRawModule();
- ALOGI("Loaded \"%s\" camera module", common->name);
+ ALOGI("Loaded \"%s\" camera module", mModule->getModuleName());
mNumberOfCameras = mModule->getNumberOfCameras();
mFlashlight = new CameraFlashlight(*mModule, *this);
@@ -169,7 +168,7 @@ void CameraService::onFirstRef()
size_t conflicting_devices_length = 0;
// If using post-2.4 module version, query the cost + conflicting devices from the HAL
- if (common->module_api_version >= CAMERA_MODULE_API_VERSION_2_4) {
+ if (mModule->getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_4) {
struct camera_info info;
status_t rc = mModule->getCameraInfo(i, &info);
if (rc == NO_ERROR) {
@@ -201,13 +200,13 @@ void CameraService::onFirstRef()
}
}
- if (common->module_api_version >= CAMERA_MODULE_API_VERSION_2_1) {
+ if (mModule->getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_1) {
mModule->setCallbacks(this);
}
VendorTagDescriptor::clearGlobalVendorTagDescriptor();
- if (common->module_api_version >= CAMERA_MODULE_API_VERSION_2_2) {
+ if (mModule->getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_2) {
setUpVendorTags();
}
@@ -457,7 +456,7 @@ status_t CameraService::getCameraCharacteristics(int cameraId,
int facing;
status_t ret = OK;
- if (mModule->getRawModule()->module_api_version < CAMERA_MODULE_API_VERSION_2_0 ||
+ if (mModule->getModuleApiVersion() < CAMERA_MODULE_API_VERSION_2_0 ||
getDeviceVersion(cameraId, &facing) <= CAMERA_DEVICE_API_VERSION_2_1 ) {
/**
* Backwards compatibility mode for old HALs:
@@ -550,7 +549,7 @@ int CameraService::getDeviceVersion(int cameraId, int* facing) {
}
int deviceVersion;
- if (mModule->getRawModule()->module_api_version >= CAMERA_MODULE_API_VERSION_2_0) {
+ if (mModule->getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_0) {
deviceVersion = info.device_version;
} else {
deviceVersion = CAMERA_DEVICE_API_VERSION_1_0;
@@ -1037,7 +1036,7 @@ status_t CameraService::connectLegacy(
/*out*/
sp<ICamera>& device) {
- int apiVersion = mModule->getRawModule()->module_api_version;
+ int apiVersion = mModule->getModuleApiVersion();
if (halVersion != CAMERA_HAL_API_VERSION_UNSPECIFIED &&
apiVersion < CAMERA_MODULE_API_VERSION_2_3) {
/*
@@ -1837,16 +1836,14 @@ status_t CameraService::dump(int fd, const Vector<String16>& args) {
return NO_ERROR;
}
- const hw_module_t* common = mModule->getRawModule();
- result = String8::format("Camera module HAL API version: %#x\n", common->hal_api_version);
- result.appendFormat("Camera module API version: %#x\n", common->module_api_version);
- result.appendFormat("Camera module name: %s\n", common->name);
- result.appendFormat("Camera module author: %s\n", common->author);
+ result = String8::format("Camera module HAL API version: 0x%x\n", mModule->getHalApiVersion());
+ result.appendFormat("Camera module API version: 0x%x\n", mModule->getModuleApiVersion());
+ result.appendFormat("Camera module name: %s\n", mModule->getModuleName());
+ result.appendFormat("Camera module author: %s\n", mModule->getModuleAuthor());
result.appendFormat("Number of camera devices: %d\n", mNumberOfCameras);
String8 activeClientString = mActiveClientManager.toString();
result.appendFormat("Active Camera Clients:\n%s", activeClientString.string());
-
sp<VendorTagDescriptor> desc = VendorTagDescriptor::getGlobalVendorTagDescriptor();
if (desc == NULL) {
result.appendFormat("Vendor tags left unimplemented.\n");
@@ -1893,7 +1890,7 @@ status_t CameraService::dump(int fd, const Vector<String16>& args) {
info.facing == CAMERA_FACING_BACK ? "BACK" : "FRONT");
result.appendFormat(" Orientation: %d\n", info.orientation);
int deviceVersion;
- if (common->module_api_version < CAMERA_MODULE_API_VERSION_2_0) {
+ if (mModule->getModuleApiVersion() < CAMERA_MODULE_API_VERSION_2_0) {
deviceVersion = CAMERA_DEVICE_API_VERSION_1_0;
} else {
deviceVersion = info.device_version;