Loading core/jni/android_hardware_camera2_CameraMetadata.cpp +12 −9 Original line number Original line Diff line number Diff line Loading @@ -501,6 +501,15 @@ static void CameraMetadata_readFromParcel(JNIEnv *env, jclass thiz, jobject parc "Failed to read from parcel (error code %d)", err); "Failed to read from parcel (error code %d)", err); return; return; } } // Update vendor descriptor cache if necessary auto vendorId = metadata->getVendorId(); if ((vendorId != CAMERA_METADATA_INVALID_VENDOR_ID) && !VendorTagDescriptorCache::isVendorCachePresent(vendorId)) { ALOGW("%s: Tag vendor id missing or cache not initialized, trying to update!", __FUNCTION__); CameraMetadata_setupGlobalVendorTagDescriptor(env, thiz); } } } static void CameraMetadata_writeToParcel(JNIEnv *env, jclass thiz, jobject parcel, jlong ptr) { static void CameraMetadata_writeToParcel(JNIEnv *env, jclass thiz, jobject parcel, jlong ptr) { Loading Loading @@ -642,9 +651,7 @@ static jint CameraMetadata_getTypeFromTagLocal(JNIEnv *env, jclass thiz, jlong p CameraMetadata* metadata = CameraMetadata_getPointerNoThrow(ptr); CameraMetadata* metadata = CameraMetadata_getPointerNoThrow(ptr); metadata_vendor_id_t vendorId = CAMERA_METADATA_INVALID_VENDOR_ID; metadata_vendor_id_t vendorId = CAMERA_METADATA_INVALID_VENDOR_ID; if (metadata) { if (metadata) { const camera_metadata_t *metaBuffer = metadata->getAndLock(); vendorId = metadata->getVendorId(); vendorId = get_camera_metadata_vendor_id(metaBuffer); metadata->unlock(metaBuffer); } } int tagType = get_local_camera_metadata_tag_type_vendor_id(tag, vendorId); int tagType = get_local_camera_metadata_tag_type_vendor_id(tag, vendorId); Loading Loading @@ -673,9 +680,7 @@ static jint CameraMetadata_getTagFromKeyLocal(JNIEnv *env, jclass thiz, jlong pt if (metadata) { if (metadata) { sp<VendorTagDescriptorCache> cache = VendorTagDescriptorCache::getGlobalVendorTagCache(); sp<VendorTagDescriptorCache> cache = VendorTagDescriptorCache::getGlobalVendorTagCache(); if (cache.get()) { if (cache.get()) { const camera_metadata_t *metaBuffer = metadata->getAndLock(); auto vendorId = metadata->getVendorId(); metadata_vendor_id_t vendorId = get_camera_metadata_vendor_id(metaBuffer); metadata->unlock(metaBuffer); cache->getVendorTagDescriptor(vendorId, &vTags); cache->getVendorTagDescriptor(vendorId, &vTags); } } } } Loading Loading @@ -703,10 +708,8 @@ static jobject CameraMetadata_getAllVendorKeys(JNIEnv* env, jclass thiz, jlong p CameraMetadata* metadata = CameraMetadata_getPointerThrow(env, ptr); CameraMetadata* metadata = CameraMetadata_getPointerThrow(env, ptr); if (metadata == NULL) return NULL; if (metadata == NULL) return NULL; const camera_metadata_t *metaBuffer = metadata->getAndLock(); vendorId = metadata->getVendorId(); vendorId = get_camera_metadata_vendor_id(metaBuffer); cache->getVendorTagDescriptor(vendorId, &vTags); cache->getVendorTagDescriptor(vendorId, &vTags); metadata->unlock(metaBuffer); if (vTags.get() == nullptr) { if (vTags.get() == nullptr) { return nullptr; return nullptr; } } Loading Loading
core/jni/android_hardware_camera2_CameraMetadata.cpp +12 −9 Original line number Original line Diff line number Diff line Loading @@ -501,6 +501,15 @@ static void CameraMetadata_readFromParcel(JNIEnv *env, jclass thiz, jobject parc "Failed to read from parcel (error code %d)", err); "Failed to read from parcel (error code %d)", err); return; return; } } // Update vendor descriptor cache if necessary auto vendorId = metadata->getVendorId(); if ((vendorId != CAMERA_METADATA_INVALID_VENDOR_ID) && !VendorTagDescriptorCache::isVendorCachePresent(vendorId)) { ALOGW("%s: Tag vendor id missing or cache not initialized, trying to update!", __FUNCTION__); CameraMetadata_setupGlobalVendorTagDescriptor(env, thiz); } } } static void CameraMetadata_writeToParcel(JNIEnv *env, jclass thiz, jobject parcel, jlong ptr) { static void CameraMetadata_writeToParcel(JNIEnv *env, jclass thiz, jobject parcel, jlong ptr) { Loading Loading @@ -642,9 +651,7 @@ static jint CameraMetadata_getTypeFromTagLocal(JNIEnv *env, jclass thiz, jlong p CameraMetadata* metadata = CameraMetadata_getPointerNoThrow(ptr); CameraMetadata* metadata = CameraMetadata_getPointerNoThrow(ptr); metadata_vendor_id_t vendorId = CAMERA_METADATA_INVALID_VENDOR_ID; metadata_vendor_id_t vendorId = CAMERA_METADATA_INVALID_VENDOR_ID; if (metadata) { if (metadata) { const camera_metadata_t *metaBuffer = metadata->getAndLock(); vendorId = metadata->getVendorId(); vendorId = get_camera_metadata_vendor_id(metaBuffer); metadata->unlock(metaBuffer); } } int tagType = get_local_camera_metadata_tag_type_vendor_id(tag, vendorId); int tagType = get_local_camera_metadata_tag_type_vendor_id(tag, vendorId); Loading Loading @@ -673,9 +680,7 @@ static jint CameraMetadata_getTagFromKeyLocal(JNIEnv *env, jclass thiz, jlong pt if (metadata) { if (metadata) { sp<VendorTagDescriptorCache> cache = VendorTagDescriptorCache::getGlobalVendorTagCache(); sp<VendorTagDescriptorCache> cache = VendorTagDescriptorCache::getGlobalVendorTagCache(); if (cache.get()) { if (cache.get()) { const camera_metadata_t *metaBuffer = metadata->getAndLock(); auto vendorId = metadata->getVendorId(); metadata_vendor_id_t vendorId = get_camera_metadata_vendor_id(metaBuffer); metadata->unlock(metaBuffer); cache->getVendorTagDescriptor(vendorId, &vTags); cache->getVendorTagDescriptor(vendorId, &vTags); } } } } Loading Loading @@ -703,10 +708,8 @@ static jobject CameraMetadata_getAllVendorKeys(JNIEnv* env, jclass thiz, jlong p CameraMetadata* metadata = CameraMetadata_getPointerThrow(env, ptr); CameraMetadata* metadata = CameraMetadata_getPointerThrow(env, ptr); if (metadata == NULL) return NULL; if (metadata == NULL) return NULL; const camera_metadata_t *metaBuffer = metadata->getAndLock(); vendorId = metadata->getVendorId(); vendorId = get_camera_metadata_vendor_id(metaBuffer); cache->getVendorTagDescriptor(vendorId, &vTags); cache->getVendorTagDescriptor(vendorId, &vTags); metadata->unlock(metaBuffer); if (vTags.get() == nullptr) { if (vTags.get() == nullptr) { return nullptr; return nullptr; } } Loading