Revert "Revert "Camera: VTS: Require ConstructDefaultSettings fo..."

Revert submission 25718441-revert-25658204-EnableFeatureCombination-KTSPSCPBVP

Reason for revert: Re-land HAL implementation of feature combination query

Reverted changes: /q/submissionid:25718441-revert-25658204-EnableFeatureCombination-KTSPSCPBVP

Bug: 309627704
Change-Id: Iaec3f2ea4d028216a381f6c2ef5f2f019adabc46
This commit is contained in:
Shuzhen Wang 2023-12-20 23:54:38 +00:00
parent 7a237d1545
commit dba6eaa0ba
3 changed files with 18 additions and 22 deletions

View file

@ -531,11 +531,7 @@ TEST_P(CameraAidlTest, constructDefaultRequestSettings) {
}
if (ret.isOk()) {
const camera_metadata_t* metadata = (camera_metadata_t*)rawMetadata.metadata.data();
size_t expectedSize = rawMetadata.metadata.size();
int result = validate_camera_metadata_structure(metadata, &expectedSize);
ASSERT_TRUE((result == 0) || (result == CAMERA_METADATA_VALIDATION_SHIFTED));
verifyRequestTemplate(metadata, reqTemplate);
validateDefaultRequestMetadata(reqTemplate, rawMetadata);
} else {
ASSERT_EQ(0u, rawMetadata.metadata.size());
}
@ -546,24 +542,12 @@ TEST_P(CameraAidlTest, constructDefaultRequestSettings) {
ndk::ScopedAStatus ret2 =
device->constructDefaultRequestSettings(reqTemplate, &rawMetadata2);
// TODO: Do not allow OPERATION_NOT_SUPPORTED once HAL
// implementation is in place.
if (static_cast<Status>(ret2.getServiceSpecificError()) !=
Status::OPERATION_NOT_SUPPORTED) {
ASSERT_EQ(ret.isOk(), ret2.isOk());
ASSERT_EQ(ret.getStatus(), ret2.getStatus());
ASSERT_EQ(ret.isOk(), ret2.isOk());
ASSERT_EQ(ret.getStatus(), ret2.getStatus());
ASSERT_EQ(rawMetadata.metadata.size(), rawMetadata2.metadata.size());
if (ret2.isOk()) {
const camera_metadata_t* metadata =
(camera_metadata_t*)rawMetadata2.metadata.data();
size_t expectedSize = rawMetadata2.metadata.size();
int result =
validate_camera_metadata_structure(metadata, &expectedSize);
ASSERT_TRUE((result == 0) ||
(result == CAMERA_METADATA_VALIDATION_SHIFTED));
verifyRequestTemplate(metadata, reqTemplate);
}
ASSERT_EQ(rawMetadata.metadata.size(), rawMetadata2.metadata.size());
if (ret2.isOk()) {
validateDefaultRequestMetadata(reqTemplate, rawMetadata2);
}
}
}

View file

@ -4026,3 +4026,12 @@ void CameraAidlTest::getSupportedDurations(const camera_metadata_t* ch, uint32_t
}
}
}
void CameraAidlTest::validateDefaultRequestMetadata(RequestTemplate reqTemplate,
const CameraMetadata& rawMetadata) {
const camera_metadata_t* metadata = (camera_metadata_t*)rawMetadata.metadata.data();
size_t expectedSize = rawMetadata.metadata.size();
int result = validate_camera_metadata_structure(metadata, &expectedSize);
ASSERT_TRUE((result == 0) || (result == CAMERA_METADATA_VALIDATION_SHIFTED));
verifyRequestTemplate(metadata, reqTemplate);
}

View file

@ -588,6 +588,9 @@ class CameraAidlTest : public ::testing::TestWithParam<std::string> {
static void waitForReleaseFence(
std::vector<InFlightRequest::StreamBufferAndTimestamp>& resultOutputBuffers);
static void validateDefaultRequestMetadata(RequestTemplate reqTemplate,
const CameraMetadata& rawMetadata);
// Map from frame number to the in-flight request state
typedef std::unordered_map<uint32_t, std::shared_ptr<InFlightRequest>> InFlightMap;