summaryrefslogtreecommitdiff
path: root/src/libcamera/v4l2_videodevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/v4l2_videodevice.cpp')
-rw-r--r--src/libcamera/v4l2_videodevice.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp
index c016e6ad..9b5807d3 100644
--- a/src/libcamera/v4l2_videodevice.cpp
+++ b/src/libcamera/v4l2_videodevice.cpp
@@ -1491,6 +1491,9 @@ int V4L2VideoDevice::releaseBuffers()
* The best available V4L2 buffer is picked for \a buffer using the V4L2 buffer
* cache.
*
+ * Note that queueBuffer() will fail if the device is in the process of being
+ * stopped from a streaming state through streamOff().
+ *
* \return 0 on success or a negative error code otherwise
*/
int V4L2VideoDevice::queueBuffer(FrameBuffer *buffer)
@@ -1499,6 +1502,11 @@ int V4L2VideoDevice::queueBuffer(FrameBuffer *buffer)
struct v4l2_buffer buf = {};
int ret;
+ if (state_ == State::Stopping) {
+ LOG(V4L2, Error) << "Device is in a stopping state.";
+ return -ESHUTDOWN;
+ }
+
/*
* Pipeline handlers should not requeue buffers after releasing the
* buffers on the device. Any occurence of this error should be fixed