summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-11-22 17:31:08 +0100
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-01-12 16:10:37 +0100
commitdea689e1f260b904697a9c2f3d05b7b5068d85e1 (patch)
tree3f4af3e375e64a7e54c4a044e0620679f7fe1032 /test
parent13724144f9bfd22f79d56431061bc55a887c1d10 (diff)
libcamera: request: In addBuffer() do not fetch stream from Buffer
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>
Diffstat (limited to 'test')
-rw-r--r--test/camera/buffer_import.cpp2
-rw-r--r--test/camera/capture.cpp4
-rw-r--r--test/camera/statemachine.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp
index 171540ed..e5c010d8 100644
--- a/test/camera/buffer_import.cpp
+++ b/test/camera/buffer_import.cpp
@@ -268,7 +268,7 @@ public:
Request *request = camera_->createRequest(cookie);
std::unique_ptr<Buffer> buffer = stream_->createBuffer({ dmabuf, -1, -1 });
- request->addBuffer(move(buffer));
+ request->addBuffer(stream_, move(buffer));
camera_->queueRequest(request);
}
diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp
index 7cb76038..ca1ebe41 100644
--- a/test/camera/capture.cpp
+++ b/test/camera/capture.cpp
@@ -49,7 +49,7 @@ protected:
std::unique_ptr<Buffer> newBuffer = stream->createBuffer(buffer->index());
request = camera_->createRequest();
- request->addBuffer(std::move(newBuffer));
+ request->addBuffer(stream, std::move(newBuffer));
camera_->queueRequest(request);
}
@@ -101,7 +101,7 @@ protected:
return TestFail;
}
- if (request->addBuffer(std::move(buffer))) {
+ if (request->addBuffer(stream, std::move(buffer))) {
cout << "Failed to associating buffer with request" << endl;
return TestFail;
}
diff --git a/test/camera/statemachine.cpp b/test/camera/statemachine.cpp
index afa13ba7..f627b8f3 100644
--- a/test/camera/statemachine.cpp
+++ b/test/camera/statemachine.cpp
@@ -219,7 +219,7 @@ protected:
Stream *stream = *camera_->streams().begin();
std::unique_ptr<Buffer> buffer = stream->createBuffer(0);
- if (request->addBuffer(std::move(buffer)))
+ if (request->addBuffer(stream, std::move(buffer)))
return TestFail;
if (camera_->queueRequest(request))