diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-06-26 15:42:57 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-06-26 15:42:57 +0000 |
| commit | d4686a1a0674354311108e25c625bc2599c625f4 (patch) | |
| tree | 34a14068ac9a1c915089261ed0bdc5ce6e1923e0 | |
| parent | 6c4e33d079b2d8dbc13f3558a4aecaacd0f247df (diff) | |
| parent | fa2a909836de0a82d0f4a52ffdf5d0cacd74eed9 (diff) | |
| download | android_hardware_interfaces-d4686a1a0674354311108e25c625bc2599c625f4.tar.gz android_hardware_interfaces-d4686a1a0674354311108e25c625bc2599c625f4.tar.bz2 android_hardware_interfaces-d4686a1a0674354311108e25c625bc2599c625f4.zip | |
Merge "Camera: VTS: Allow unsupported logical/physical combination" into qt-dev
| -rw-r--r-- | camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp | 37 |
1 files 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 c94c825a5..86c2c1e15 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<DeviceCb> *cb /*out*/, - uint32_t streamConfigCounter = 0); + uint32_t streamConfigCounter = 0, + bool allowUnsupport = false); void configurePreviewStream(const std::string &name, int32_t deviceVersion, sp<ICameraProvider> provider, const AvailableStream *previewThreshold, @@ -4055,7 +4056,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; @@ -4127,8 +4128,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<ResultMetadataQueue> resultQueue; auto resultQueueRet = @@ -5174,7 +5178,8 @@ void CameraHidlTest::configurePreviewStreams3_4(const std::string &name, int32_t uint32_t *partialResultCount /*out*/, bool *useHalBufManager /*out*/, sp<DeviceCb> *outCb /*out*/, - uint32_t streamConfigCounter) { + uint32_t streamConfigCounter, + bool allowUnsupport) { ASSERT_NE(nullptr, session3_4); ASSERT_NE(nullptr, session3_5); ASSERT_NE(nullptr, halStreamConfig); @@ -5273,6 +5278,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<device::V3_5::ICameraDevice> 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; |
