Skip to content

Commit

Permalink
Bug 1888181 - Vendor libwebrtc from 1e7a6f3b6a
Browse files Browse the repository at this point in the history
We already cherry-picked this when we vendored 1cce1d7ddc.

Upstream commit: https://webrtc.googlesource.com/src/+/1e7a6f3b6a8eee7efcb129eec10fe734d718ebc8
    Revert "Make setCodecPreferences only look at receive codecs"

    This reverts commit 1cce1d7ddcbde3a3648007b5a131bd0c2638724b.

    Reason for revert: Breaks WPTs

    Original change's description:
    > Make setCodecPreferences only look at receive codecs
    >
    > which is what is noted in JSEP:
    >   https://www.rfc-editor.org/rfc/rfc8829.html#name-setcodecpreferences
    >
    > Some W3C spec modifications are required since the W3C specification
    > currently takes into account send codecs as well.
    >
    > Spec issue:
    >   w3c/webrtc-pc#2888
    > Spec PR:
    >  w3c/webrtc-pc#2926
    >
    > setCodecPreferences continues to modify the codecs in an offer.
    >
    > Also rename RtpSender::SetCodecPreferences to RtpSender::SetSendCodecs for consistent semantics.
    >
    > BUG=webrtc:15396
    >
    > Change-Id: I1e8fbe77cb2670575578a777ed1336567a1e4031
    > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/328780
    > Reviewed-by: Henrik Boström <hbos@webrtc.org>
    > Commit-Queue: Philipp Hancke <phancke@microsoft.com>
    > Reviewed-by: Harald Alvestrand <hta@webrtc.org>
    > Cr-Commit-Position: refs/heads/main@{#41719}

    Bug: webrtc:15396
    Change-Id: I7b545e91f820c3affc39841c6e93939eac75c363
    No-Presubmit: true
    No-Tree-Checks: true
    No-Try: true
    Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/339520
    Reviewed-by: Harald Alvestrand <hta@webrtc.org>
    Commit-Queue: Harald Alvestrand <hta@webrtc.org>
    Owners-Override: Henrik Boström <hbos@webrtc.org>
    Reviewed-by: Henrik Boström <hbos@webrtc.org>
    Auto-Submit: Henrik Boström <hbos@webrtc.org>
    Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
    Cr-Commit-Position: refs/heads/main@{#41725}
  • Loading branch information
Pehrsons committed Apr 4, 2024
1 parent e068ce8 commit 0ddeb1d
Show file tree
Hide file tree
Showing 111 changed files with 45,531 additions and 46,334 deletions.
3 changes: 3 additions & 0 deletions third_party/libwebrtc/README.moz-ff-commit
Original file line number Diff line number Diff line change
Expand Up @@ -28920,3 +28920,6 @@ e3fb8122aa
# MOZ_LIBWEBRTC_SRC=/Users/apehrson/Dev/elm/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
e28e60c740
# MOZ_LIBWEBRTC_SRC=/Users/apehrson/Dev/elm/.moz-fast-forward/moz-libwebrtc MOZ_LIBWEBRTC_BRANCH=mozpatches bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh
# base of lastest vendoring
1e7a6f3b6a
2 changes: 2 additions & 0 deletions third_party/libwebrtc/README.mozilla
Original file line number Diff line number Diff line change
Expand Up @@ -19304,3 +19304,5 @@ libwebrtc updated from /Users/apehrson/Dev/elm/.moz-fast-forward/moz-libwebrtc c
libwebrtc updated from /Users/apehrson/Dev/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2024-04-04T08:25:07.227063.
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/apehrson/Dev/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
libwebrtc updated from /Users/apehrson/Dev/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2024-04-04T08:26:29.499553.
# ./mach python dom/media/webrtc/third_party_build/vendor-libwebrtc.py --from-local /Users/apehrson/Dev/elm/.moz-fast-forward/moz-libwebrtc --commit mozpatches libwebrtc
libwebrtc updated from /Users/apehrson/Dev/elm/.moz-fast-forward/moz-libwebrtc commit mozpatches on 2024-04-04T08:27:49.704542.
831 changes: 31 additions & 800 deletions third_party/libwebrtc/moz-patch-stack/0001.patch

Large diffs are not rendered by default.

1,729 changes: 1,692 additions & 37 deletions third_party/libwebrtc/moz-patch-stack/0002.patch

Large diffs are not rendered by default.

1,704 changes: 27 additions & 1,677 deletions third_party/libwebrtc/moz-patch-stack/0003.patch

Large diffs are not rendered by default.

65 changes: 28 additions & 37 deletions third_party/libwebrtc/moz-patch-stack/0004.patch
Original file line number Diff line number Diff line change
@@ -1,43 +1,34 @@
From: Nico Grunbaum <na-g@nostrum.com>
Date: Sat, 13 Feb 2021 04:20:00 -0800
Subject: Bug 1654112 - Add pid_t to desktop_capture_types.h; r=pehrsons
From: Michael Froman <mfroman@mozilla.com>
Date: Fri, 9 Jul 2021 18:14:00 -0500
Subject: Bug 1654112 - mutex changes to fix tsan errors. r=ng

Upstreaming bug 1697385

Also includes:
Bug 1654112 - Clarifying prev. rev that moved pid_t into the global namespace; r=dminor

Differential Revision: https://phabricator.services.mozilla.com/D107897
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/539b69f0e21118a1898f1ef689577c7193ff7be7
Differential Revision: https://phabricator.services.mozilla.com/D119674
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/3d5503acf9a4b22e02c4300f29e4fbfed406ea2c
---
modules/desktop_capture/desktop_capture_types.h | 4 ++++
modules/video_capture/video_capture.h | 1 +
2 files changed, 5 insertions(+)
rtc_base/logging.cc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/desktop_capture/desktop_capture_types.h b/modules/desktop_capture/desktop_capture_types.h
index a4e3e897fd..e777a45f92 100644
--- a/modules/desktop_capture/desktop_capture_types.h
+++ b/modules/desktop_capture/desktop_capture_types.h
@@ -13,6 +13,10 @@

#include <stdint.h>
diff --git a/rtc_base/logging.cc b/rtc_base/logging.cc
index ad2303735e..9c2d3b0a39 100644
--- a/rtc_base/logging.cc
+++ b/rtc_base/logging.cc
@@ -275,8 +275,8 @@ void LogMessage::LogTimestamps(bool on) {
}

+#ifdef XP_WIN // Moving this into the global namespace
+typedef int pid_t; // matching what used to be in
+#endif // video_capture_defines.h
+
namespace webrtc {
void LogMessage::LogToDebug(LoggingSeverity min_sev) {
- g_dbg_sev = min_sev;
webrtc::MutexLock lock(&GetLoggingLock());
+ g_dbg_sev = min_sev;
UpdateMinLogSeverity();
}

enum class CaptureType { kWindow, kScreen, kAnyScreenContent };
diff --git a/modules/video_capture/video_capture.h b/modules/video_capture/video_capture.h
index f31b239c71..7279bed476 100644
--- a/modules/video_capture/video_capture.h
+++ b/modules/video_capture/video_capture.h
@@ -13,6 +13,7 @@
@@ -460,6 +460,9 @@ void LogMessage::OutputToDebug(const LogLineRef& log_line) {

#include "api/video/video_rotation.h"
#include "api/video/video_sink_interface.h"
+#include "modules/desktop_capture/desktop_capture_types.h"
#include "modules/video_capture/raw_video_sink_interface.h"
#include "modules/video_capture/video_capture_defines.h"
#include <set>
// static
bool LogMessage::IsNoop(LoggingSeverity severity) {
+ // Added MutexLock to fix tsan warnings on accessing g_dbg_sev. (mjf)
+ // See https://bugs.chromium.org/p/chromium/issues/detail?id=1228729
+ webrtc::MutexLock lock(&GetLoggingLock());
if (severity >= g_dbg_sev || severity >= g_min_sev)
return false;
return streams_empty_.load(std::memory_order_relaxed);
68 changes: 40 additions & 28 deletions third_party/libwebrtc/moz-patch-stack/0005.patch
Original file line number Diff line number Diff line change
@@ -1,34 +1,46 @@
From: Michael Froman <mfroman@mozilla.com>
Date: Fri, 9 Jul 2021 18:14:00 -0500
Subject: Bug 1654112 - mutex changes to fix tsan errors. r=ng
From: Dan Minor <dminor@mozilla.com>
Date: Wed, 18 Nov 2020 13:33:00 -0500
Subject: Bug 1654112 - Suppress -Wclass-varargs warning in logging.h. r=ng

Differential Revision: https://phabricator.services.mozilla.com/D119674
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/3d5503acf9a4b22e02c4300f29e4fbfed406ea2c
This needs some investigation to see why we get this warning when it is not
present upstream.

Since both were doing the same thing for different compiler chains,
also includes:
Bug 1654112 - linux build fix (pragmas) for base-toolchains* . r=ng

Differential Revision: https://phabricator.services.mozilla.com/D130086
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/8d832e832ffe513246c0763a56376a8022b2447b
---
rtc_base/logging.cc | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
rtc_base/logging.h | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/rtc_base/logging.cc b/rtc_base/logging.cc
index ad2303735e..9c2d3b0a39 100644
--- a/rtc_base/logging.cc
+++ b/rtc_base/logging.cc
@@ -275,8 +275,8 @@ void LogMessage::LogTimestamps(bool on) {
}
diff --git a/rtc_base/logging.h b/rtc_base/logging.h
index df7f173f58..a3733d7543 100644
--- a/rtc_base/logging.h
+++ b/rtc_base/logging.h
@@ -48,6 +48,14 @@
#ifndef RTC_BASE_LOGGING_H_
#define RTC_BASE_LOGGING_H_

+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wvarargs"
+
+#if defined(__clang__)
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wclass-varargs"
+#endif
+
#include <errno.h>

void LogMessage::LogToDebug(LoggingSeverity min_sev) {
- g_dbg_sev = min_sev;
webrtc::MutexLock lock(&GetLoggingLock());
+ g_dbg_sev = min_sev;
UpdateMinLogSeverity();
}
#include <atomic>
@@ -764,4 +772,9 @@ inline const char* AdaptString(const std::string& str) {

@@ -460,6 +460,9 @@ void LogMessage::OutputToDebug(const LogLineRef& log_line) {
} // namespace rtc

// static
bool LogMessage::IsNoop(LoggingSeverity severity) {
+ // Added MutexLock to fix tsan warnings on accessing g_dbg_sev. (mjf)
+ // See https://bugs.chromium.org/p/chromium/issues/detail?id=1228729
+ webrtc::MutexLock lock(&GetLoggingLock());
if (severity >= g_dbg_sev || severity >= g_min_sev)
return false;
return streams_empty_.load(std::memory_order_relaxed);
+#pragma GCC diagnostic pop
+#if defined(__clang__)
+# pragma clang diagnostic pop
+#endif
+
#endif // RTC_BASE_LOGGING_H_
77 changes: 40 additions & 37 deletions third_party/libwebrtc/moz-patch-stack/0006.patch
Original file line number Diff line number Diff line change
@@ -1,46 +1,49 @@
From: Dan Minor <dminor@mozilla.com>
Date: Wed, 18 Nov 2020 13:33:00 -0500
Subject: Bug 1654112 - Suppress -Wclass-varargs warning in logging.h. r=ng
Date: Tue, 27 Mar 2018 15:43:00 -0400
Subject: Bug 1376873 - Disable Mid support in RtpDemuxer; r=mjf

This needs some investigation to see why we get this warning when it is not
present upstream.
The only use of Mid in the current webrtc.org code is in the unit tests.
RtpStreamReceiverController only allows adding sinks using SSRCs. Because
of this, we'll end up dropping packets in the RtpDemuxer with the current
code as none of our Mids will be recognized.

Since both were doing the same thing for different compiler chains,
also includes:
Bug 1654112 - linux build fix (pragmas) for base-toolchains* . r=ng
Tip of webrtc.org fully supports using Mids, so we'll be able to enable this
code again after the next update.

Differential Revision: https://phabricator.services.mozilla.com/D130086
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/8d832e832ffe513246c0763a56376a8022b2447b
Differential Revision: https://phabricator.services.mozilla.com/D7442
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/b3ba8452e77105c72f6ddbc49cbe5a53dbea1507
---
rtc_base/logging.h | 13 +++++++++++++
1 file changed, 13 insertions(+)
call/rtp_demuxer.cc | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/rtc_base/logging.h b/rtc_base/logging.h
index df7f173f58..a3733d7543 100644
--- a/rtc_base/logging.h
+++ b/rtc_base/logging.h
@@ -48,6 +48,14 @@
#ifndef RTC_BASE_LOGGING_H_
#define RTC_BASE_LOGGING_H_
diff --git a/call/rtp_demuxer.cc b/call/rtp_demuxer.cc
index 841d7e3b94..f5c4186871 100644
--- a/call/rtp_demuxer.cc
+++ b/call/rtp_demuxer.cc
@@ -285,13 +285,17 @@ RtpPacketSinkInterface* RtpDemuxer::ResolveSink(
// RSID and RRID are routed to the same sinks. If an RSID is specified on a
// repair packet, it should be ignored and the RRID should be used.
std::string packet_mid, packet_rsid;
- bool has_mid = use_mid_ && packet.GetExtension<RtpMid>(&packet_mid);
+ //bool has_mid = use_mid_ && packet.GetExtension<RtpMid>(&packet_mid);
bool has_rsid = packet.GetExtension<RepairedRtpStreamId>(&packet_rsid);
if (!has_rsid) {
has_rsid = packet.GetExtension<RtpStreamId>(&packet_rsid);
}
uint32_t ssrc = packet.Ssrc();

+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wvarargs"
+
+#if defined(__clang__)
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wclass-varargs"
+#endif
+
#include <errno.h>

#include <atomic>
@@ -764,4 +772,9 @@ inline const char* AdaptString(const std::string& str) {

} // namespace rtc
+ // Mid support is half-baked in branch 64. RtpStreamReceiverController only
+ // supports adding sinks by ssrc, so our mids will never show up in
+ // known_mids_, causing us to drop packets here.
+#if 0
// The BUNDLE spec says to drop any packets with unknown MIDs, even if the
// SSRC is known/latched.
if (has_mid && known_mids_.find(packet_mid) == known_mids_.end()) {
@@ -365,6 +369,7 @@ RtpPacketSinkInterface* RtpDemuxer::ResolveSink(
}
}

+#pragma GCC diagnostic pop
+#if defined(__clang__)
+# pragma clang diagnostic pop
+#endif
+
#endif // RTC_BASE_LOGGING_H_
// We trust signaled SSRC more than payload type which is likely to conflict
// between streams.
const auto ssrc_sink_it = sink_by_ssrc_.find(ssrc);
Loading

0 comments on commit 0ddeb1d

Please sign in to comment.