Camera: Invalidate buffer cache for partial buffer request failure
In case partial buffer request fails for a particular stream, the
successfully allocated buffers need to be invalidated from the
mBufferIdMaps. Otherwise, the camera frameworks thinks the HAL already
knows about the buffer, and sends a null buffer handle for a new buffer.
Test: Vendor testing
Bug: 198122465
Bug: 196202313
Change-Id: I73a710aebf102fcbb49e53b52c18e4835986f40f
diff --git a/services/camera/libcameraservice/device3/Camera3OutputInterface.h b/services/camera/libcameraservice/device3/Camera3OutputInterface.h
index 8817833..40eef1d 100644
--- a/services/camera/libcameraservice/device3/Camera3OutputInterface.h
+++ b/services/camera/libcameraservice/device3/Camera3OutputInterface.h
@@ -50,6 +50,10 @@
// return pair of (newlySeenBuffer?, bufferId)
virtual std::pair<bool, uint64_t> getBufferId(const buffer_handle_t& buf, int streamId) = 0;
+ // Return the removed buffer ID if input cache is found.
+ // Otherwise return BUFFER_ID_NO_BUFFER
+ virtual uint64_t removeOneBufferCache(int streamId, const native_handle_t* handle) = 0;
+
// Find a buffer_handle_t based on frame number and stream ID
virtual status_t popInflightBuffer(int32_t frameNumber, int32_t streamId,
/*out*/ buffer_handle_t **buffer) = 0;