Loading core/jni/android_hardware_camera2_CameraMetadata.cpp +12 −9 Original line number 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); 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) { Loading Loading @@ -642,9 +651,7 @@ static jint CameraMetadata_getTypeFromTagLocal(JNIEnv *env, jclass thiz, jlong p CameraMetadata* metadata = CameraMetadata_getPointerNoThrow(ptr); metadata_vendor_id_t vendorId = CAMERA_METADATA_INVALID_VENDOR_ID; if (metadata) { const camera_metadata_t *metaBuffer = metadata->getAndLock(); vendorId = get_camera_metadata_vendor_id(metaBuffer); metadata->unlock(metaBuffer); vendorId = metadata->getVendorId(); } 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) { sp<VendorTagDescriptorCache> cache = VendorTagDescriptorCache::getGlobalVendorTagCache(); if (cache.get()) { const camera_metadata_t *metaBuffer = metadata->getAndLock(); metadata_vendor_id_t vendorId = get_camera_metadata_vendor_id(metaBuffer); metadata->unlock(metaBuffer); auto vendorId = metadata->getVendorId(); 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); if (metadata == NULL) return NULL; const camera_metadata_t *metaBuffer = metadata->getAndLock(); vendorId = get_camera_metadata_vendor_id(metaBuffer); vendorId = metadata->getVendorId(); cache->getVendorTagDescriptor(vendorId, &vTags); metadata->unlock(metaBuffer); if (vTags.get() == nullptr) { return nullptr; } Loading Loading
core/jni/android_hardware_camera2_CameraMetadata.cpp +12 −9 Original line number 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); 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) { Loading Loading @@ -642,9 +651,7 @@ static jint CameraMetadata_getTypeFromTagLocal(JNIEnv *env, jclass thiz, jlong p CameraMetadata* metadata = CameraMetadata_getPointerNoThrow(ptr); metadata_vendor_id_t vendorId = CAMERA_METADATA_INVALID_VENDOR_ID; if (metadata) { const camera_metadata_t *metaBuffer = metadata->getAndLock(); vendorId = get_camera_metadata_vendor_id(metaBuffer); metadata->unlock(metaBuffer); vendorId = metadata->getVendorId(); } 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) { sp<VendorTagDescriptorCache> cache = VendorTagDescriptorCache::getGlobalVendorTagCache(); if (cache.get()) { const camera_metadata_t *metaBuffer = metadata->getAndLock(); metadata_vendor_id_t vendorId = get_camera_metadata_vendor_id(metaBuffer); metadata->unlock(metaBuffer); auto vendorId = metadata->getVendorId(); 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); if (metadata == NULL) return NULL; const camera_metadata_t *metaBuffer = metadata->getAndLock(); vendorId = get_camera_metadata_vendor_id(metaBuffer); vendorId = metadata->getVendorId(); cache->getVendorTagDescriptor(vendorId, &vTags); metadata->unlock(metaBuffer); if (vTags.get() == nullptr) { return nullptr; } Loading