diff options
author | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2019-12-18 18:47:45 +0100 |
---|---|---|
committer | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2020-01-12 16:10:37 +0100 |
commit | f0d928b56eb3cf34bd61a94ccdaeedafd8108c49 (patch) | |
tree | cace3dc35ca1614f15c5f1c3aaee839a4ceb4a13 /test/v4l2_videodevice/capture_async.cpp | |
parent | cadae67e45785dc5dc005adb63c2dec841f44b1d (diff) |
test: v4l2_videodevice: Switch to FrameBuffer interface
The V4L2VideoDevice class can now operate using a FrameBuffer interface,
switch all test cases to use it.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'test/v4l2_videodevice/capture_async.cpp')
-rw-r--r-- | test/v4l2_videodevice/capture_async.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/v4l2_videodevice/capture_async.cpp b/test/v4l2_videodevice/capture_async.cpp index f62bbd83..a57abed3 100644 --- a/test/v4l2_videodevice/capture_async.cpp +++ b/test/v4l2_videodevice/capture_async.cpp @@ -20,7 +20,7 @@ public: CaptureAsyncTest() : V4L2VideoDeviceTest("vimc", "Raw Capture 0"), frames(0) {} - void receiveBuffer(Buffer *buffer) + void receiveBuffer(FrameBuffer *buffer) { std::cout << "Buffer received" << std::endl; frames++; @@ -38,18 +38,18 @@ protected: Timer timeout; int ret; - pool_.createBuffers(bufferCount); - - ret = capture_->exportBuffers(&pool_); - if (ret) + ret = capture_->exportBuffers(bufferCount, &buffers_); + if (ret < 0) return TestFail; - capture_->bufferReady.connect(this, &CaptureAsyncTest::receiveBuffer); + capture_->frameBufferReady.connect(this, &CaptureAsyncTest::receiveBuffer); - std::vector<std::unique_ptr<Buffer>> buffers; - buffers = capture_->queueAllBuffers(); - if (buffers.empty()) - return TestFail; + for (const std::unique_ptr<FrameBuffer> &buffer : buffers_) { + if (capture_->queueBuffer(buffer.get())) { + std::cout << "Failed to queue buffer" << std::endl; + return TestFail; + } + } ret = capture_->streamOn(); if (ret) |