Reland "Migrate modules/desktop_capture and modules/video_capture to webrtc::Mutex."

This is a reland of 44dd3d743517fe85212ba4f68bda1e78c2e6d7ec

Original change's description:
> Migrate modules/desktop_capture and modules/video_capture to webrtc::Mutex.
> 
> Bug: webrtc:11567
> Change-Id: I7bfca17f91bf44151148f863480ce77804d53a04
> Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/178805
> Commit-Queue: Markus Handell <handellm@webrtc.org>
> Reviewed-by: Tommi <tommi@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#31681}

Bug: webrtc:11567
Change-Id: I03a32cb7194cffb9e678355c4af4d370b39384b3
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179093
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Markus Handell <handellm@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31716}
This commit is contained in:
Markus Handell
2020-07-13 13:09:15 +02:00
committed by Commit Bot
parent 30c8eaa1dc
commit 4379a7db1f
10 changed files with 33 additions and 29 deletions

View File

@ -115,7 +115,7 @@ int32_t VideoCaptureModuleV4L2::StartCapture(
}
}
rtc::CritScope cs(&_captureCritSect);
MutexLock lock(&capture_lock_);
// first open /dev/video device
char device[20];
sprintf(device, "/dev/video%d", (int)_deviceId);
@ -264,7 +264,7 @@ int32_t VideoCaptureModuleV4L2::StartCapture(
int32_t VideoCaptureModuleV4L2::StopCapture() {
if (_captureThread) {
{
rtc::CritScope cs(&_captureCritSect);
MutexLock lock(&capture_lock_);
quit_ = true;
}
// Make sure the capture thread stop stop using the critsect.
@ -272,7 +272,7 @@ int32_t VideoCaptureModuleV4L2::StopCapture() {
_captureThread.reset();
}
rtc::CritScope cs(&_captureCritSect);
MutexLock lock(&capture_lock_);
if (_captureStarted) {
_captureStarted = false;
@ -387,7 +387,7 @@ bool VideoCaptureModuleV4L2::CaptureProcess() {
}
{
rtc::CritScope cs(&_captureCritSect);
MutexLock lock(&capture_lock_);
if (quit_) {
return false;