Camera: VTS: Fix fence fd double close am: 3ad137edbb
am: 2603479470
am: 7c4bb95a18
am: 36f18e9327
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2539830 Change-Id: Ifa023065ee2380dd87c898275fcd0d1cf261fcf5 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
e1dcc40ec3
3 changed files with 17 additions and 3 deletions
|
@ -150,7 +150,7 @@ void CameraAidlTest::waitForReleaseFence(
|
|||
const native_handle_t* releaseFenceHandle = bufferAndTimestamp.buffer.releaseFence;
|
||||
if (releaseFenceHandle != nullptr && releaseFenceHandle->numFds == 1 &&
|
||||
releaseFenceHandle->data[0] >= 0) {
|
||||
releaseFence = new android::Fence(releaseFenceHandle->data[0]);
|
||||
releaseFence = new android::Fence(dup(releaseFenceHandle->data[0]));
|
||||
}
|
||||
if (releaseFence && releaseFence->isValid()) {
|
||||
releaseFence->wait(/*ms*/ 300);
|
||||
|
|
|
@ -552,6 +552,20 @@ class CameraAidlTest : public ::testing::TestWithParam<std::string> {
|
|||
hasInputBuffer(hasInput),
|
||||
collectedResult(1, 10),
|
||||
expectedPhysicalResults(extraPhysicalResult) {}
|
||||
|
||||
~InFlightRequest() {
|
||||
for (auto& buffer : resultOutputBuffers) {
|
||||
native_handle_t* acquireFenceHandle = const_cast<native_handle_t*>(
|
||||
buffer.buffer.acquireFence);
|
||||
native_handle_close(acquireFenceHandle);
|
||||
native_handle_delete(acquireFenceHandle);
|
||||
|
||||
native_handle_t* releaseFenceHandle = const_cast<native_handle_t*>(
|
||||
buffer.buffer.releaseFence);
|
||||
native_handle_close(releaseFenceHandle);
|
||||
native_handle_delete(releaseFenceHandle);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
static bool matchDeviceName(const std::string& deviceName, const std::string& providerType,
|
||||
|
|
|
@ -428,8 +428,8 @@ bool DeviceCb::processCaptureResultLocked(
|
|||
bufferId,
|
||||
outputBuffer,
|
||||
buffer.status,
|
||||
::android::makeFromAidl(buffer.acquireFence),
|
||||
::android::makeFromAidl(buffer.releaseFence)};
|
||||
::android::dupFromAidl(buffer.acquireFence),
|
||||
::android::dupFromAidl(buffer.releaseFence)};
|
||||
streamBufferAndTimestamp.timeStamp = systemTime();
|
||||
request->resultOutputBuffers.push_back(streamBufferAndTimestamp);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue