From 7b86854e4014b10844848f9619c648e6ccfbf9c6 Mon Sep 17 00:00:00 2001 From: Hirokazu Honda Date: Wed, 1 Dec 2021 16:53:39 +0900 Subject: v4l2: Consolidate mutex classes to Mutex and MutexLocker std::mutex and std::unique_lock are used in v4l2 directory, mixing Mutex and MutexLocker. This consolidates them to Mutex and MutexLocker. This also fixes vidioc_dqbuf argument to take Mutex instead of MutexLocker. Signed-off-by: Hirokazu Honda Reviewed-by: Laurent Pinchart Reviewed-by: Umang Jain Signed-off-by: Laurent Pinchart --- src/v4l2/v4l2_camera_proxy.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/v4l2/v4l2_camera_proxy.cpp') diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp index 3610e63c..79bc880d 100644 --- a/src/v4l2/v4l2_camera_proxy.cpp +++ b/src/v4l2/v4l2_camera_proxy.cpp @@ -575,7 +575,7 @@ int V4L2CameraProxy::vidioc_qbuf(V4L2CameraFile *file, struct v4l2_buffer *arg) } int V4L2CameraProxy::vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg, - MutexLocker *locker) + Mutex *lock) { LOG(V4L2Compat, Debug) << "Servicing vidioc_dqbuf fd = " << file->efd(); @@ -593,9 +593,9 @@ int V4L2CameraProxy::vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg, return -EINVAL; if (!file->nonBlocking()) { - locker->unlock(); + lock->unlock(); vcam_->waitForBufferAvailable(); - locker->lock(); + lock->lock(); } else if (!vcam_->isBufferAvailable()) return -EAGAIN; @@ -753,7 +753,7 @@ int V4L2CameraProxy::ioctl(V4L2CameraFile *file, unsigned long request, void *ar ret = vidioc_qbuf(file, static_cast(arg)); break; case VIDIOC_DQBUF: - ret = vidioc_dqbuf(file, static_cast(arg), &locker); + ret = vidioc_dqbuf(file, static_cast(arg), &proxyMutex_); break; case VIDIOC_STREAMON: ret = vidioc_streamon(file, static_cast(arg)); -- cgit v1.2.1