[libcamera-devel,v2,06/11] libcamera: pipeline: rpi_stream: Explicitly name requestBuffer
diff mbox series

Message ID 20201015223750.58563-7-kieran.bingham@ideasonboard.com
State Accepted
Headers show
Series
  • Shadowed Variables
Related show

Commit Message

Kieran Bingham Oct. 15, 2020, 10:37 p.m. UTC
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@ideasonboard.com>
---
 src/libcamera/pipeline/raspberrypi/rpi_stream.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Niklas Söderlund Oct. 15, 2020, 11:21 p.m. UTC | #1
Hi Kieran,

On 2020-10-15 23:37:45 +0100, Kieran Bingham wrote:
> 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@ideasonboard.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  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
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch
diff mbox series

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);
 	}
 }