diff options
author | alk3pInjection <webmaster@raspii.tech> | 2023-07-04 20:04:45 +0800 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2023-07-04 20:04:45 +0800 |
commit | e1390d22fae12df2784992b3ba238af8e90eaecc (patch) | |
tree | 52dfbc4cd9931c722b210f063c144fe97a706af5 /automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp | |
parent | b3f20c2aa61e4a6e07e8c06cf3623f1666620e1f (diff) | |
parent | 7c8943fde12ec5fb0f9629746c65e8b1bc78d1b4 (diff) |
Merge tag 'LA.QSSI.13.0.r1-10700-qssi.0' into tachibana-mr1tachibana-mr1
"LA.QSSI.13.0.r1-10700-qssi.0"
Change-Id: I11f0f2cb764e800ff1fd298c5a6443b98cf9a8a3
Diffstat (limited to 'automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp')
-rw-r--r-- | automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp | 92 |
1 files changed, 42 insertions, 50 deletions
diff --git a/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp b/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp index 623438f70e..9c8bfc4996 100644 --- a/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp +++ b/automotive/evs/1.1/vts/functional/VtsHalEvsV1_1TargetTest.cpp @@ -250,8 +250,7 @@ protected: // Stream configurations are found in metadata RawStreamConfig *ptr = reinterpret_cast<RawStreamConfig *>(streamCfgs.data.i32); for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) { - if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT && - ptr->format == HAL_PIXEL_FORMAT_RGBA_8888) { + if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT) { targetCfg.width = ptr->width; targetCfg.height = ptr->height; targetCfg.format = static_cast<PixelFormat>(ptr->format); @@ -631,29 +630,29 @@ TEST_P(EvsHidlTest, CameraToDisplayRoundTrip) { targetDisplayId = ids[0]; }); - // Request exclusive access to the first EVS display - sp<IEvsDisplay_1_1> pDisplay = pEnumerator->openDisplay_1_1(targetDisplayId); - ASSERT_NE(pDisplay, nullptr); - LOG(INFO) << "Display " << targetDisplayId << " is alreay in use."; - - // Get the display descriptor - pDisplay->getDisplayInfo_1_1([](const HwDisplayConfig& config, const HwDisplayState& state) { - ASSERT_GT(config.size(), 0); - ASSERT_GT(state.size(), 0); - - android::ui::DisplayMode* pConfig = (android::ui::DisplayMode*)config.data(); - const auto width = pConfig->resolution.getWidth(); - const auto height = pConfig->resolution.getHeight(); - LOG(INFO) << " Resolution: " << width << "x" << height; - ASSERT_GT(width, 0); - ASSERT_GT(height, 0); - - android::ui::DisplayState* pState = (android::ui::DisplayState*)state.data(); - ASSERT_NE(pState->layerStack, android::ui::INVALID_LAYER_STACK); - }); - // Test each reported camera for (auto&& cam: cameraInfo) { + // Request exclusive access to the first EVS display + sp<IEvsDisplay_1_1> pDisplay = pEnumerator->openDisplay_1_1(targetDisplayId); + ASSERT_NE(pDisplay, nullptr); + LOG(INFO) << "Display " << targetDisplayId << " is already in use."; + + // Get the display descriptor + pDisplay->getDisplayInfo_1_1([](const HwDisplayConfig& config, const HwDisplayState& state) { + ASSERT_GT(config.size(), 0); + ASSERT_GT(state.size(), 0); + + android::ui::DisplayMode* pConfig = (android::ui::DisplayMode*)config.data(); + const auto width = pConfig->resolution.getWidth(); + const auto height = pConfig->resolution.getHeight(); + LOG(INFO) << " Resolution: " << width << "x" << height; + ASSERT_GT(width, 0); + ASSERT_GT(height, 0); + + android::ui::DisplayState* pState = (android::ui::DisplayState*)state.data(); + ASSERT_NE(pState->layerStack, android::ui::INVALID_LAYER_STACK); + }); + bool isLogicalCam = false; getPhysicalCameraIds(cam.v1.cameraId, isLogicalCam); if (mIsHwModule && isLogicalCam) { @@ -708,10 +707,10 @@ TEST_P(EvsHidlTest, CameraToDisplayRoundTrip) { // Explicitly release the camera pEnumerator->closeCamera(pCam); activeCameras.clear(); - } - // Explicitly release the display - pEnumerator->closeDisplay(pDisplay); + // Explicitly release the display + pEnumerator->closeDisplay(pDisplay); + } } @@ -1632,12 +1631,12 @@ TEST_P(EvsHidlTest, HighPriorityCameraClient) { // Get the camera list loadCameraList(); - // Request exclusive access to the EVS display - sp<IEvsDisplay_1_0> pDisplay = pEnumerator->openDisplay(); - ASSERT_NE(pDisplay, nullptr); - // Test each reported camera for (auto&& cam: cameraInfo) { + // Request exclusive access to the EVS display + sp<IEvsDisplay_1_0> pDisplay = pEnumerator->openDisplay(); + ASSERT_NE(pDisplay, nullptr); + // Read a target resolution from the metadata Stream targetCfg = getFirstStreamConfiguration(reinterpret_cast<camera_metadata_t*>(cam.metadata.data())); @@ -1979,10 +1978,9 @@ TEST_P(EvsHidlTest, HighPriorityCameraClient) { pEnumerator->closeCamera(pCam1); activeCameras.clear(); + // Explicitly release the display + pEnumerator->closeDisplay(pDisplay); } - - // Explicitly release the display - pEnumerator->closeDisplay(pDisplay); } @@ -1998,12 +1996,12 @@ TEST_P(EvsHidlTest, CameraUseStreamConfigToDisplay) { // Get the camera list loadCameraList(); - // Request exclusive access to the EVS display - sp<IEvsDisplay_1_0> pDisplay = pEnumerator->openDisplay(); - ASSERT_NE(pDisplay, nullptr); - // Test each reported camera for (auto&& cam: cameraInfo) { + // Request exclusive access to the EVS display + sp<IEvsDisplay_1_0> pDisplay = pEnumerator->openDisplay(); + ASSERT_NE(pDisplay, nullptr); + // choose a configuration that has a frame rate faster than minReqFps. Stream targetCfg = {}; const int32_t minReqFps = 15; @@ -2017,13 +2015,12 @@ TEST_P(EvsHidlTest, CameraUseStreamConfigToDisplay) { // Stream configurations are found in metadata RawStreamConfig *ptr = reinterpret_cast<RawStreamConfig *>(streamCfgs.data.i32); for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) { - if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT && - ptr->format == HAL_PIXEL_FORMAT_RGBA_8888) { - + if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT) { if (ptr->width * ptr->height > maxArea && ptr->framerate >= minReqFps) { targetCfg.width = ptr->width; targetCfg.height = ptr->height; + targetCfg.format = static_cast<PixelFormat>(ptr->format); maxArea = ptr->width * ptr->height; foundCfg = true; @@ -2032,8 +2029,6 @@ TEST_P(EvsHidlTest, CameraUseStreamConfigToDisplay) { ++ptr; } } - targetCfg.format = - static_cast<PixelFormat>(HAL_PIXEL_FORMAT_RGBA_8888); if (!foundCfg) { // Current EVS camera does not provide stream configurations in the @@ -2082,10 +2077,10 @@ TEST_P(EvsHidlTest, CameraUseStreamConfigToDisplay) { // Explicitly release the camera pEnumerator->closeCamera(pCam); activeCameras.clear(); - } - // Explicitly release the display - pEnumerator->closeDisplay(pDisplay); + // Explicitly release the display + pEnumerator->closeDisplay(pDisplay); + } } @@ -2120,13 +2115,12 @@ TEST_P(EvsHidlTest, MultiCameraStreamUseConfig) { // Stream configurations are found in metadata RawStreamConfig *ptr = reinterpret_cast<RawStreamConfig *>(streamCfgs.data.i32); for (unsigned offset = 0; offset < streamCfgs.count; offset += kStreamCfgSz) { - if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT && - ptr->format == HAL_PIXEL_FORMAT_RGBA_8888) { - + if (ptr->direction == ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_OUTPUT) { if (ptr->width * ptr->height > maxArea && ptr->framerate >= minReqFps) { targetCfg.width = ptr->width; targetCfg.height = ptr->height; + targetCfg.format = static_cast<PixelFormat>(ptr->format); maxArea = ptr->width * ptr->height; foundCfg = true; @@ -2135,8 +2129,6 @@ TEST_P(EvsHidlTest, MultiCameraStreamUseConfig) { ++ptr; } } - targetCfg.format = - static_cast<PixelFormat>(HAL_PIXEL_FORMAT_RGBA_8888); if (!foundCfg) { LOG(INFO) << "Device " << cam.v1.cameraId |