summaryrefslogtreecommitdiff
path: root/src/android/camera_stream.cpp
diff options
context:
space:
mode:
authorHirokazu Honda <hiroh@chromium.org>2021-12-01 16:53:38 +0900
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-12-01 13:46:39 +0200
commit3536473e06f9abe5027b25db3b97900bf474bccf (patch)
treebb35ef7b99d7b6616e4df85ba9bfc20738351e8c /src/android/camera_stream.cpp
parent923cf7f40a7f1875874384b30a7c8dcb1f23467a (diff)
android: Consolidate mutex classes to Mutex and MutexLocker
std::mutex and std::unique_lock are used in android directories, mixing Mutex and MutexLocker. This consolidates them to Mutex and MutexLocker. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/android/camera_stream.cpp')
-rw-r--r--src/android/camera_stream.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp
index 9023c13c..5a62b7cd 100644
--- a/src/android/camera_stream.cpp
+++ b/src/android/camera_stream.cpp
@@ -119,7 +119,7 @@ int CameraStream::configure()
if (type_ == Type::Internal) {
allocator_ = std::make_unique<FrameBufferAllocator>(cameraDevice_->camera());
- mutex_ = std::make_unique<std::mutex>();
+ mutex_ = std::make_unique<Mutex>();
int ret = allocator_->allocate(stream());
if (ret < 0)
@@ -208,7 +208,7 @@ FrameBuffer *CameraStream::getBuffer()
if (!allocator_)
return nullptr;
- std::lock_guard<std::mutex> locker(*mutex_);
+ MutexLocker locker(*mutex_);
if (buffers_.empty()) {
LOG(HAL, Error) << "Buffer underrun";
@@ -226,7 +226,7 @@ void CameraStream::putBuffer(FrameBuffer *buffer)
if (!allocator_)
return;
- std::lock_guard<std::mutex> locker(*mutex_);
+ MutexLocker locker(*mutex_);
buffers_.push_back(buffer);
}
@@ -239,7 +239,7 @@ CameraStream::PostProcessorWorker::PostProcessorWorker(PostProcessor *postProces
CameraStream::PostProcessorWorker::~PostProcessorWorker()
{
{
- libcamera::MutexLocker lock(mutex_);
+ MutexLocker lock(mutex_);
state_ = State::Stopped;
}
@@ -250,7 +250,7 @@ CameraStream::PostProcessorWorker::~PostProcessorWorker()
void CameraStream::PostProcessorWorker::start()
{
{
- libcamera::MutexLocker lock(mutex_);
+ MutexLocker lock(mutex_);
ASSERT(state_ != State::Running);
state_ = State::Running;
}
@@ -308,7 +308,7 @@ void CameraStream::PostProcessorWorker::run()
void CameraStream::PostProcessorWorker::flush()
{
- libcamera::MutexLocker lock(mutex_);
+ MutexLocker lock(mutex_);
state_ = State::Flushing;
lock.unlock();