[libcamera-devel] [PATCH 11/30] libcamera: v4l2_videodevice: Align which type variable is used in queueBuffer()

Niklas Söderlund niklas.soderlund at ragnatech.se
Wed Nov 27 00:36:01 CET 2019


Reading V4L2VideoDevice::queueBuffer() is confusing since buf.type is
first set to bufferType_ but then both variables are used in V4L2 macros
to operate based on which type of buffer is being processed. Aligen on
only using buf.type since it have the most existing users.

Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
---
 src/libcamera/v4l2_videodevice.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index 166b0abc1b101f88..7b6fa5347ef320f8 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -1000,7 +1000,7 @@ int V4L2VideoDevice::queueBuffer(Buffer *buffer)
 		buf.m.planes = v4l2Planes;
 	}
 
-	if (V4L2_TYPE_IS_OUTPUT(bufferType_)) {
+	if (V4L2_TYPE_IS_OUTPUT(buf.type)) {
 		buf.bytesused = buffer->bytesused_;
 		buf.sequence = buffer->sequence_;
 		buf.timestamp.tv_sec = buffer->timestamp_ / 1000000000;
-- 
2.24.0



More information about the libcamera-devel mailing list