Camera: VTS: Adjust test to handle optional readoutTimestamp support
With readout timestamp support becomes optional in b/309543399, we
need to adjust the VTS test to handle it.
Test: vendor testing
Bug: 354875531
Change-Id: I552b223f7834df83b8c0bae9f23ab7393a42b64a
diff --git a/camera/provider/aidl/vts/device_cb.cpp b/camera/provider/aidl/vts/device_cb.cpp
index 8a8b925..bfd1cd1 100644
--- a/camera/provider/aidl/vts/device_cb.cpp
+++ b/camera/provider/aidl/vts/device_cb.cpp
@@ -32,10 +32,11 @@
DeviceCb::DeviceCb(CameraAidlTest* parent, camera_metadata_t* staticMeta) : mParent(parent) {
mStaticMetadata = staticMeta;
+ parent->mSupportReadoutTimestamp = CameraAidlTest::isReadoutTimestampSupported(staticMeta);
}
ScopedAStatus DeviceCb::notify(const std::vector<NotifyMsg>& msgs) {
- std::vector<std::pair<bool, nsecs_t>> readoutTimestamps;
+ std::vector<nsecs_t> readoutTimestamps;
size_t count = msgs.size();
readoutTimestamps.resize(count);
@@ -44,11 +45,11 @@
const NotifyMsg& msg = msgs[i];
switch (msg.getTag()) {
case NotifyMsg::Tag::error:
- readoutTimestamps[i] = {false, 0};
+ readoutTimestamps[i] = 0;
break;
case NotifyMsg::Tag::shutter:
const auto& shutter = msg.get<NotifyMsg::Tag::shutter>();
- readoutTimestamps[i] = {true, shutter.readoutTimestamp};
+ readoutTimestamps[i] = shutter.readoutTimestamp;
break;
}
}
@@ -446,9 +447,8 @@
return notify;
}
-ScopedAStatus DeviceCb::notifyHelper(
- const std::vector<NotifyMsg>& msgs,
- const std::vector<std::pair<bool, nsecs_t>>& readoutTimestamps) {
+ScopedAStatus DeviceCb::notifyHelper(const std::vector<NotifyMsg>& msgs,
+ const std::vector<nsecs_t>& readoutTimestamps) {
std::lock_guard<std::mutex> l(mParent->mLock);
for (size_t i = 0; i < msgs.size(); i++) {
@@ -514,8 +514,7 @@
}
auto& r = itr->second;
r->shutterTimestamp = msg.get<NotifyMsg::Tag::shutter>().timestamp;
- r->shutterReadoutTimestampValid = readoutTimestamps[i].first;
- r->shutterReadoutTimestamp = readoutTimestamps[i].second;
+ r->shutterReadoutTimestamp = readoutTimestamps[i];
break;
}
}