Bug 1857862 - updated libwebrtc patch stack

This commit is contained in:
Andreas Pehrson 2023-10-19 13:52:53 +02:00
Родитель fa7d995b1b
Коммит 574ca9a59c
4 изменённых файлов: 151 добавлений и 0 удалений

31
third_party/libwebrtc/moz-patch-stack/0098.patch поставляемый Normal file
Просмотреть файл

@ -0,0 +1,31 @@
From: Andreas Pehrson <apehrson@mozilla.com>
Date: Wed, 18 Oct 2023 17:25:00 +0000
Subject: Bug 1857862 - (fix-32a8169a65) Don't call non-constexpr
RTC_CHECK_NOTREACHED from constexpr VideoFrameTypeToString under gcc-8.
r=webrtc-reviewers,mjf
Differential Revision: https://phabricator.services.mozilla.com/D191308
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/8a4449ba24fa3192b44863ed8ba96f6f94a6e88d
---
api/video/video_frame_type.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/api/video/video_frame_type.h b/api/video/video_frame_type.h
index 9079829ff8..3665a80cd8 100644
--- a/api/video/video_frame_type.h
+++ b/api/video/video_frame_type.h
@@ -34,7 +34,11 @@ inline constexpr absl::string_view VideoFrameTypeToString(
case VideoFrameType::kVideoFrameDelta:
return "delta";
}
+// Mozilla:
+// gcc-8 complains about a constexpr function calling a non-constexpr ditto.
+#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 9)
RTC_CHECK_NOTREACHED();
+#endif
return "";
}
--
2.34.1

46
third_party/libwebrtc/moz-patch-stack/0099.patch поставляемый Normal file
Просмотреть файл

@ -0,0 +1,46 @@
From: Andreas Pehrson <apehrson@mozilla.com>
Date: Wed, 18 Oct 2023 18:51:00 +0000
Subject: Bug 1857862 - (fix-34d82df2ba) Guard clang-specific pragmas in
libwebrtc/api/call/transport.h. r=webrtc-reviewers,mjf
Differential Revision: https://phabricator.services.mozilla.com/D191312
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/3b5018d89fa118d1f227346ddd67a1fe1db4d4c1
---
api/call/transport.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/api/call/transport.h b/api/call/transport.h
index 6c6cbb8941..52c577ba83 100644
--- a/api/call/transport.h
+++ b/api/call/transport.h
@@ -48,8 +48,15 @@ class Transport {
// New style functions. Default implementations are to accomodate
// subclasses that haven't been converted to new style yet.
// TODO(bugs.webrtc.org/14870): Deprecate and remove old functions.
+ // Mozilla: Add GCC pragmas for now. They will be removed soon:
+ // https://webrtc.googlesource.com/src/+/e14d122a7b24bf78c02b8a4ce23716f79451dd23
+#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#elif defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
virtual bool SendRtp(rtc::ArrayView<const uint8_t> packet,
const PacketOptions& options) {
return SendRtp(packet.data(), packet.size(), options);
@@ -57,7 +64,11 @@ class Transport {
virtual bool SendRtcp(rtc::ArrayView<const uint8_t> packet) {
return SendRtcp(packet.data(), packet.size());
}
+#if defined(__clang__)
#pragma clang diagnostic pop
+#elif defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
// Old style functions.
[[deprecated("Use ArrayView version")]] virtual bool
SendRtp(const uint8_t* packet, size_t length, const PacketOptions& options) {
--
2.34.1

44
third_party/libwebrtc/moz-patch-stack/0100.patch поставляемый Normal file
Просмотреть файл

@ -0,0 +1,44 @@
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 02404697ad..1bddaf824d 100644
--- a/modules/video_capture/video_capture_impl.cc
+++ b/modules/video_capture/video_capture_impl.cc
@@ -119,11 +119,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) {
--
2.34.1

30
third_party/libwebrtc/moz-patch-stack/0101.patch поставляемый Normal file
Просмотреть файл

@ -0,0 +1,30 @@
From: Andreas Pehrson <apehrson@mozilla.com>
Date: Wed, 18 Oct 2023 17:21:00 +0000
Subject: Bug 1859786 - Fix clang-tidy warning in video_capture_impl.cc.
r=webrtc-reviewers,mjf
clang-tidy says:
'auto dataCallBack' can be declared as 'auto *dataCallBack'
Differential Revision: https://phabricator.services.mozilla.com/D191302
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/26c84d214137a1b0de0902c7038756964e5786f4
---
modules/video_capture/video_capture_impl.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/modules/video_capture/video_capture_impl.cc b/modules/video_capture/video_capture_impl.cc
index 1bddaf824d..15dfb7fe1f 100644
--- a/modules/video_capture/video_capture_impl.cc
+++ b/modules/video_capture/video_capture_impl.cc
@@ -134,7 +134,7 @@ int32_t VideoCaptureImpl::DeliverCapturedFrame(VideoFrame& captureFrame) {
UpdateFrameCount(); // frame count used for local frame rate callback.
- for (auto dataCallBack : _dataCallBacks) {
+ for (auto* dataCallBack : _dataCallBacks) {
dataCallBack->OnFrame(captureFrame);
}
--
2.34.1