android: camera_stream: Protect buffers initialization by mutex_
The initialization on buffers_ in CameraStrean::configure() is not protected by mutex_. It is no problem because configure() is not invoked simultaneously while other functions are called. This protects it to keep the thread safety consistency for buffers access. 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>
This commit is contained in:
parent
d5fb676ed5
commit
5e0d3a3517
1 changed files with 1 additions and 0 deletions
|
@ -125,6 +125,7 @@ int CameraStream::configure()
|
|||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
MutexLocker lock(*mutex_);
|
||||
/* Save a pointer to the reserved frame buffers */
|
||||
for (const auto &frameBuffer : allocator_->buffers(stream()))
|
||||
buffers_.push_back(frameBuffer.get());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue