[libcamera-devel] [PATCH v2 06/11] libcamera: pipeline: rpi_stream: Explicitly name requestBuffer

Kieran Bingham kieran.bingham at ideasonboard.com
Fri Oct 16 00:37:45 CEST 2020


The FrameBuffer used to track any addition to the reqeust in an
under-run event was aliased against the returned buffer, being placed
back on the availableBuffers_ queue.

Rename the aliased variable to be more explicit that it is a separate
Buffer.

Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---
 src/libcamera/pipeline/raspberrypi/rpi_stream.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
index 1a42cc17bcba..3a5dadab81e0 100644
--- a/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
+++ b/src/libcamera/pipeline/raspberrypi/rpi_stream.cpp
@@ -163,9 +163,9 @@ void Stream::returnBuffer(FrameBuffer *buffer)
 	 * If so, do it now as availableBuffers_ will not be empty.
 	 */
 	while (!requestBuffers_.empty()) {
-		FrameBuffer *buffer = requestBuffers_.front();
+		FrameBuffer *requestBuffer = requestBuffers_.front();
 
-		if (!buffer) {
+		if (!requestBuffer) {
 			/*
 			 * We want to queue an internal buffer, but none
 			 * are available. Can't do anything, quit the loop.
@@ -177,12 +177,12 @@ void Stream::returnBuffer(FrameBuffer *buffer)
 			 * We want to queue an internal buffer, and at least one
 			 * is available.
 			 */
-			buffer = availableBuffers_.front();
+			requestBuffer = availableBuffers_.front();
 			availableBuffers_.pop();
 		}
 
 		requestBuffers_.pop();
-		queueToDevice(buffer);
+		queueToDevice(requestBuffer);
 	}
 }
 
-- 
2.25.1



More information about the libcamera-devel mailing list