From 3f8b1a20e116b1c5b60130b1bae3f713b89c8079 Mon Sep 17 00:00:00 2001 From: Michael Froman Date: Mon, 13 Jun 2022 11:13:33 -0500 Subject: [PATCH] Bug 1766646 - Vendor libwebrtc from 8695282243 Upstream commit: https://webrtc.googlesource.com/src/+/8695282243a5bf232ad1c21c9799620a955b32ce Remove unnecessary copy of suspended_ssrcs. Also removing pass-by-value in ctor. Bug: none Change-Id: I09e36fd955c8f306c4a347d8befc6eea38384cb9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/239183 Auto-Submit: Tommi Reviewed-by: Niels Moller Commit-Queue: Tommi Cr-Commit-Position: refs/heads/main@{#35427} --- third_party/libwebrtc/README.moz-ff-commit | 3 +++ third_party/libwebrtc/README.mozilla | 2 ++ .../call/rtp_transport_controller_send.cc | 2 +- .../call/rtp_transport_controller_send.h | 2 +- .../rtp_transport_controller_send_interface.h | 2 +- third_party/libwebrtc/call/rtp_video_sender.cc | 18 +++++++++--------- third_party/libwebrtc/call/rtp_video_sender.h | 6 ++---- .../test/mock_rtp_transport_controller_send.h | 2 +- 8 files changed, 20 insertions(+), 17 deletions(-) diff --git a/third_party/libwebrtc/README.moz-ff-commit b/third_party/libwebrtc/README.moz-ff-commit index e7c635f56d05..96d08a9fda40 100644 --- a/third_party/libwebrtc/README.moz-ff-commit +++ b/third_party/libwebrtc/README.moz-ff-commit @@ -9819,3 +9819,6 @@ ef5b21e637 # MOZ_LIBWEBRTC_SRC=/home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src MOZ_LIBWEBRTC_COMMIT=mjfdev bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh # base of lastest vendoring 9345bee860 +# MOZ_LIBWEBRTC_SRC=/home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src MOZ_LIBWEBRTC_COMMIT=mjfdev bash dom/media/webrtc/third_party_build/fast-forward-libwebrtc.sh +# base of lastest vendoring +8695282243 diff --git a/third_party/libwebrtc/README.mozilla b/third_party/libwebrtc/README.mozilla index 7eedf254eadf..aa5272cd7323 100644 --- a/third_party/libwebrtc/README.mozilla +++ b/third_party/libwebrtc/README.mozilla @@ -6554,3 +6554,5 @@ libwebrtc updated from /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwe libwebrtc updated from /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src commit mjfdev on 2022-06-13T16:11:43.584498. # python3 vendor-libwebrtc.py --from-local /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src --commit mjfdev libwebrtc libwebrtc updated from /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src commit mjfdev on 2022-06-13T16:12:46.987340. +# python3 vendor-libwebrtc.py --from-local /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src --commit mjfdev libwebrtc +libwebrtc updated from /home/mfroman/git-checkouts/trial-webrtc-builds/moz-libwebrtc-checkout/src commit mjfdev on 2022-06-13T16:13:28.173187. diff --git a/third_party/libwebrtc/call/rtp_transport_controller_send.cc b/third_party/libwebrtc/call/rtp_transport_controller_send.cc index dca8e1c534b7..667045d15e62 100644 --- a/third_party/libwebrtc/call/rtp_transport_controller_send.cc +++ b/third_party/libwebrtc/call/rtp_transport_controller_send.cc @@ -156,7 +156,7 @@ RtpTransportControllerSend::~RtpTransportControllerSend() { } RtpVideoSenderInterface* RtpTransportControllerSend::CreateRtpVideoSender( - std::map suspended_ssrcs, + const std::map& suspended_ssrcs, const std::map& states, const RtpConfig& rtp_config, int rtcp_report_interval_ms, diff --git a/third_party/libwebrtc/call/rtp_transport_controller_send.h b/third_party/libwebrtc/call/rtp_transport_controller_send.h index ac4213d5686d..62af78ceb829 100644 --- a/third_party/libwebrtc/call/rtp_transport_controller_send.h +++ b/third_party/libwebrtc/call/rtp_transport_controller_send.h @@ -65,7 +65,7 @@ class RtpTransportControllerSend final // TODO(tommi): Change to std::unique_ptr<>. RtpVideoSenderInterface* CreateRtpVideoSender( - std::map suspended_ssrcs, + const std::map& suspended_ssrcs, const std::map& states, // move states into RtpTransportControllerSend const RtpConfig& rtp_config, diff --git a/third_party/libwebrtc/call/rtp_transport_controller_send_interface.h b/third_party/libwebrtc/call/rtp_transport_controller_send_interface.h index 2aa6d739daf8..f68c4bf3dd6b 100644 --- a/third_party/libwebrtc/call/rtp_transport_controller_send_interface.h +++ b/third_party/libwebrtc/call/rtp_transport_controller_send_interface.h @@ -96,7 +96,7 @@ class RtpTransportControllerSendInterface { virtual PacketRouter* packet_router() = 0; virtual RtpVideoSenderInterface* CreateRtpVideoSender( - std::map suspended_ssrcs, + const std::map& suspended_ssrcs, // TODO(holmer): Move states into RtpTransportControllerSend. const std::map& states, const RtpConfig& rtp_config, diff --git a/third_party/libwebrtc/call/rtp_video_sender.cc b/third_party/libwebrtc/call/rtp_video_sender.cc index c83d697cf5c9..b95370545943 100644 --- a/third_party/libwebrtc/call/rtp_video_sender.cc +++ b/third_party/libwebrtc/call/rtp_video_sender.cc @@ -347,7 +347,7 @@ bool IsFirstFrameOfACodedVideoSequence( RtpVideoSender::RtpVideoSender( Clock* clock, - std::map suspended_ssrcs, + const std::map& suspended_ssrcs, const std::map& states, const RtpConfig& rtp_config, int rtcp_report_interval_ms, @@ -371,7 +371,6 @@ RtpVideoSender::RtpVideoSender( field_trials_.Lookup("WebRTC-GenericCodecDependencyDescriptor"), "Enabled")), active_(false), - suspended_ssrcs_(std::move(suspended_ssrcs)), fec_controller_(std::move(fec_controller)), fec_allowed_(true), rtp_streams_(CreateRtpStreamSenders(clock, @@ -381,7 +380,7 @@ RtpVideoSender::RtpVideoSender( send_transport, transport->GetBandwidthObserver(), transport, - suspended_ssrcs_, + suspended_ssrcs, event_log, retransmission_limiter, frame_encryptor, @@ -421,7 +420,7 @@ RtpVideoSender::RtpVideoSender( } } - ConfigureSsrcs(); + ConfigureSsrcs(suspended_ssrcs); ConfigureRids(); if (!rtp_config_.mid.empty()) { @@ -683,7 +682,8 @@ void RtpVideoSender::DeliverRtcp(const uint8_t* packet, size_t length) { stream.rtp_rtcp->IncomingRtcpPacket(packet, length); } -void RtpVideoSender::ConfigureSsrcs() { +void RtpVideoSender::ConfigureSsrcs( + const std::map& suspended_ssrcs) { // Configure regular SSRCs. RTC_CHECK(ssrc_to_rtp_module_.empty()); for (size_t i = 0; i < rtp_config_.ssrcs.size(); ++i) { @@ -691,8 +691,8 @@ void RtpVideoSender::ConfigureSsrcs() { RtpRtcpInterface* const rtp_rtcp = rtp_streams_[i].rtp_rtcp.get(); // Restore RTP state if previous existed. - auto it = suspended_ssrcs_.find(ssrc); - if (it != suspended_ssrcs_.end()) + auto it = suspended_ssrcs.find(ssrc); + if (it != suspended_ssrcs.end()) rtp_rtcp->SetRtpState(it->second); ssrc_to_rtp_module_[ssrc] = rtp_rtcp; @@ -706,8 +706,8 @@ void RtpVideoSender::ConfigureSsrcs() { for (size_t i = 0; i < rtp_config_.rtx.ssrcs.size(); ++i) { uint32_t ssrc = rtp_config_.rtx.ssrcs[i]; RtpRtcpInterface* const rtp_rtcp = rtp_streams_[i].rtp_rtcp.get(); - auto it = suspended_ssrcs_.find(ssrc); - if (it != suspended_ssrcs_.end()) + auto it = suspended_ssrcs.find(ssrc); + if (it != suspended_ssrcs.end()) rtp_rtcp->SetRtxState(it->second); } diff --git a/third_party/libwebrtc/call/rtp_video_sender.h b/third_party/libwebrtc/call/rtp_video_sender.h index 704ed0e1a662..7e5de987639d 100644 --- a/third_party/libwebrtc/call/rtp_video_sender.h +++ b/third_party/libwebrtc/call/rtp_video_sender.h @@ -74,7 +74,7 @@ class RtpVideoSender : public RtpVideoSenderInterface, // Rtp modules are assumed to be sorted in simulcast index order. RtpVideoSender( Clock* clock, - std::map suspended_ssrcs, + const std::map& suspended_ssrcs, const std::map& states, const RtpConfig& rtp_config, int rtcp_report_interval_ms, @@ -155,7 +155,7 @@ class RtpVideoSender : public RtpVideoSenderInterface, RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_); void UpdateModuleSendingState() RTC_EXCLUSIVE_LOCKS_REQUIRED(mutex_); void ConfigureProtection(); - void ConfigureSsrcs(); + void ConfigureSsrcs(const std::map& suspended_ssrcs); void ConfigureRids(); bool NackEnabled() const; uint32_t GetPacketizationOverheadRate() const; @@ -175,8 +175,6 @@ class RtpVideoSender : public RtpVideoSenderInterface, mutable Mutex mutex_; bool active_ RTC_GUARDED_BY(mutex_); - std::map suspended_ssrcs_; - const std::unique_ptr fec_controller_; bool fec_allowed_ RTC_GUARDED_BY(mutex_); diff --git a/third_party/libwebrtc/call/test/mock_rtp_transport_controller_send.h b/third_party/libwebrtc/call/test/mock_rtp_transport_controller_send.h index b468aa6cb2d1..8d637a3b5c7e 100644 --- a/third_party/libwebrtc/call/test/mock_rtp_transport_controller_send.h +++ b/third_party/libwebrtc/call/test/mock_rtp_transport_controller_send.h @@ -34,7 +34,7 @@ class MockRtpTransportControllerSend public: MOCK_METHOD(RtpVideoSenderInterface*, CreateRtpVideoSender, - ((std::map), + ((const std::map&), (const std::map&), const RtpConfig&, int rtcp_report_interval_ms,