summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/camera/capture.cpp19
-rw-r--r--test/camera/statemachine.cpp6
2 files changed, 16 insertions, 9 deletions
diff --git a/test/camera/capture.cpp b/test/camera/capture.cpp
index 7ce247cc..ff1cbd6c 100644
--- a/test/camera/capture.cpp
+++ b/test/camera/capture.cpp
@@ -34,9 +34,13 @@ protected:
completeRequestsCount_++;
- /* Reuse the buffers for a new request. */
+ /* Create a new request. */
+ Stream *stream = buffers.begin()->first;
+ Buffer *buffer = buffers.begin()->second;
+ std::unique_ptr<Buffer> newBuffer = stream->createBuffer(buffer->index());
+
request = camera_->createRequest();
- request->setBuffers(buffers);
+ request->addBuffer(std::move(newBuffer));
camera_->queueRequest(request);
}
@@ -78,15 +82,20 @@ protected:
Stream *stream = cfg.stream();
BufferPool &pool = stream->bufferPool();
std::vector<Request *> requests;
- for (Buffer &buffer : pool.buffers()) {
+ for (unsigned int i = 0; i < pool.count(); ++i) {
Request *request = camera_->createRequest();
if (!request) {
cout << "Failed to create request" << endl;
return TestFail;
}
- std::map<Stream *, Buffer *> map = { { stream, &buffer } };
- if (request->setBuffers(map)) {
+ std::unique_ptr<Buffer> buffer = stream->createBuffer(i);
+ if (!buffer) {
+ cout << "Failed to create buffer " << i << endl;
+ return TestFail;
+ }
+
+ if (request->addBuffer(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 84d2a6fa..12d5e0e1 100644
--- a/test/camera/statemachine.cpp
+++ b/test/camera/statemachine.cpp
@@ -211,10 +211,8 @@ protected:
return TestFail;
Stream *stream = *camera_->streams().begin();
- BufferPool &pool = stream->bufferPool();
- Buffer &buffer = pool.buffers().front();
- std::map<Stream *, Buffer *> map = { { stream, &buffer } };
- if (request->setBuffers(map))
+ std::unique_ptr<Buffer> buffer = stream->createBuffer(0);
+ if (request->addBuffer(std::move(buffer)))
return TestFail;
if (camera_->queueRequest(request))