Merge "Camera: Add static metadata that can map device state to orientation" into sc-v2-dev

This commit is contained in:
Emilian Peev
2021-10-07 22:53:25 +00:00
committed by Android (Google) Code Review
3 changed files with 67 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
/*
* Copyright (C) 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* Autogenerated from camera metadata definitions in
* /system/media/camera/docs/metadata_definitions.xml
* *** DO NOT EDIT BY HAND ***
*/
package android.hardware.camera.metadata@3.7;
import android.hardware.camera.metadata@3.2;
import android.hardware.camera.metadata@3.3;
import android.hardware.camera.metadata@3.4;
import android.hardware.camera.metadata@3.5;
import android.hardware.camera.metadata@3.6;
// No new metadata sections added in this revision
/**
* Main enumeration for defining camera metadata tags added in this revision
*
* <p>Partial documentation is included for each tag; for complete documentation, reference
* '/system/media/camera/docs/docs.html' in the corresponding Android source tree.</p>
*/
enum CameraMetadataTag : @3.6::CameraMetadataTag {
/** android.info.deviceStateOrientations [static, int64[], ndk_public]
*/
ANDROID_INFO_DEVICE_STATE_ORIENTATIONS = android.hardware.camera.metadata@3.4::CameraMetadataTag:ANDROID_INFO_END_3_4,
ANDROID_INFO_END_3_7,
};
/*
* Enumeration definitions for the various entries that need them
*/

View File

@@ -8161,6 +8161,20 @@ void CameraHidlTest::verifyCameraCharacteristics(Status status, const CameraMeta
poseReference >= ANDROID_LENS_POSE_REFERENCE_PRIMARY_CAMERA);
}
retcode = find_camera_metadata_ro_entry(metadata,
ANDROID_INFO_DEVICE_STATE_ORIENTATIONS, &entry);
if (0 == retcode && entry.count > 0) {
ASSERT_TRUE((entry.count % 2) == 0);
uint64_t maxPublicState = ((uint64_t) provider::V2_5::DeviceState::FOLDED) << 1;
uint64_t vendorStateStart = 1UL << 31; // Reserved for vendor specific states
uint64_t stateMask = (1 << vendorStateStart) - 1;
stateMask &= ~((1 << maxPublicState) - 1);
for (int i = 0; i < entry.count; i += 2){
ASSERT_TRUE((entry.data.i64[i] & stateMask) == 0);
ASSERT_TRUE((entry.data.i64[i+1] % 90) == 0);
}
}
verifyExtendedSceneModeCharacteristics(metadata);
verifyZoomCharacteristics(metadata);
}

View File

@@ -901,4 +901,7 @@ c8a57364f6ad20842be14f4db284df5304f7521ca8eac6bcc1fa6c5b466fb8a6 android.hardwar
4a087a308608d146b022ebc15633de989f5f4dfe1491a83fa41763290a82e40d android.hardware.automotive.vehicle@2.0::types
70eb14415391f835fb218b43a1e25f5d6495f098f96fa2acaea70985e98e1ce8 android.hardware.automotive.vehicle@2.0::types
# HALs released in Android SCv2
77f6fcf3fd0dd3e424d8a0292094ebd17e4c35454bb9abbd3a6cbed1aba70765 android.hardware.camera.metadata@3.7::types
# There should be no more HIDL HALs - please use AIDL instead.