From 7a9ee22a5154f1cfe85b472123ee4e027a421ae4 Mon Sep 17 00:00:00 2001 From: Jayant Chowdhary Date: Fri, 26 Jan 2024 00:27:29 +0000 Subject: [PATCH] Camera VTS: Test only CROPPED_RAW use case for RAW_SENSOR streams There are no mandatory stream combinations for RAW_SENSOR streams that do not involve the CROPPED_RAW stream use case. So we don't need to test stream non CROPPED_RAW stream use cases with the RAW_SENSOR format, since we don't have a definite answer to whether they will be supported or not. Bug: 317773720 Test: Camera VTS on cf Test: Vendor testing Merged-In: I0870e90ae68a5e35196f0ba0afaa6b8bf7fbfbd8 Change-Id: I0870e90ae68a5e35196f0ba0afaa6b8bf7fbfbd8 Signed-off-by: Jayant Chowdhary (cherry picked from commit 6847115a005833c62331d77f7791ab9667aac493) --- camera/provider/aidl/vts/camera_aidl_test.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp index 5f9d605ef3..e15de9e265 100644 --- a/camera/provider/aidl/vts/camera_aidl_test.cpp +++ b/camera/provider/aidl/vts/camera_aidl_test.cpp @@ -2212,18 +2212,20 @@ void CameraAidlTest::configureStreamUseCaseInternal(const AvailableStream &thres ASSERT_NE(0u, outputPreviewStreams.size()); // Combine valid and invalid stream use cases - std::vector useCases(kMandatoryUseCases); - useCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW + 1); + std::vector testedUseCases; + testedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW + 1); std::vector supportedUseCases; if (threshold.format == static_cast(PixelFormat::RAW16)) { // If the format is RAW16, supported use case is only CROPPED_RAW. // All others are unsupported for this format. - useCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW); + testedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW); supportedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW); supportedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT); } else { camera_metadata_ro_entry entry; + testedUseCases.insert(testedUseCases.end(), kMandatoryUseCases.begin(), + kMandatoryUseCases.end()); auto retcode = find_camera_metadata_ro_entry( staticMeta, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, &entry); if ((0 == retcode) && (entry.count > 0)) { @@ -2264,7 +2266,7 @@ void CameraAidlTest::configureStreamUseCaseInternal(const AvailableStream &thres ASSERT_TRUE(ret.isOk()); config.sessionParams = req; - for (int64_t useCase : useCases) { + for (int64_t useCase : testedUseCases) { bool useCaseSupported = std::find(supportedUseCases.begin(), supportedUseCases.end(), useCase) != supportedUseCases.end();