blob: 073144c4a7813de54d1bc6c3641b2afbd8a44a59 [file] [log] [blame]
Yin-Chia Yehe074a932015-01-30 10:29:02 -08001/*
2 * Copyright (C) 2015 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#define LOG_TAG "CameraModule"
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -070018#define ATRACE_TAG ATRACE_TAG_CAMERA
Yin-Chia Yehe074a932015-01-30 10:29:02 -080019//#define LOG_NDEBUG 0
20
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -070021#include <utils/Trace.h>
22
Yin-Chia Yehe074a932015-01-30 10:29:02 -080023#include "CameraModule.h"
24
25namespace android {
26
27void CameraModule::deriveCameraCharacteristicsKeys(
28 uint32_t deviceVersion, CameraMetadata &chars) {
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -070029 ATRACE_CALL();
Yin-Chia Yehe074a932015-01-30 10:29:02 -080030
Yin-Chia Yehe9154ce2015-12-07 14:38:04 -080031 Vector<int32_t> derivedCharKeys;
Yin-Chia Yeh4c060992016-04-11 17:40:12 -070032 Vector<int32_t> derivedRequestKeys;
33 Vector<int32_t> derivedResultKeys;
Yin-Chia Yehe074a932015-01-30 10:29:02 -080034 // Keys added in HAL3.3
35 if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_3) {
36 Vector<uint8_t> controlModes;
37 uint8_t data = ANDROID_CONTROL_AE_LOCK_AVAILABLE_TRUE;
38 chars.update(ANDROID_CONTROL_AE_LOCK_AVAILABLE, &data, /*count*/1);
39 data = ANDROID_CONTROL_AWB_LOCK_AVAILABLE_TRUE;
40 chars.update(ANDROID_CONTROL_AWB_LOCK_AVAILABLE, &data, /*count*/1);
Yin-Chia Yehe074a932015-01-30 10:29:02 -080041 controlModes.push(ANDROID_CONTROL_MODE_AUTO);
42 camera_metadata_entry entry = chars.find(ANDROID_CONTROL_AVAILABLE_SCENE_MODES);
43 if (entry.count > 1 || entry.data.u8[0] != ANDROID_CONTROL_SCENE_MODE_DISABLED) {
44 controlModes.push(ANDROID_CONTROL_MODE_USE_SCENE_MODE);
45 }
Zhijun He9c5af612015-05-04 16:34:37 -070046
47 // Only advertise CONTROL_OFF mode if 3A manual controls are supported.
48 bool isManualAeSupported = false;
49 bool isManualAfSupported = false;
50 bool isManualAwbSupported = false;
51 entry = chars.find(ANDROID_CONTROL_AE_AVAILABLE_MODES);
52 if (entry.count > 0) {
53 for (size_t i = 0; i < entry.count; i++) {
54 if (entry.data.u8[i] == ANDROID_CONTROL_AE_MODE_OFF) {
55 isManualAeSupported = true;
56 break;
57 }
58 }
59 }
60 entry = chars.find(ANDROID_CONTROL_AF_AVAILABLE_MODES);
61 if (entry.count > 0) {
62 for (size_t i = 0; i < entry.count; i++) {
63 if (entry.data.u8[i] == ANDROID_CONTROL_AF_MODE_OFF) {
64 isManualAfSupported = true;
65 break;
66 }
67 }
68 }
69 entry = chars.find(ANDROID_CONTROL_AWB_AVAILABLE_MODES);
70 if (entry.count > 0) {
71 for (size_t i = 0; i < entry.count; i++) {
72 if (entry.data.u8[i] == ANDROID_CONTROL_AWB_MODE_OFF) {
73 isManualAwbSupported = true;
74 break;
75 }
76 }
77 }
78 if (isManualAeSupported && isManualAfSupported && isManualAwbSupported) {
79 controlModes.push(ANDROID_CONTROL_MODE_OFF);
80 }
81
Yin-Chia Yehe074a932015-01-30 10:29:02 -080082 chars.update(ANDROID_CONTROL_AVAILABLE_MODES, controlModes);
Yin-Chia Yehb28c3442015-05-07 14:43:19 -070083
Yin-Chia Yeh3e28a1a2015-05-22 15:03:38 -070084 entry = chars.find(ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS);
85 // HAL3.2 devices passing existing CTS test should all support all LSC modes and LSC map
86 bool lensShadingModeSupported = false;
87 if (entry.count > 0) {
88 for (size_t i = 0; i < entry.count; i++) {
89 if (entry.data.i32[i] == ANDROID_SHADING_MODE) {
90 lensShadingModeSupported = true;
91 break;
92 }
93 }
94 }
95 Vector<uint8_t> lscModes;
96 Vector<uint8_t> lscMapModes;
97 lscModes.push(ANDROID_SHADING_MODE_FAST);
98 lscModes.push(ANDROID_SHADING_MODE_HIGH_QUALITY);
99 lscMapModes.push(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF);
100 if (lensShadingModeSupported) {
101 lscModes.push(ANDROID_SHADING_MODE_OFF);
102 lscMapModes.push(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_ON);
103 }
104 chars.update(ANDROID_SHADING_AVAILABLE_MODES, lscModes);
105 chars.update(ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES, lscMapModes);
106
Yin-Chia Yehe9154ce2015-12-07 14:38:04 -0800107 derivedCharKeys.push(ANDROID_CONTROL_AE_LOCK_AVAILABLE);
108 derivedCharKeys.push(ANDROID_CONTROL_AWB_LOCK_AVAILABLE);
109 derivedCharKeys.push(ANDROID_CONTROL_AVAILABLE_MODES);
110 derivedCharKeys.push(ANDROID_SHADING_AVAILABLE_MODES);
111 derivedCharKeys.push(ANDROID_STATISTICS_INFO_AVAILABLE_LENS_SHADING_MAP_MODES);
Yin-Chia Yeh3e28a1a2015-05-22 15:03:38 -0700112
Zhijun He1fa89992015-06-01 15:44:31 -0700113 // Need update android.control.availableHighSpeedVideoConfigurations since HAL3.3
114 // adds batch size to this array.
115 entry = chars.find(ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS);
116 if (entry.count > 0) {
117 Vector<int32_t> highSpeedConfig;
118 for (size_t i = 0; i < entry.count; i += 4) {
119 highSpeedConfig.add(entry.data.i32[i]); // width
120 highSpeedConfig.add(entry.data.i32[i + 1]); // height
121 highSpeedConfig.add(entry.data.i32[i + 2]); // fps_min
122 highSpeedConfig.add(entry.data.i32[i + 3]); // fps_max
123 highSpeedConfig.add(1); // batchSize_max. default to 1 for HAL3.2
124 }
125 chars.update(ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS,
126 highSpeedConfig);
127 }
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800128 }
Ruben Brunka3b3caa2015-06-22 14:26:51 -0700129
Yin-Chia Yehe9154ce2015-12-07 14:38:04 -0800130 // Keys added in HAL3.4
131 if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_4) {
132 // Check if HAL supports RAW_OPAQUE output
133 camera_metadata_entry entry = chars.find(ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS);
134 bool supportRawOpaque = false;
Yin-Chia Yehf1d124e2016-01-28 16:32:15 -0800135 bool supportAnyRaw = false;
Yin-Chia Yehe9154ce2015-12-07 14:38:04 -0800136 const int STREAM_CONFIGURATION_SIZE = 4;
137 const int STREAM_FORMAT_OFFSET = 0;
138 const int STREAM_WIDTH_OFFSET = 1;
139 const int STREAM_HEIGHT_OFFSET = 2;
140 const int STREAM_IS_INPUT_OFFSET = 3;
141 Vector<int32_t> rawOpaqueSizes;
142
143 for (size_t i=0; i < entry.count; i += STREAM_CONFIGURATION_SIZE) {
144 int32_t format = entry.data.i32[i + STREAM_FORMAT_OFFSET];
145 int32_t width = entry.data.i32[i + STREAM_WIDTH_OFFSET];
146 int32_t height = entry.data.i32[i + STREAM_HEIGHT_OFFSET];
147 int32_t isInput = entry.data.i32[i + STREAM_IS_INPUT_OFFSET];
148 if (isInput == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT &&
149 format == HAL_PIXEL_FORMAT_RAW_OPAQUE) {
150 supportRawOpaque = true;
151 rawOpaqueSizes.push(width);
152 rawOpaqueSizes.push(height);
153 // 2 bytes per pixel. This rough estimation is only used when
154 // HAL does not fill in the opaque raw size
155 rawOpaqueSizes.push(width * height *2);
156 }
Yin-Chia Yehf1d124e2016-01-28 16:32:15 -0800157 if (isInput == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT &&
158 (format == HAL_PIXEL_FORMAT_RAW16 ||
159 format == HAL_PIXEL_FORMAT_RAW10 ||
160 format == HAL_PIXEL_FORMAT_RAW12 ||
161 format == HAL_PIXEL_FORMAT_RAW_OPAQUE)) {
162 supportAnyRaw = true;
163 }
Yin-Chia Yehe9154ce2015-12-07 14:38:04 -0800164 }
165
166 if (supportRawOpaque) {
167 entry = chars.find(ANDROID_SENSOR_OPAQUE_RAW_SIZE);
168 if (entry.count == 0) {
169 // Fill in estimated value if HAL does not list it
170 chars.update(ANDROID_SENSOR_OPAQUE_RAW_SIZE, rawOpaqueSizes);
171 derivedCharKeys.push(ANDROID_SENSOR_OPAQUE_RAW_SIZE);
172 }
173 }
Yin-Chia Yehf1d124e2016-01-28 16:32:15 -0800174
175 // Check if HAL supports any RAW output, if so, fill in postRawSensitivityBoost range
176 if (supportAnyRaw) {
177 int32_t defaultRange[2] = {100, 100};
178 entry = chars.find(ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE);
179 if (entry.count == 0) {
180 // Fill in default value (100, 100)
181 chars.update(
182 ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE,
183 defaultRange, 2);
184 derivedCharKeys.push(ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST_RANGE);
Yin-Chia Yeh4c060992016-04-11 17:40:12 -0700185 // Actual request/results will be derived by camera device.
186 derivedRequestKeys.push(ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST);
187 derivedResultKeys.push(ANDROID_CONTROL_POST_RAW_SENSITIVITY_BOOST);
Yin-Chia Yehf1d124e2016-01-28 16:32:15 -0800188 }
189 }
Yin-Chia Yehe9154ce2015-12-07 14:38:04 -0800190 }
191
Ruben Brunka3b3caa2015-06-22 14:26:51 -0700192 // Always add a default for the pre-correction active array if the vendor chooses to omit this
193 camera_metadata_entry entry = chars.find(ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE);
194 if (entry.count == 0) {
Ruben Brunkeff134a2015-07-17 15:22:01 -0700195 Vector<int32_t> preCorrectionArray;
Ruben Brunka3b3caa2015-06-22 14:26:51 -0700196 entry = chars.find(ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE);
Ruben Brunkeff134a2015-07-17 15:22:01 -0700197 preCorrectionArray.appendArray(entry.data.i32, entry.count);
198 chars.update(ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE, preCorrectionArray);
Yin-Chia Yehe9154ce2015-12-07 14:38:04 -0800199 derivedCharKeys.push(ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE);
Ruben Brunka3b3caa2015-06-22 14:26:51 -0700200 }
201
Yin-Chia Yehe9154ce2015-12-07 14:38:04 -0800202 // Add those newly added keys to AVAILABLE_CHARACTERISTICS_KEYS
203 // This has to be done at this end of this function.
Yin-Chia Yeh4c060992016-04-11 17:40:12 -0700204 if (derivedCharKeys.size() > 0) {
205 appendAvailableKeys(
206 chars, ANDROID_REQUEST_AVAILABLE_CHARACTERISTICS_KEYS, derivedCharKeys);
Yin-Chia Yehe9154ce2015-12-07 14:38:04 -0800207 }
Yin-Chia Yeh4c060992016-04-11 17:40:12 -0700208 if (derivedRequestKeys.size() > 0) {
209 appendAvailableKeys(
210 chars, ANDROID_REQUEST_AVAILABLE_REQUEST_KEYS, derivedRequestKeys);
Yin-Chia Yehe9154ce2015-12-07 14:38:04 -0800211 }
Yin-Chia Yeh4c060992016-04-11 17:40:12 -0700212 if (derivedResultKeys.size() > 0) {
213 appendAvailableKeys(
214 chars, ANDROID_REQUEST_AVAILABLE_RESULT_KEYS, derivedResultKeys);
215 }
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800216 return;
217}
218
Yin-Chia Yeh4c060992016-04-11 17:40:12 -0700219void CameraModule::appendAvailableKeys(CameraMetadata &chars,
220 int32_t keyTag, const Vector<int32_t>& appendKeys) {
221 camera_metadata_entry entry = chars.find(keyTag);
222 Vector<int32_t> availableKeys;
223 availableKeys.setCapacity(entry.count + appendKeys.size());
224 for (size_t i = 0; i < entry.count; i++) {
225 availableKeys.push(entry.data.i32[i]);
226 }
227 for (size_t i = 0; i < appendKeys.size(); i++) {
228 availableKeys.push(appendKeys[i]);
229 }
230 chars.update(keyTag, availableKeys);
231}
232
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800233CameraModule::CameraModule(camera_module_t *module) {
234 if (module == NULL) {
235 ALOGE("%s: camera hardware module must not be null", __FUNCTION__);
236 assert(0);
237 }
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800238 mModule = module;
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800239}
240
Chien-Yu Chen944f8432015-07-01 17:08:03 -0700241CameraModule::~CameraModule()
242{
243 while (mCameraInfoMap.size() > 0) {
244 camera_info cameraInfo = mCameraInfoMap.editValueAt(0);
245 if (cameraInfo.static_camera_characteristics != NULL) {
246 free_camera_metadata(
247 const_cast<camera_metadata_t*>(cameraInfo.static_camera_characteristics));
248 }
249 mCameraInfoMap.removeItemsAt(0);
250 }
251}
252
Eino-Ville Talvala1527f072015-04-07 15:55:31 -0700253int CameraModule::init() {
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -0700254 ATRACE_CALL();
255 int res = OK;
Eino-Ville Talvala1527f072015-04-07 15:55:31 -0700256 if (getModuleApiVersion() >= CAMERA_MODULE_API_VERSION_2_4 &&
257 mModule->init != NULL) {
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -0700258 ATRACE_BEGIN("camera_module->init");
259 res = mModule->init();
260 ATRACE_END();
Eino-Ville Talvala1527f072015-04-07 15:55:31 -0700261 }
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -0700262 mCameraInfoMap.setCapacity(getNumberOfCameras());
263 return res;
Eino-Ville Talvala1527f072015-04-07 15:55:31 -0700264}
265
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800266int CameraModule::getCameraInfo(int cameraId, struct camera_info *info) {
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -0700267 ATRACE_CALL();
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800268 Mutex::Autolock lock(mCameraInfoLock);
Chien-Yu Chen676b21b2015-02-24 10:28:19 -0800269 if (cameraId < 0) {
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800270 ALOGE("%s: Invalid camera ID %d", __FUNCTION__, cameraId);
271 return -EINVAL;
272 }
273
Yin-Chia Yehb6dc0bf2015-02-18 14:42:16 -0800274 // Only override static_camera_characteristics for API2 devices
275 int apiVersion = mModule->common.module_api_version;
276 if (apiVersion < CAMERA_MODULE_API_VERSION_2_0) {
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -0700277 int ret;
278 ATRACE_BEGIN("camera_module->get_camera_info");
279 ret = mModule->get_camera_info(cameraId, info);
Yin-Chia Yeh654b4bf2015-12-08 12:19:31 -0800280 // Fill in this so CameraService won't be confused by
281 // possibly 0 device_version
282 info->device_version = CAMERA_DEVICE_API_VERSION_1_0;
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -0700283 ATRACE_END();
284 return ret;
Yin-Chia Yehb6dc0bf2015-02-18 14:42:16 -0800285 }
286
Chien-Yu Chen676b21b2015-02-24 10:28:19 -0800287 ssize_t index = mCameraInfoMap.indexOfKey(cameraId);
288 if (index == NAME_NOT_FOUND) {
289 // Get camera info from raw module and cache it
Yin-Chia Yeh54298b32015-03-24 16:51:41 -0700290 camera_info rawInfo, cameraInfo;
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -0700291 ATRACE_BEGIN("camera_module->get_camera_info");
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800292 int ret = mModule->get_camera_info(cameraId, &rawInfo);
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -0700293 ATRACE_END();
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800294 if (ret != 0) {
295 return ret;
296 }
Zhijun He9c5af612015-05-04 16:34:37 -0700297 int deviceVersion = rawInfo.device_version;
Eino-Ville Talvalad309fb92015-11-25 12:12:45 -0800298 if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_0) {
Yin-Chia Yeh7768ded2015-04-15 12:16:02 -0700299 // static_camera_characteristics is invalid
300 *info = rawInfo;
301 return ret;
302 }
Yin-Chia Yeh54298b32015-03-24 16:51:41 -0700303 CameraMetadata m;
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800304 m = rawInfo.static_camera_characteristics;
Yin-Chia Yehb6dc0bf2015-02-18 14:42:16 -0800305 deriveCameraCharacteristicsKeys(rawInfo.device_version, m);
Yin-Chia Yeh54298b32015-03-24 16:51:41 -0700306 cameraInfo = rawInfo;
Chien-Yu Chen944f8432015-07-01 17:08:03 -0700307 cameraInfo.static_camera_characteristics = m.release();
308 index = mCameraInfoMap.add(cameraId, cameraInfo);
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800309 }
Chien-Yu Chen676b21b2015-02-24 10:28:19 -0800310
311 assert(index != NAME_NOT_FOUND);
312 // return the cached camera info
Yin-Chia Yeh54298b32015-03-24 16:51:41 -0700313 *info = mCameraInfoMap[index];
Eino-Ville Talvala1527f072015-04-07 15:55:31 -0700314 return OK;
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800315}
316
317int CameraModule::open(const char* id, struct hw_device_t** device) {
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -0700318 int res;
319 ATRACE_BEGIN("camera_module->open");
320 res = filterOpenErrorCode(mModule->common.methods->open(&mModule->common, id, device));
321 ATRACE_END();
322 return res;
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800323}
324
325int CameraModule::openLegacy(
326 const char* id, uint32_t halVersion, struct hw_device_t** device) {
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -0700327 int res;
328 ATRACE_BEGIN("camera_module->open_legacy");
329 res = mModule->open_legacy(&mModule->common, id, halVersion, device);
330 ATRACE_END();
331 return res;
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800332}
333
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800334int CameraModule::getNumberOfCameras() {
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -0700335 int numCameras;
336 ATRACE_BEGIN("camera_module->get_number_of_cameras");
337 numCameras = mModule->get_number_of_cameras();
338 ATRACE_END();
339 return numCameras;
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800340}
341
342int CameraModule::setCallbacks(const camera_module_callbacks_t *callbacks) {
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -0700343 int res;
344 ATRACE_BEGIN("camera_module->set_callbacks");
345 res = mModule->set_callbacks(callbacks);
346 ATRACE_END();
347 return res;
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800348}
349
350bool CameraModule::isVendorTagDefined() {
351 return mModule->get_vendor_tag_ops != NULL;
352}
353
354void CameraModule::getVendorTagOps(vendor_tag_ops_t* ops) {
355 if (mModule->get_vendor_tag_ops) {
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -0700356 ATRACE_BEGIN("camera_module->get_vendor_tag_ops");
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800357 mModule->get_vendor_tag_ops(ops);
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -0700358 ATRACE_END();
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800359 }
360}
361
362int CameraModule::setTorchMode(const char* camera_id, bool enable) {
Eino-Ville Talvalaa84bbe62015-09-08 17:59:17 -0700363 int res;
364 ATRACE_BEGIN("camera_module->set_torch_mode");
365 res = mModule->set_torch_mode(camera_id, enable);
366 ATRACE_END();
367 return res;
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800368}
369
Chien-Yu Chend231fd62015-02-25 16:04:22 -0800370status_t CameraModule::filterOpenErrorCode(status_t err) {
371 switch(err) {
372 case NO_ERROR:
373 case -EBUSY:
374 case -EINVAL:
375 case -EUSERS:
376 return err;
377 default:
378 break;
379 }
380 return -ENODEV;
381}
382
Chien-Yu Chen676b21b2015-02-24 10:28:19 -0800383uint16_t CameraModule::getModuleApiVersion() {
384 return mModule->common.module_api_version;
385}
386
387const char* CameraModule::getModuleName() {
388 return mModule->common.name;
389}
390
391uint16_t CameraModule::getHalApiVersion() {
392 return mModule->common.hal_api_version;
393}
394
395const char* CameraModule::getModuleAuthor() {
396 return mModule->common.author;
397}
398
399void* CameraModule::getDso() {
400 return mModule->common.dso;
401}
Chien-Yu Chend231fd62015-02-25 16:04:22 -0800402
Yin-Chia Yehe074a932015-01-30 10:29:02 -0800403}; // namespace android