Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ebf53f4 authored by Eino-Ville Talvala's avatar Eino-Ville Talvala
Browse files

camera.device@3.2 wrapper: Close release fence FDs

Freeing the native handle isn't enough; we need to close the fence FDs
after sending them to the camera service, since that's the behavior
that the legacy HAL interface requires.

Test: Camera CTS continues to pass.
Bug: 38482274
Change-Id: I879de566dcafecc1b899d79e68b38ea39b91a37e
parent 4197ba02
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -403,12 +403,14 @@ void CameraDeviceSession::ResultBatcher::freeReleaseFences(hidl_vec<CaptureResul
        if (result.inputBuffer.releaseFence.getNativeHandle() != nullptr) {
            native_handle_t* handle = const_cast<native_handle_t*>(
                    result.inputBuffer.releaseFence.getNativeHandle());
            native_handle_close(handle);
            native_handle_delete(handle);
        }
        for (auto& buf : result.outputBuffers) {
            if (buf.releaseFence.getNativeHandle() != nullptr) {
                native_handle_t* handle = const_cast<native_handle_t*>(
                        buf.releaseFence.getNativeHandle());
                native_handle_close(handle);
                native_handle_delete(handle);
            }
        }