Upstream commit: https://webrtc.googlesource.com/src/+/68e7b00928f99a80c65f1d15c438f46bedd839e9 Reland "Revert "Reland "Allow sending to separate payload types for each simulcast index.""" This is a reland of commit Ife7d43471c85fdea9bd26cc982bce410c0d75527 In the previous implementation, there was an issue where switching codecs with VideoEncoderSelector would cause a crash, so I have fixed it. Specifically, if there are no changes to params.send_codecs, I now remove all parameters related to mixed-codec simulcast. This should ensure that when an unintended codec switch occurs, the behavior remains the same as before. Additionally, I have added a test to reproduce this crash issue. I confirmed that the issue occurred in the previous implementation and that it does not occur in the current implementation. Original change's description: > Revert "Reland "Allow sending to separate payload types for each simulcast index."" > > This reverts commit 49ac6b758cc3c28be2fc13028a829f016b453d39. > > Reason for revert: Break codec switch in singlecast. > > Original change's description: > > Reland "Allow sending to separate payload types for each simulcast index." > > > > This is a reland of commit bcb19c00ba8ab1788ba3c08f28ee1b23e0cc77b9 > > > > Original change's description: > > > Allow sending to separate payload types for each simulcast index. > > > > > > This change is for mixed-codec simulcast. > > > > > > By obtaining the payload type via RtpConfig::GetStreamConfig(), > > > the correct payload type can be retrieved regardless of whether > > > RtpConfig::stream_configs is initialized or not. > > > > > > Bug: webrtc:362277533 > > > Change-Id: I6b2a1ae66356b20a832565ce6729c3ce9e73a161 > > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364760 > > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > > Commit-Queue: Florent Castelli <orphis@webrtc.org> > > > Reviewed-by: Florent Castelli <orphis@webrtc.org> > > > Cr-Commit-Position: refs/heads/main@{#43197} > > > > Bug: webrtc:362277533 > > Change-Id: Ia82c3390cceb9f68315c2fd9ba5114693669af32 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/374780 > > Commit-Queue: Henrik Boström <hbos@webrtc.org> > > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#43787} > > Bug: webrtc:362277533 > Change-Id: Ife7d43471c85fdea9bd26cc982bce410c0d75527 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/376040 > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org> > Reviewed-by: Jonas Oreland <jonaso@webrtc.org> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Jonas Oreland <jonaso@webrtc.org> > Reviewed-by: Per Kjellander <perkj@webrtc.org> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> > Reviewed-by: Evan Shrubsole <eshr@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#43830} Bug: webrtc:362277533 Change-Id: I1772fa478a4fd4d5096d9bf727ed4de045861c4e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/378100 Reviewed-by: Erik Språng <sprang@webrtc.org> Commit-Queue: Henrik Boström <hbos@webrtc.org> Reviewed-by: Henrik Boström <hbos@webrtc.org> Cr-Commit-Position: refs/heads/main@{#44007} Differential Revision: https://phabricator.services.mozilla.com/D244017
108 lines
4.3 KiB
Diff
108 lines
4.3 KiB
Diff
From: Michael Froman <mfroman@mozilla.com>
|
|
Date: Mon, 18 Dec 2023 15:00:00 +0000
|
|
Subject: Bug 1867099 - revert libwebrtc 8602f604e0. r=bwc
|
|
|
|
Upstream 8602f604e0 removed code sending BYEs which breaks some of
|
|
our wpt. They've opened a bug for a real fix here:
|
|
https://bugs.chromium.org/p/webrtc/issues/detail?id=15664
|
|
|
|
I've opened Bug 1870643 to track the real fix and upstream bug.
|
|
|
|
Differential Revision: https://phabricator.services.mozilla.com/D196729
|
|
Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/d92a578327f524ec3e1c144c82492a4c76b8266f
|
|
---
|
|
call/rtp_video_sender.cc | 1 +
|
|
modules/rtp_rtcp/source/rtcp_sender.cc | 19 +++++++++++++++++--
|
|
.../rtp_rtcp/source/rtcp_sender_unittest.cc | 5 +++--
|
|
modules/rtp_rtcp/source/rtp_rtcp_impl.cc | 1 +
|
|
modules/rtp_rtcp/source/rtp_rtcp_interface.h | 2 +-
|
|
5 files changed, 23 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/call/rtp_video_sender.cc b/call/rtp_video_sender.cc
|
|
index b51ac82d97..8331122823 100644
|
|
--- a/call/rtp_video_sender.cc
|
|
+++ b/call/rtp_video_sender.cc
|
|
@@ -536,6 +536,7 @@ void RtpVideoSender::SetModuleIsActive(bool sending,
|
|
return;
|
|
}
|
|
|
|
+ // Sends a kRtcpByeCode when going from true to false.
|
|
rtp_module.SetSendingStatus(sending);
|
|
rtp_module.SetSendingMediaStatus(sending);
|
|
if (sending) {
|
|
diff --git a/modules/rtp_rtcp/source/rtcp_sender.cc b/modules/rtp_rtcp/source/rtcp_sender.cc
|
|
index 5fa32af69b..d3f80bdf9d 100644
|
|
--- a/modules/rtp_rtcp/source/rtcp_sender.cc
|
|
+++ b/modules/rtp_rtcp/source/rtcp_sender.cc
|
|
@@ -222,8 +222,23 @@ bool RTCPSender::Sending() const {
|
|
|
|
void RTCPSender::SetSendingStatus(const FeedbackState& /* feedback_state */,
|
|
bool sending) {
|
|
- MutexLock lock(&mutex_rtcp_sender_);
|
|
- sending_ = sending;
|
|
+ bool sendRTCPBye = false;
|
|
+ {
|
|
+ MutexLock lock(&mutex_rtcp_sender_);
|
|
+
|
|
+ if (method_ != RtcpMode::kOff) {
|
|
+ if (sending == false && sending_ == true) {
|
|
+ // Trigger RTCP bye
|
|
+ sendRTCPBye = true;
|
|
+ }
|
|
+ }
|
|
+ sending_ = sending;
|
|
+ }
|
|
+ if (sendRTCPBye) {
|
|
+ if (SendRTCP(feedback_state, kRtcpBye) != 0) {
|
|
+ RTC_LOG(LS_WARNING) << "Failed to send RTCP BYE";
|
|
+ }
|
|
+ }
|
|
}
|
|
|
|
void RTCPSender::SetNonSenderRttMeasurement(bool enabled) {
|
|
diff --git a/modules/rtp_rtcp/source/rtcp_sender_unittest.cc b/modules/rtp_rtcp/source/rtcp_sender_unittest.cc
|
|
index 9cca326ac5..ede02ea636 100644
|
|
--- a/modules/rtp_rtcp/source/rtcp_sender_unittest.cc
|
|
+++ b/modules/rtp_rtcp/source/rtcp_sender_unittest.cc
|
|
@@ -346,12 +346,13 @@ TEST_F(RtcpSenderTest, SendBye) {
|
|
EXPECT_EQ(kSenderSsrc, parser()->bye()->sender_ssrc());
|
|
}
|
|
|
|
-TEST_F(RtcpSenderTest, StopSendingDoesNotTriggersBye) {
|
|
+TEST_F(RtcpSenderTest, StopSendingTriggersBye) {
|
|
auto rtcp_sender = CreateRtcpSender(GetDefaultConfig());
|
|
rtcp_sender->SetRTCPStatus(RtcpMode::kReducedSize);
|
|
rtcp_sender->SetSendingStatus(feedback_state(), true);
|
|
rtcp_sender->SetSendingStatus(feedback_state(), false);
|
|
- EXPECT_EQ(0, parser()->bye()->num_packets());
|
|
+ EXPECT_EQ(1, parser()->bye()->num_packets());
|
|
+ EXPECT_EQ(kSenderSsrc, parser()->bye()->sender_ssrc());
|
|
}
|
|
|
|
TEST_F(RtcpSenderTest, SendFir) {
|
|
diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
|
|
index b4c944ccf8..9b5898b2e7 100644
|
|
--- a/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
|
|
+++ b/modules/rtp_rtcp/source/rtp_rtcp_impl.cc
|
|
@@ -313,6 +313,7 @@ RTCPSender::FeedbackState ModuleRtpRtcpImpl::GetFeedbackState() {
|
|
|
|
int32_t ModuleRtpRtcpImpl::SetSendingStatus(const bool sending) {
|
|
if (rtcp_sender_.Sending() != sending) {
|
|
+ // Sends RTCP BYE when going from true to false
|
|
rtcp_sender_.SetSendingStatus(GetFeedbackState(), sending);
|
|
}
|
|
return 0;
|
|
diff --git a/modules/rtp_rtcp/source/rtp_rtcp_interface.h b/modules/rtp_rtcp/source/rtp_rtcp_interface.h
|
|
index 02828619a6..e3dc8d9248 100644
|
|
--- a/modules/rtp_rtcp/source/rtp_rtcp_interface.h
|
|
+++ b/modules/rtp_rtcp/source/rtp_rtcp_interface.h
|
|
@@ -278,7 +278,7 @@ class RtpRtcpInterface : public RtcpFeedbackSenderInterface {
|
|
// Returns the FlexFEC SSRC, if there is one.
|
|
virtual std::optional<uint32_t> FlexfecSsrc() const = 0;
|
|
|
|
- // Sets sending status.
|
|
+ // Sets sending status. Sends kRtcpByeCode when going from true to false.
|
|
// Returns -1 on failure else 0.
|
|
virtual int32_t SetSendingStatus(bool sending) = 0;
|
|
|