summaryrefslogtreecommitdiff
path: root/src/gstreamer/gstlibcamerasrc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gstreamer/gstlibcamerasrc.cpp')
-rw-r--r--src/gstreamer/gstlibcamerasrc.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp
index ca4e8854..d1d610c5 100644
--- a/src/gstreamer/gstlibcamerasrc.cpp
+++ b/src/gstreamer/gstlibcamerasrc.cpp
@@ -133,6 +133,7 @@ struct GstLibcameraSrcState {
int queueRequest();
void requestCompleted(Request *request);
int processRequest();
+ void clearRequests();
};
struct _GstLibcameraSrc {
@@ -318,6 +319,12 @@ int GstLibcameraSrcState::processRequest()
return err;
}
+void GstLibcameraSrcState::clearRequests()
+{
+ GLibLocker locker(&lock_);
+ completedRequests_ = {};
+}
+
static bool
gst_libcamera_src_open(GstLibcameraSrc *self)
{
@@ -628,11 +635,7 @@ gst_libcamera_src_task_leave([[maybe_unused]] GstTask *task,
GST_DEBUG_OBJECT(self, "Streaming thread is about to stop");
state->cam_->stop();
-
- {
- GLibLocker locker(&state->lock_);
- state->completedRequests_ = {};
- }
+ state->clearRequests();
{
GLibRecLocker locker(&self->stream_lock);