Loading camera/common/1.0/default/CameraModule.cpp +8 −3 Original line number Diff line number Diff line Loading @@ -235,7 +235,7 @@ void CameraModule::appendAvailableKeys(CameraMetadata &chars, chars.update(keyTag, availableKeys); } CameraModule::CameraModule(camera_module_t *module) { CameraModule::CameraModule(camera_module_t *module) : mNumberOfCameras(0) { if (module == NULL) { ALOGE("%s: camera hardware module must not be null", __FUNCTION__); assert(0); Loading Loading @@ -264,7 +264,8 @@ int CameraModule::init() { res = mModule->init(); ATRACE_END(); } mCameraInfoMap.setCapacity(getNumberOfCameras()); mNumberOfCameras = getNumberOfCameras(); mCameraInfoMap.setCapacity(mNumberOfCameras); return res; } Loading Loading @@ -322,7 +323,7 @@ int CameraModule::getCameraInfo(int cameraId, struct camera_info *info) { int CameraModule::getPhysicalCameraInfo(int physicalCameraId, camera_metadata_t **physicalInfo) { ATRACE_CALL(); Mutex::Autolock lock(mCameraInfoLock); if (physicalCameraId < 0) { if (physicalCameraId < mNumberOfCameras) { ALOGE("%s: Invalid physical camera ID %d", __FUNCTION__, physicalCameraId); return -EINVAL; } Loading @@ -334,6 +335,10 @@ int CameraModule::getPhysicalCameraInfo(int physicalCameraId, camera_metadata_t __FUNCTION__); return -ENODEV; } if (mModule->get_physical_camera_info == nullptr) { ALOGE("%s: get_physical_camera is NULL for module version 2.5", __FUNCTION__); return -EINVAL; } ssize_t index = mPhysicalCameraInfoMap.indexOfKey(physicalCameraId); if (index == NAME_NOT_FOUND) { Loading camera/common/1.0/default/include/CameraModule.h +1 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ private: int32_t keyTag, const Vector<int32_t>& appendKeys); status_t filterOpenErrorCode(status_t err); camera_module_t *mModule; int mNumberOfCameras; KeyedVector<int, camera_info> mCameraInfoMap; KeyedVector<int, int> mDeviceVersionMap; KeyedVector<int, camera_metadata_t*> mPhysicalCameraInfoMap; Loading camera/device/3.5/ICameraDevice.hal +18 −2 Original line number Diff line number Diff line Loading @@ -36,11 +36,24 @@ interface ICameraDevice extends @3.2::ICameraDevice { * this logical camera device. This information may not change between consecutive calls. * * Note that HAL must support this function for physical camera IDs that are * not exposed via ICameraProvider::getCameraIdList(). * not exposed via ICameraProvider::getCameraIdList(). Calling * getCameraDeviceInterface_V3_x() on these camera IDs must return ILLEGAL_ARGUMENT. * * The characteristics of all cameras returned by * ICameraProvider::getCameraIdList() must be queried via * getCameraCharacteristics(). Calling getPhysicalCameraCharacteristics() on * those cameras must return ILLEGAL_ARGUMENT. * * @param physicalCameraId The physical camera id parsed from the logical * camera's ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS static metadata * key. The framework assumes that this ID is just the <id> part of fully * qualified camera device name "device@<major>.<minor>/<type>/<id>". And * the physical camera must be of the same version and type as the parent * logical camera device. * * @return status Status code for the operation, one of: * OK: * On a successful query of the camera device characteristics * On a successful query of the physical camera device characteristics * INTERNAL_ERROR: * The camera device cannot be opened due to an internal * error. Loading @@ -50,6 +63,9 @@ interface ICameraDevice extends @3.2::ICameraDevice { * instance must be acquired if the device is reconnected. All * subsequent calls on this interface must return * CAMERA_DISCONNECTED. * ILLEGAL_ARGUMENT: * If the physicalCameraId is not a valid physical camera Id outside * of ICameraProvider::getCameraIdList(). * * @return cameraCharacteristics * The static metadata for this logical camera device's physical device, or an empty Loading camera/device/3.5/default/CameraDevice.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,10 @@ Return<void> CameraDevice::getPhysicalCameraCharacteristics(const hidl_string& p int ret = mModule->getPhysicalCameraInfo((int)id, &physicalInfo); if (ret == OK) { V3_2::implementation::convertToHidl(physicalInfo, &cameraCharacteristics); } else if (ret == -EINVAL) { ALOGE("%s: %s is not a valid physical camera Id outside of getCameraIdList()", __FUNCTION__, physicalCameraId.c_str()); status = Status::ILLEGAL_ARGUMENT; } else { ALOGE("%s: Failed to get physical camera %s info: %s (%d)!", __FUNCTION__, physicalCameraId.c_str(), strerror(-ret), ret); Loading camera/provider/2.4/vts/functional/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ cc_test { "android.hardware.camera.device@3.2", "android.hardware.camera.device@3.3", "android.hardware.camera.device@3.4", "android.hardware.camera.device@3.5", "android.hardware.camera.provider@2.4", "android.hardware.graphics.allocator@2.0", "android.hardware.graphics.common@1.0", Loading Loading
camera/common/1.0/default/CameraModule.cpp +8 −3 Original line number Diff line number Diff line Loading @@ -235,7 +235,7 @@ void CameraModule::appendAvailableKeys(CameraMetadata &chars, chars.update(keyTag, availableKeys); } CameraModule::CameraModule(camera_module_t *module) { CameraModule::CameraModule(camera_module_t *module) : mNumberOfCameras(0) { if (module == NULL) { ALOGE("%s: camera hardware module must not be null", __FUNCTION__); assert(0); Loading Loading @@ -264,7 +264,8 @@ int CameraModule::init() { res = mModule->init(); ATRACE_END(); } mCameraInfoMap.setCapacity(getNumberOfCameras()); mNumberOfCameras = getNumberOfCameras(); mCameraInfoMap.setCapacity(mNumberOfCameras); return res; } Loading Loading @@ -322,7 +323,7 @@ int CameraModule::getCameraInfo(int cameraId, struct camera_info *info) { int CameraModule::getPhysicalCameraInfo(int physicalCameraId, camera_metadata_t **physicalInfo) { ATRACE_CALL(); Mutex::Autolock lock(mCameraInfoLock); if (physicalCameraId < 0) { if (physicalCameraId < mNumberOfCameras) { ALOGE("%s: Invalid physical camera ID %d", __FUNCTION__, physicalCameraId); return -EINVAL; } Loading @@ -334,6 +335,10 @@ int CameraModule::getPhysicalCameraInfo(int physicalCameraId, camera_metadata_t __FUNCTION__); return -ENODEV; } if (mModule->get_physical_camera_info == nullptr) { ALOGE("%s: get_physical_camera is NULL for module version 2.5", __FUNCTION__); return -EINVAL; } ssize_t index = mPhysicalCameraInfoMap.indexOfKey(physicalCameraId); if (index == NAME_NOT_FOUND) { Loading
camera/common/1.0/default/include/CameraModule.h +1 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,7 @@ private: int32_t keyTag, const Vector<int32_t>& appendKeys); status_t filterOpenErrorCode(status_t err); camera_module_t *mModule; int mNumberOfCameras; KeyedVector<int, camera_info> mCameraInfoMap; KeyedVector<int, int> mDeviceVersionMap; KeyedVector<int, camera_metadata_t*> mPhysicalCameraInfoMap; Loading
camera/device/3.5/ICameraDevice.hal +18 −2 Original line number Diff line number Diff line Loading @@ -36,11 +36,24 @@ interface ICameraDevice extends @3.2::ICameraDevice { * this logical camera device. This information may not change between consecutive calls. * * Note that HAL must support this function for physical camera IDs that are * not exposed via ICameraProvider::getCameraIdList(). * not exposed via ICameraProvider::getCameraIdList(). Calling * getCameraDeviceInterface_V3_x() on these camera IDs must return ILLEGAL_ARGUMENT. * * The characteristics of all cameras returned by * ICameraProvider::getCameraIdList() must be queried via * getCameraCharacteristics(). Calling getPhysicalCameraCharacteristics() on * those cameras must return ILLEGAL_ARGUMENT. * * @param physicalCameraId The physical camera id parsed from the logical * camera's ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS static metadata * key. The framework assumes that this ID is just the <id> part of fully * qualified camera device name "device@<major>.<minor>/<type>/<id>". And * the physical camera must be of the same version and type as the parent * logical camera device. * * @return status Status code for the operation, one of: * OK: * On a successful query of the camera device characteristics * On a successful query of the physical camera device characteristics * INTERNAL_ERROR: * The camera device cannot be opened due to an internal * error. Loading @@ -50,6 +63,9 @@ interface ICameraDevice extends @3.2::ICameraDevice { * instance must be acquired if the device is reconnected. All * subsequent calls on this interface must return * CAMERA_DISCONNECTED. * ILLEGAL_ARGUMENT: * If the physicalCameraId is not a valid physical camera Id outside * of ICameraProvider::getCameraIdList(). * * @return cameraCharacteristics * The static metadata for this logical camera device's physical device, or an empty Loading
camera/device/3.5/default/CameraDevice.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,10 @@ Return<void> CameraDevice::getPhysicalCameraCharacteristics(const hidl_string& p int ret = mModule->getPhysicalCameraInfo((int)id, &physicalInfo); if (ret == OK) { V3_2::implementation::convertToHidl(physicalInfo, &cameraCharacteristics); } else if (ret == -EINVAL) { ALOGE("%s: %s is not a valid physical camera Id outside of getCameraIdList()", __FUNCTION__, physicalCameraId.c_str()); status = Status::ILLEGAL_ARGUMENT; } else { ALOGE("%s: Failed to get physical camera %s info: %s (%d)!", __FUNCTION__, physicalCameraId.c_str(), strerror(-ret), ret); Loading
camera/provider/2.4/vts/functional/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ cc_test { "android.hardware.camera.device@3.2", "android.hardware.camera.device@3.3", "android.hardware.camera.device@3.4", "android.hardware.camera.device@3.5", "android.hardware.camera.provider@2.4", "android.hardware.graphics.allocator@2.0", "android.hardware.graphics.common@1.0", Loading