libcamera: v4l2_videodevice: Add helper to queue all buffers
When starting the stream on a capture video device it is often needed to queue all the allocated buffers. Add a helper method to do so, and refactor the existing queueBuffer() method to make it clearer. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
parent
33d3c4e204
commit
9bb36ec274
5 changed files with 70 additions and 24 deletions
|
@ -117,11 +117,10 @@ protected:
|
|||
capture_->bufferReady.connect(this, &BufferSharingTest::captureBufferReady);
|
||||
output_->bufferReady.connect(this, &BufferSharingTest::outputBufferReady);
|
||||
|
||||
/* Queue all the buffers to the capture device. */
|
||||
for (Buffer &buffer : pool_.buffers()) {
|
||||
if (capture_->queueBuffer(&buffer))
|
||||
return TestFail;
|
||||
}
|
||||
std::vector<std::unique_ptr<Buffer>> buffers;
|
||||
buffers = capture_->queueAllBuffers();
|
||||
if (buffers.empty())
|
||||
return TestFail;
|
||||
|
||||
ret = capture_->streamOn();
|
||||
if (ret) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue