summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cam/capture.cpp9
-rw-r--r--src/cam/capture.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp
index 7580f798..113ea49d 100644
--- a/src/cam/capture.cpp
+++ b/src/cam/capture.cpp
@@ -157,6 +157,15 @@ void Capture::requestComplete(Request *request)
if (request->status() == Request::RequestCancelled)
return;
+ /*
+ * Defer processing of the completed request to the event loop, to avoid
+ * blocking the camera manager thread.
+ */
+ loop_->callLater([=]() { processRequest(request); });
+}
+
+void Capture::processRequest(Request *request)
+{
const Request::BufferMap &buffers = request->buffers();
/*
diff --git a/src/cam/capture.h b/src/cam/capture.h
index 45e5e8a9..d21c95a2 100644
--- a/src/cam/capture.h
+++ b/src/cam/capture.h
@@ -33,6 +33,7 @@ private:
int capture(libcamera::FrameBufferAllocator *allocator);
void requestComplete(libcamera::Request *request);
+ void processRequest(libcamera::Request *request);
std::shared_ptr<libcamera::Camera> camera_;
libcamera::CameraConfiguration *config_;