diff options
Diffstat (limited to 'src/libcamera/v4l2_videodevice.cpp')
-rw-r--r-- | src/libcamera/v4l2_videodevice.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index 86e299c0..c43d7cc5 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -1089,7 +1089,9 @@ int V4L2VideoDevice::streamOn() * \brief Stop the video stream * * Buffers that are still queued when the video stream is stopped are - * implicitly dequeued, but no bufferReady signal is emitted for them. + * immediately dequeued with their status set to Buffer::BufferError, + * and the bufferReady signal is emitted for them. The order in which those + * buffers are dequeued is not specified. * * \return 0 on success or a negative error code otherwise */ @@ -1104,6 +1106,16 @@ int V4L2VideoDevice::streamOff() return ret; } + /* Send back all queued buffers. */ + for (auto it : queuedBuffers_) { + unsigned int index = it.first; + Buffer *buffer = it.second; + + buffer->index_ = index; + buffer->cancel(); + bufferReady.emit(buffer); + } + queuedBuffers_.clear(); fdEvent_->setEnabled(false); |