From fa2a909836de0a82d0f4a52ffdf5d0cacd74eed9 Mon Sep 17 00:00:00 2001 From: Shuzhen Wang Date: Sun, 23 Jun 2019 22:52:16 -0700 Subject: [PATCH] Camera: VTS: Allow unsupported logical/physical combination Multi-camera API requirement is relaxed to allow camera device not support physical stream combinations. Adjust the test accordingly. Test: processMultiCaptureRequestPreview Bug: 135688720 Bug: 135728906 Change-Id: I8c5269c5d3fd7f6eef440c818706629af2233196 --- .../VtsHalCameraProviderV2_4TargetTest.cpp | 37 ++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp index 200dd3f199..6cdbf0c5d6 100644 --- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp +++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp @@ -755,7 +755,8 @@ public: uint32_t *partialResultCount /*out*/, bool *useHalBufManager /*out*/, sp *cb /*out*/, - uint32_t streamConfigCounter = 0); + uint32_t streamConfigCounter = 0, + bool allowUnsupport = false); void configurePreviewStream(const std::string &name, int32_t deviceVersion, sp provider, const AvailableStream *previewThreshold, @@ -4048,7 +4049,7 @@ TEST_F(CameraHidlTest, processMultiCaptureRequestPreview) { for (const auto& name : cameraDeviceNames) { int deviceVersion = getCameraDeviceVersion(name, mProviderType); - if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_4) { + if (deviceVersion < CAMERA_DEVICE_API_VERSION_3_5) { continue; } std::string version, deviceId; @@ -4120,8 +4121,11 @@ TEST_F(CameraHidlTest, processMultiCaptureRequestPreview) { configurePreviewStreams3_4(name, deviceVersion, mProvider, &previewThreshold, physicalIds, &session3_4, &session3_5, &previewStream, &halStreamConfig /*out*/, &supportsPartialResults /*out*/, &partialResultCount /*out*/, - &useHalBufManager /*out*/, &cb /*out*/); - ASSERT_NE(session3_4, nullptr); + &useHalBufManager /*out*/, &cb /*out*/, 0 /*streamConfigCounter*/, + true /*allowUnsupport*/); + if (session3_5 == nullptr) { + continue; + } std::shared_ptr resultQueue; auto resultQueueRet = @@ -5167,7 +5171,8 @@ void CameraHidlTest::configurePreviewStreams3_4(const std::string &name, int32_t uint32_t *partialResultCount /*out*/, bool *useHalBufManager /*out*/, sp *outCb /*out*/, - uint32_t streamConfigCounter) { + uint32_t streamConfigCounter, + bool allowUnsupport) { ASSERT_NE(nullptr, session3_4); ASSERT_NE(nullptr, session3_5); ASSERT_NE(nullptr, halStreamConfig); @@ -5266,6 +5271,28 @@ void CameraHidlTest::configurePreviewStreams3_4(const std::string &name, int32_t }); ASSERT_TRUE(ret.isOk()); + ASSERT_TRUE(!allowUnsupport || deviceVersion == CAMERA_DEVICE_API_VERSION_3_5); + if (allowUnsupport) { + sp cameraDevice3_5; + castDevice(device3_x, deviceVersion, &cameraDevice3_5); + + bool supported = false; + ret = cameraDevice3_5->isStreamCombinationSupported(config3_4, + [&supported](Status s, bool combStatus) { + ASSERT_TRUE((Status::OK == s) || + (Status::METHOD_NOT_SUPPORTED == s)); + if (Status::OK == s) { + supported = combStatus; + } + }); + ASSERT_TRUE(ret.isOk()); + // If stream combination is not supported, return null session. + if (!supported) { + *session3_5 = nullptr; + return; + } + } + if (*session3_5 != nullptr) { config3_5.v3_4 = config3_4; config3_5.streamConfigCounter = streamConfigCounter;