Merge "Handle logical camera devices properly" into main

This commit is contained in:
Treehugger Robot 2024-01-09 22:41:15 +00:00 committed by Gerrit Code Review
commit 20768c89d7

View file

@ -1399,6 +1399,12 @@ TEST_P(EvsAidlTest, HighPriorityCameraClient) {
// Test each reported camera
for (auto&& cam : mCameraInfo) {
bool isLogicalCam = false;
if (getPhysicalCameraIds(cam.id, isLogicalCam); isLogicalCam) {
LOG(INFO) << "Skip a logical device, " << cam.id;
continue;
}
// Request available display IDs
uint8_t targetDisplayId = 0;
std::vector<uint8_t> displayIds;
@ -1973,6 +1979,13 @@ TEST_P(EvsAidlTest, CameraStreamExternalBuffering) {
// Test each reported camera
for (auto&& cam : mCameraInfo) {
bool isLogicalCam = false;
getPhysicalCameraIds(cam.id, isLogicalCam);
if (isLogicalCam) {
LOG(INFO) << "Skip a logical device, " << cam.id;
continue;
}
// Read a target resolution from the metadata
Stream targetCfg = getFirstStreamConfiguration(
reinterpret_cast<camera_metadata_t*>(cam.metadata.data()));
@ -2014,9 +2027,6 @@ TEST_P(EvsAidlTest, CameraStreamExternalBuffering) {
}
}
bool isLogicalCam = false;
getPhysicalCameraIds(cam.id, isLogicalCam);
std::shared_ptr<IEvsCamera> pCam;
ASSERT_TRUE(mEnumerator->openCamera(cam.id, targetCfg, &pCam).isOk());
EXPECT_NE(pCam, nullptr);
@ -2027,11 +2037,6 @@ TEST_P(EvsAidlTest, CameraStreamExternalBuffering) {
// Request to import buffers
int delta = 0;
auto status = pCam->importExternalBuffers(buffers, &delta);
if (isLogicalCam) {
ASSERT_FALSE(status.isOk());
continue;
}
ASSERT_TRUE(status.isOk());
EXPECT_GE(delta, kBuffersToHold);