diff options
Diffstat (limited to 'test/camera/statemachine.cpp')
-rw-r--r-- | test/camera/statemachine.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/camera/statemachine.cpp b/test/camera/statemachine.cpp index f627b8f3..f3a7ca7c 100644 --- a/test/camera/statemachine.cpp +++ b/test/camera/statemachine.cpp @@ -185,6 +185,12 @@ protected: if (camera_->allocateBuffers()) return TestFail; + /* Use internally allocated buffers. */ + allocator_ = FrameBufferAllocator::create(camera_); + Stream *stream = *camera_->streams().begin(); + if (allocator_->allocate(stream) < 0) + return TestFail; + if (camera_->start()) return TestFail; @@ -218,8 +224,7 @@ protected: return TestFail; Stream *stream = *camera_->streams().begin(); - std::unique_ptr<Buffer> buffer = stream->createBuffer(0); - if (request->addBuffer(stream, std::move(buffer))) + if (request->addBuffer(stream, allocator_->buffers(stream)[0].get())) return TestFail; if (camera_->queueRequest(request)) @@ -229,6 +234,8 @@ protected: if (camera_->stop()) return TestFail; + delete allocator_; + if (camera_->freeBuffers()) return TestFail; @@ -283,6 +290,7 @@ protected: } std::unique_ptr<CameraConfiguration> defconf_; + FrameBufferAllocator *allocator_; }; } /* namespace */ |