@@ -2007,7 +2007,7 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques
worker_.queueRequest(descriptor.request_.get());
{
- MutexLocker lock(mutex_);
+ MutexLocker descriptorsLock(descriptorsMutex_);
descriptors_[descriptor.request_->cookie()] = std::move(descriptor);
}
@@ -2018,7 +2018,7 @@ void CameraDevice::requestComplete(Request *request)
{
decltype(descriptors_)::node_type node;
{
- MutexLocker lock(mutex_);
+ MutexLocker descriptorsLock(descriptorsMutex_);
auto it = descriptors_.find(request->cookie());
if (it == descriptors_.end()) {
/*
@@ -24,6 +24,7 @@
#include "libcamera/internal/buffer.h"
#include "libcamera/internal/log.h"
#include "libcamera/internal/message.h"
+#include "libcamera/internal/thread.h"
#include "camera_metadata.h"
#include "camera_stream.h"
@@ -134,7 +135,7 @@ private:
std::map<int, libcamera::PixelFormat> formatsMap_;
std::vector<CameraStream> streams_;
- std::mutex mutex_; /* Protect descriptors_ */
+ libcamera::Mutex descriptorsMutex_; /* Protects descriptors_. */
std::map<uint64_t, Camera3RequestDescriptor> descriptors_;
std::string maker_;