From dea689e1f260b904697a9c2f3d05b7b5068d85e1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>
Date: Fri, 22 Nov 2019 17:31:08 +0100
Subject: libcamera: request: In addBuffer() do not fetch stream from Buffer
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

In the FrameBuffer interface the stream will not be available from the
buffer object as the buffer might be allocated externally. The
application needs to explicitly state which stream the buffer is being
added for to the request.

Extend the addBuffer() function to get this information explicitly from
the caller.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/qcam/main_window.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/qcam')

diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
index 0a353e8b..8b3d9923 100644
--- a/src/qcam/main_window.cpp
+++ b/src/qcam/main_window.cpp
@@ -191,7 +191,7 @@ int MainWindow::startCapture()
 			goto error;
 		}
 
-		ret = request->addBuffer(std::move(buffer));
+		ret = request->addBuffer(stream, std::move(buffer));
 		if (ret < 0) {
 			std::cerr << "Can't set buffer for request" << std::endl;
 			goto error;
@@ -289,7 +289,7 @@ void MainWindow::requestComplete(Request *request)
 			return;
 		}
 
-		request->addBuffer(std::move(newBuffer));
+		request->addBuffer(stream, std::move(newBuffer));
 	}
 
 	camera_->queueRequest(request);
-- 
cgit v1.2.1