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

Commit aba88c6c authored by Yin-Chia Yeh's avatar Yin-Chia Yeh
Browse files

Camera: fix unknown bufId issue

It's legit to have bufId 0 in processCaptureResult with HAL buffer
manager, but not for returnStreamBuffers.

Test: the failed test can now pass
Bug: 135565913
Change-Id: I05947bc159bb9ba00a670b98d4622f685b4ac760
parent 9155a07d
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -1233,7 +1233,14 @@ bool CameraHidlTest::DeviceCb::processCaptureResultLocked(const CaptureResult& r
    }

    if (mUseHalBufManager) {
        returnStreamBuffers(results.outputBuffers);
        // Don't return buffers of bufId 0 (empty buffer)
        std::vector<StreamBuffer> buffers;
        for (const auto& sb : results.outputBuffers) {
            if (sb.bufferId != 0) {
                buffers.push_back(sb);
            }
        }
        returnStreamBuffers(buffers);
    }
    return notify;
}