Upstream commit: https://webrtc.googlesource.com/src/+/7e3a9ce99d832687d1eef3eaa270754970a761b0 Rely on TaskQueueBase interface in modules/rtp_rtcp Instead of requiring Thread to be passed to the RtpVideoStreamReceiverFrameTransformerDelegate. This class already uses it only though the TaskQueueBase interface. In tests rely on RunLoop helper when test makes calls that are required to be done on the same task queue, and rely on TaskQueueForTests where test does not make such calls. Bug: webrtc:42225410 Change-Id: I7aba5c696436d8ce43c85ccba5b9448e852ea81d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/470880 Auto-Submit: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Erik Språng <sprang@webrtc.org> Reviewed-by: Erik Språng <sprang@webrtc.org> Cr-Commit-Position: refs/heads/main@{#47662}
42 lines
1.5 KiB
Diff
42 lines
1.5 KiB
Diff
From: Andreas Pehrson <apehrson@mozilla.com>
|
|
Date: Wed, 18 Oct 2023 17:21:00 +0000
|
|
Subject: Bug 1859786 - Fix lock annotation warning in Mozilla-specific edit on
|
|
top of video_capture_impl.cc. r=webrtc-reviewers,mjf
|
|
|
|
The annotations were added in M116:
|
|
https://hg.mozilla.org/mozilla-central/rev/9cd372df013948ad822ae936752d725d77474fb5
|
|
|
|
Note that this was never unsafe, since _dataCallbacks is only written on the
|
|
same thread that we are patching here. This patch however, adds helpful static
|
|
analysis.
|
|
|
|
Differential Revision: https://phabricator.services.mozilla.com/D191301
|
|
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/56ff441b644400f09d2d0453dbd8991ea25db7b1
|
|
---
|
|
modules/video_capture/video_capture_impl.cc | 11 +++++++----
|
|
1 file changed, 7 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/modules/video_capture/video_capture_impl.cc b/modules/video_capture/video_capture_impl.cc
|
|
index 13de9fb62d..d358608dc5 100644
|
|
--- a/modules/video_capture/video_capture_impl.cc
|
|
+++ b/modules/video_capture/video_capture_impl.cc
|
|
@@ -132,11 +132,14 @@ void VideoCaptureImpl::DeRegisterCaptureDataCallback(
|
|
}
|
|
|
|
int32_t VideoCaptureImpl::StopCaptureIfAllClientsClose() {
|
|
- if (_dataCallBacks.empty()) {
|
|
- return StopCapture();
|
|
- } else {
|
|
- return 0;
|
|
+ RTC_DCHECK_RUN_ON(&api_checker_);
|
|
+ {
|
|
+ MutexLock lock(&api_lock_);
|
|
+ if (!_dataCallBacks.empty()) {
|
|
+ return 0;
|
|
+ }
|
|
}
|
|
+ return StopCapture();
|
|
}
|
|
|
|
int32_t VideoCaptureImpl::DeliverCapturedFrame(VideoFrame& captureFrame) {
|