Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3387f1c8 authored by Emilian Peev's avatar Emilian Peev
Browse files

Camera: Add static metadata that can map device state to orientation

Allow camera providers to advertise the mapping between device state
and camera orientation.

Bug: 201005727
Test: VtsHalCameraProviderV2_4TargetTest
--gtest_filter=PerInstance/CameraHidlTest.getCameraCharacteristics/0_internal_0

Change-Id: Ibb035f4dc3d8af1106ac08f86e43b953ddcbf55b
parent 773ed6dd
Loading
Loading
Loading
Loading
+50 −0
Original line number Diff line number Diff line
/*
 * 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
 */
+14 −0
Original line number Diff line number Diff line
@@ -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);
}
+3 −0
Original line number Diff line number Diff line
@@ -900,4 +900,7 @@ c8a57364f6ad20842be14f4db284df5304f7521ca8eac6bcc1fa6c5b466fb8a6 android.hardwar
0821f516e4d428bc15251969f7e19411c94d8f2ccbd99e1fc8168d8e49e38b0f android.hardware.wifi.supplicant@1.4::types
4a087a308608d146b022ebc15633de989f5f4dfe1491a83fa41763290a82e40d 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.