Camera: Fix high speed recording failure due to prepare()
In case application sends 2 consecutive setRepeatingBurst, the first
request may be preparing the video stream, whiel the second request
fails the isPreparing check.
Fix this by distinguishing between internal and external prepare. For
internal prepare, allow new requests to come through to the request
thread.
Bug: 114422231
Bug: 109830370
Test: Camera CTS
Change-Id: I55a7271e3924f2cb8cf9c452e934b070a82bc4ca
diff --git a/services/camera/libcameraservice/device3/Camera3StreamInterface.h b/services/camera/libcameraservice/device3/Camera3StreamInterface.h
index 2dde1c3..3d45c89 100644
--- a/services/camera/libcameraservice/device3/Camera3StreamInterface.h
+++ b/services/camera/libcameraservice/device3/Camera3StreamInterface.h
@@ -160,6 +160,11 @@
* PREPARING state. Otherwise, returns NOT_ENOUGH_DATA and transitions
* to PREPARING.
*
+ * blockRequest specifies whether prepare will block upcoming capture
+ * request. This flag should only be set to false if the caller guarantees
+ * the whole buffer preparation process is done before capture request
+ * comes in.
+ *
* Returns:
* OK if no more buffers need to be preallocated
* NOT_ENOUGH_DATA if calls to prepareNextBuffer are needed to finish
@@ -168,12 +173,12 @@
* INVALID_OPERATION if called when not in CONFIGURED state, or a
* valid buffer has already been returned to this stream.
*/
- virtual status_t startPrepare(int maxCount) = 0;
+ virtual status_t startPrepare(int maxCount, bool blockRequest) = 0;
/**
- * Check if the stream is mid-preparing.
+ * Check if the request on a stream is blocked by prepare.
*/
- virtual bool isPreparing() const = 0;
+ virtual bool isBlockedByPrepare() const = 0;
/**
* Continue stream buffer preparation by allocating the next