From 8c40d510c8090b393bfc64748cf2b0dfdf3e6b94 Mon Sep 17 00:00:00 2001 From: Ivo Creusen Date: Tue, 13 Jul 2021 12:53:22 +0000 Subject: [PATCH 0001/1565] Make it possible to enable/disable receive-side RTT with a setter. This will allow us to enable receive-side RTT without having to recreate all AudioReceiveStream objects. Bug: webrtc:12951 Change-Id: I1227297ec4ebeea9ba15fe2ed904349829b2e669 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225262 Commit-Queue: Ivo Creusen Reviewed-by: Danil Chapovalov Reviewed-by: Jakob Ivarsson Cr-Commit-Position: refs/heads/master@{#34464} --- modules/rtp_rtcp/mocks/mock_rtp_rtcp.h | 1 + modules/rtp_rtcp/source/rtcp_receiver.cc | 5 ++ modules/rtp_rtcp/source/rtcp_receiver.h | 3 +- .../rtp_rtcp/source/rtcp_receiver_unittest.cc | 59 +++++++++++++++++++ modules/rtp_rtcp/source/rtcp_sender.cc | 5 ++ modules/rtp_rtcp/source/rtcp_sender.h | 6 +- .../rtp_rtcp/source/rtcp_sender_unittest.cc | 29 +++++++++ modules/rtp_rtcp/source/rtp_rtcp_impl.h | 2 + modules/rtp_rtcp/source/rtp_rtcp_impl2.cc | 22 ++++--- modules/rtp_rtcp/source/rtp_rtcp_impl2.h | 2 + modules/rtp_rtcp/source/rtp_rtcp_interface.h | 3 + 11 files changed, 125 insertions(+), 12 deletions(-) diff --git a/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h b/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h index a7707ecc19..59b8cf19b8 100644 --- a/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h +++ b/modules/rtp_rtcp/mocks/mock_rtp_rtcp.h @@ -66,6 +66,7 @@ class MockRtpRtcpInterface : public RtpRtcpInterface { MOCK_METHOD(void, SetSequenceNumber, (uint16_t seq), (override)); MOCK_METHOD(void, SetRtpState, (const RtpState& rtp_state), (override)); MOCK_METHOD(void, SetRtxState, (const RtpState& rtp_state), (override)); + MOCK_METHOD(void, SetNonSenderRttMeasurement, (bool enabled), (override)); MOCK_METHOD(RtpState, GetRtpState, (), (const, override)); MOCK_METHOD(RtpState, GetRtxState, (), (const, override)); MOCK_METHOD(uint32_t, SSRC, (), (const, override)); diff --git a/modules/rtp_rtcp/source/rtcp_receiver.cc b/modules/rtp_rtcp/source/rtcp_receiver.cc index 3ab78df17c..a8e1dc5f07 100644 --- a/modules/rtp_rtcp/source/rtcp_receiver.cc +++ b/modules/rtp_rtcp/source/rtcp_receiver.cc @@ -303,6 +303,11 @@ int32_t RTCPReceiver::RTT(uint32_t remote_ssrc, return 0; } +void RTCPReceiver::SetNonSenderRttMeasurement(bool enabled) { + MutexLock lock(&rtcp_receiver_lock_); + xr_rrtr_status_ = enabled; +} + bool RTCPReceiver::GetAndResetXrRrRtt(int64_t* rtt_ms) { RTC_DCHECK(rtt_ms); MutexLock lock(&rtcp_receiver_lock_); diff --git a/modules/rtp_rtcp/source/rtcp_receiver.h b/modules/rtp_rtcp/source/rtcp_receiver.h index fa9f367c9e..206b63ae8f 100644 --- a/modules/rtp_rtcp/source/rtcp_receiver.h +++ b/modules/rtp_rtcp/source/rtcp_receiver.h @@ -108,6 +108,7 @@ class RTCPReceiver final { int64_t* min_rtt_ms, int64_t* max_rtt_ms) const; + void SetNonSenderRttMeasurement(bool enabled); bool GetAndResetXrRrRtt(int64_t* rtt_ms); // Called once per second on the worker thread to do rtt calculations. @@ -371,7 +372,7 @@ class RTCPReceiver final { received_rrtrs_ssrc_it_ RTC_GUARDED_BY(rtcp_receiver_lock_); // Estimated rtt, zero when there is no valid estimate. - const bool xr_rrtr_status_; + bool xr_rrtr_status_ RTC_GUARDED_BY(rtcp_receiver_lock_); int64_t xr_rr_rtt_ms_; int64_t oldest_tmmbr_info_ms_ RTC_GUARDED_BY(rtcp_receiver_lock_); diff --git a/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc b/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc index 3065534108..e61ae648c3 100644 --- a/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc +++ b/modules/rtp_rtcp/source/rtcp_receiver_unittest.cc @@ -11,6 +11,7 @@ #include "modules/rtp_rtcp/source/rtcp_receiver.h" #include +#include #include #include "api/array_view.h" @@ -939,6 +940,64 @@ TEST(RtcpReceiverTest, RttCalculatedAfterExtendedReportsDlrr) { EXPECT_NEAR(kRttMs, rtt_ms, 1); } +// Same test as above but enables receive-side RTT using the setter instead of +// the config struct. +TEST(RtcpReceiverTest, SetterEnablesReceiverRtt) { + ReceiverMocks mocks; + auto config = DefaultConfiguration(&mocks); + config.non_sender_rtt_measurement = false; + RTCPReceiver receiver(config, &mocks.rtp_rtcp_impl); + receiver.SetRemoteSSRC(kSenderSsrc); + receiver.SetNonSenderRttMeasurement(true); + + Random rand(0x0123456789abcdef); + const int64_t kRttMs = rand.Rand(1, 9 * 3600 * 1000); + const uint32_t kDelayNtp = rand.Rand(0, 0x7fffffff); + const int64_t kDelayMs = CompactNtpRttToMs(kDelayNtp); + NtpTime now = mocks.clock.CurrentNtpTime(); + uint32_t sent_ntp = CompactNtp(now); + mocks.clock.AdvanceTimeMilliseconds(kRttMs + kDelayMs); + + rtcp::ExtendedReports xr; + xr.SetSenderSsrc(kSenderSsrc); + xr.AddDlrrItem(ReceiveTimeInfo(kReceiverMainSsrc, sent_ntp, kDelayNtp)); + + receiver.IncomingPacket(xr.Build()); + + int64_t rtt_ms = 0; + EXPECT_TRUE(receiver.GetAndResetXrRrRtt(&rtt_ms)); + EXPECT_NEAR(rtt_ms, kRttMs, 1); +} + +// Same test as above but disables receive-side RTT using the setter instead of +// the config struct. +TEST(RtcpReceiverTest, DoesntCalculateRttOnReceivedDlrr) { + ReceiverMocks mocks; + auto config = DefaultConfiguration(&mocks); + config.non_sender_rtt_measurement = true; + RTCPReceiver receiver(config, &mocks.rtp_rtcp_impl); + receiver.SetRemoteSSRC(kSenderSsrc); + receiver.SetNonSenderRttMeasurement(false); + + Random rand(0x0123456789abcdef); + const int64_t kRttMs = rand.Rand(1, 9 * 3600 * 1000); + const uint32_t kDelayNtp = rand.Rand(0, 0x7fffffff); + const int64_t kDelayMs = CompactNtpRttToMs(kDelayNtp); + NtpTime now = mocks.clock.CurrentNtpTime(); + uint32_t sent_ntp = CompactNtp(now); + mocks.clock.AdvanceTimeMilliseconds(kRttMs + kDelayMs); + + rtcp::ExtendedReports xr; + xr.SetSenderSsrc(kSenderSsrc); + xr.AddDlrrItem(ReceiveTimeInfo(kReceiverMainSsrc, sent_ntp, kDelayNtp)); + + receiver.IncomingPacket(xr.Build()); + + // We expect that no RTT is available (because receive-side RTT was disabled). + int64_t rtt_ms = 0; + EXPECT_FALSE(receiver.GetAndResetXrRrRtt(&rtt_ms)); +} + TEST(RtcpReceiverTest, XrDlrrCalculatesNegativeRttAsOne) { ReceiverMocks mocks; auto config = DefaultConfiguration(&mocks); diff --git a/modules/rtp_rtcp/source/rtcp_sender.cc b/modules/rtp_rtcp/source/rtcp_sender.cc index 8f5e3b104c..7f5e327de1 100644 --- a/modules/rtp_rtcp/source/rtcp_sender.cc +++ b/modules/rtp_rtcp/source/rtcp_sender.cc @@ -231,6 +231,11 @@ void RTCPSender::SetSendingStatus(const FeedbackState& feedback_state, } } +void RTCPSender::SetNonSenderRttMeasurement(bool enabled) { + MutexLock lock(&mutex_rtcp_sender_); + xr_send_receiver_reference_time_enabled_ = enabled; +} + int32_t RTCPSender::SendLossNotification(const FeedbackState& feedback_state, uint16_t last_decoded_seq_num, uint16_t last_received_seq_num, diff --git a/modules/rtp_rtcp/source/rtcp_sender.h b/modules/rtp_rtcp/source/rtcp_sender.h index 2d1c7da0fc..133eb8342b 100644 --- a/modules/rtp_rtcp/source/rtcp_sender.h +++ b/modules/rtp_rtcp/source/rtcp_sender.h @@ -118,7 +118,8 @@ class RTCPSender final { bool enabled) RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_); // combine the functions - int32_t SetNackStatus(bool enable) RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_); + void SetNonSenderRttMeasurement(bool enabled) + RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_); void SetTimestampOffset(uint32_t timestamp_offset) RTC_LOCKS_EXCLUDED(mutex_rtcp_sender_); @@ -282,7 +283,8 @@ class RTCPSender final { size_t max_packet_size_ RTC_GUARDED_BY(mutex_rtcp_sender_); // True if sending of XR Receiver reference time report is enabled. - const bool xr_send_receiver_reference_time_enabled_; + bool xr_send_receiver_reference_time_enabled_ + RTC_GUARDED_BY(mutex_rtcp_sender_); RtcpPacketTypeCounterObserver* const packet_type_counter_observer_; RtcpPacketTypeCounter packet_type_counter_ RTC_GUARDED_BY(mutex_rtcp_sender_); diff --git a/modules/rtp_rtcp/source/rtcp_sender_unittest.cc b/modules/rtp_rtcp/source/rtcp_sender_unittest.cc index 347be79398..d05d8d6dd5 100644 --- a/modules/rtp_rtcp/source/rtcp_sender_unittest.cc +++ b/modules/rtp_rtcp/source/rtcp_sender_unittest.cc @@ -531,6 +531,35 @@ TEST_F(RtcpSenderTest, SendXrWithRrtr) { EXPECT_EQ(ntp, parser()->xr()->rrtr()->ntp()); } +// Same test as above, but enable Rrtr with the setter. +TEST_F(RtcpSenderTest, SendXrWithRrtrUsingSetter) { + RTCPSender::Configuration config = GetDefaultConfig(); + config.non_sender_rtt_measurement = false; + auto rtcp_sender = CreateRtcpSender(config); + rtcp_sender->SetNonSenderRttMeasurement(true); + rtcp_sender->SetRTCPStatus(RtcpMode::kCompound); + rtcp_sender->SetSendingStatus(feedback_state(), false); + NtpTime ntp = clock_.CurrentNtpTime(); + EXPECT_EQ(0, rtcp_sender->SendRTCP(feedback_state(), kRtcpReport)); + EXPECT_EQ(1, parser()->xr()->num_packets()); + EXPECT_EQ(kSenderSsrc, parser()->xr()->sender_ssrc()); + EXPECT_FALSE(parser()->xr()->dlrr()); + ASSERT_TRUE(parser()->xr()->rrtr()); + EXPECT_EQ(ntp, parser()->xr()->rrtr()->ntp()); +} + +// Same test as above, but disable Rrtr with the setter. +TEST_F(RtcpSenderTest, SendsNoRrtrUsingSetter) { + RTCPSender::Configuration config = GetDefaultConfig(); + config.non_sender_rtt_measurement = true; + auto rtcp_sender = CreateRtcpSender(config); + rtcp_sender->SetNonSenderRttMeasurement(false); + rtcp_sender->SetRTCPStatus(RtcpMode::kCompound); + rtcp_sender->SetSendingStatus(feedback_state(), false); + EXPECT_EQ(0, rtcp_sender->SendRTCP(feedback_state(), kRtcpReport)); + EXPECT_EQ(0, parser()->xr()->num_packets()); +} + TEST_F(RtcpSenderTest, TestNoXrRrtrSentIfSending) { RTCPSender::Configuration config = GetDefaultConfig(); config.non_sender_rtt_measurement = true; diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl.h b/modules/rtp_rtcp/source/rtp_rtcp_impl.h index b0e0b41c48..932a02d521 100644 --- a/modules/rtp_rtcp/source/rtp_rtcp_impl.h +++ b/modules/rtp_rtcp/source/rtp_rtcp_impl.h @@ -97,6 +97,8 @@ class ModuleRtpRtcpImpl : public RtpRtcp, public RTCPReceiver::ModuleRtpRtcp { RtpState GetRtpState() const override; RtpState GetRtxState() const override; + void SetNonSenderRttMeasurement(bool enabled) override {} + uint32_t SSRC() const override { return rtcp_sender_.SSRC(); } void SetRid(const std::string& rid) override; diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl2.cc b/modules/rtp_rtcp/source/rtp_rtcp_impl2.cc index 7fae1e3bd0..c6d19775f2 100644 --- a/modules/rtp_rtcp/source/rtp_rtcp_impl2.cc +++ b/modules/rtp_rtcp/source/rtp_rtcp_impl2.cc @@ -103,14 +103,11 @@ ModuleRtpRtcpImpl2::ModuleRtpRtcpImpl2(const Configuration& configuration) // webrtc::VideoSendStream::Config::Rtp::kDefaultMaxPacketSize. const size_t kTcpOverIpv4HeaderSize = 40; SetMaxRtpPacketSize(IP_PACKET_SIZE - kTcpOverIpv4HeaderSize); - - if (rtt_stats_) { - rtt_update_task_ = RepeatingTaskHandle::DelayedStart( - worker_queue_, kRttUpdateInterval, [this]() { - PeriodicUpdate(); - return kRttUpdateInterval; - }); - } + rtt_update_task_ = RepeatingTaskHandle::DelayedStart( + worker_queue_, kRttUpdateInterval, [this]() { + PeriodicUpdate(); + return kRttUpdateInterval; + }); } ModuleRtpRtcpImpl2::~ModuleRtpRtcpImpl2() { @@ -204,6 +201,11 @@ RtpState ModuleRtpRtcpImpl2::GetRtxState() const { return rtp_sender_->packet_generator.GetRtxRtpState(); } +void ModuleRtpRtcpImpl2::SetNonSenderRttMeasurement(bool enabled) { + rtcp_sender_.SetNonSenderRttMeasurement(enabled); + rtcp_receiver_.SetNonSenderRttMeasurement(enabled); +} + uint32_t ModuleRtpRtcpImpl2::local_media_ssrc() const { RTC_DCHECK_RUN_ON(&packet_sequence_checker_); RTC_DCHECK_EQ(rtcp_receiver_.local_media_ssrc(), rtcp_sender_.SSRC()); @@ -739,7 +741,9 @@ void ModuleRtpRtcpImpl2::PeriodicUpdate() { absl::optional rtt = rtcp_receiver_.OnPeriodicRttUpdate(check_since, rtcp_sender_.Sending()); if (rtt) { - rtt_stats_->OnRttUpdate(rtt->ms()); + if (rtt_stats_) { + rtt_stats_->OnRttUpdate(rtt->ms()); + } set_rtt_ms(rtt->ms()); } } diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl2.h b/modules/rtp_rtcp/source/rtp_rtcp_impl2.h index 0ad495593d..0440879e12 100644 --- a/modules/rtp_rtcp/source/rtp_rtcp_impl2.h +++ b/modules/rtp_rtcp/source/rtp_rtcp_impl2.h @@ -104,6 +104,8 @@ class ModuleRtpRtcpImpl2 final : public RtpRtcpInterface, RtpState GetRtpState() const override; RtpState GetRtxState() const override; + void SetNonSenderRttMeasurement(bool enabled) override; + uint32_t SSRC() const override { return rtcp_sender_.SSRC(); } // Semantically identical to `SSRC()` but must be called on the packet diff --git a/modules/rtp_rtcp/source/rtp_rtcp_interface.h b/modules/rtp_rtcp/source/rtp_rtcp_interface.h index dd5744ec54..5961b3d787 100644 --- a/modules/rtp_rtcp/source/rtp_rtcp_interface.h +++ b/modules/rtp_rtcp/source/rtp_rtcp_interface.h @@ -237,6 +237,9 @@ class RtpRtcpInterface : public RtcpFeedbackSenderInterface { virtual RtpState GetRtpState() const = 0; virtual RtpState GetRtxState() const = 0; + // This can be used to enable/disable receive-side RTT. + virtual void SetNonSenderRttMeasurement(bool enabled) = 0; + // Returns SSRC. virtual uint32_t SSRC() const = 0; From 2c38c9caa42e4b3dc4819d6324c64f58391ed7d0 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Tue, 13 Jul 2021 07:03:11 -0700 Subject: [PATCH 0002/1565] Roll chromium_revision 6d8828f6a6..fca17b9776 (900923:900990) Change log: https://chromium.googlesource.com/chromium/src/+log/6d8828f6a6..fca17b9776 Full diff: https://chromium.googlesource.com/chromium/src/+/6d8828f6a6..fca17b9776 Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/e1acc6a309..0fce7279af * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/695a354117..f52bcbaa58 * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/d749d1b98b..b9b3552b27 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/c1d40d8b39..f5db6b1b4e * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/1a00526b21..c93f12de19 DEPS diff: https://chromium.googlesource.com/chromium/src/+/6d8828f6a6..fca17b9776/DEPS Clang version changed llvmorg-13-init-14732-g8a7b5ebf:llvmorg-13-init-15163-g98033fdc Details: https://chromium.googlesource.com/chromium/src/+/6d8828f6a6..fca17b9776/tools/clang/scripts/update.py TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: I9b3228fa7cbe7834840b0f2afb82484a0954765f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225844 Reviewed-by: Autoroller Reviewed-by: Mirko Bonadei Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34465} --- DEPS | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DEPS b/DEPS index c24608a98a..aa56421e8c 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': '6d8828f6a6eea769a05fa1c0b7acf10aca631d4a', + 'chromium_revision': 'fca17b97760a8c391ac7865e20e1cf9243ba8b89', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,7 +20,7 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@e1acc6a30942360d4789d6c245cf7933e7e9bbec', + 'https://chromium.googlesource.com/chromium/src/base@0fce7279af597d8a149914c52e446cec4e5d0a53', 'src/build': 'https://chromium.googlesource.com/chromium/src/build@826926008327af276adbaafcfa92b525eb5bf326', 'src/buildtools': @@ -31,13 +31,13 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@695a3541172406518e45c377048956a3e5270d7c', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@f52bcbaa5884e2a51fb00fbc84b9f2c9dee46795', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@d749d1b98b475ea15face1c9d2311ed6b8e4b91f', + 'https://chromium.googlesource.com/chromium/src/testing@b9b3552b27bf3467b98b0bcf0cee657fc3217825', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@c1d40d8b399db4c5ebab5e5022a002dca5b3dbb2', + 'https://chromium.googlesource.com/chromium/src/third_party@f5db6b1b4e45ad1147ddda1c13884685e0ba59c0', 'src/buildtools/linux64': { 'packages': [ @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@1a00526b21d46b8b86f13add37003fd33885f32b', + 'https://chromium.googlesource.com/chromium/src/tools@c93f12de192a8e60b81f30b427a0623d215902d0', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', From c98aebbbef26dfc4449d27d40307a945cedfec59 Mon Sep 17 00:00:00 2001 From: Ilya Nikolaevskiy Date: Tue, 13 Jul 2021 16:27:11 +0200 Subject: [PATCH 0003/1565] Change how alignment requirements are processed Software fallback wrapper now reports least common multiple of requirements for two encoders. SimulcastEncoderAdapter queries actual encoder before InitEncode call and requests alignment for all layers if simulcast is not supported by any of the encoders. Bug: chromium:1084702 Change-Id: Iaed8190737125d447036b6c664b863be72556a5d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225881 Reviewed-by: Niels Moller Commit-Queue: Ilya Nikolaevskiy Cr-Commit-Position: refs/heads/master@{#34466} --- ...video_encoder_software_fallback_wrapper.cc | 8 +++ media/engine/simulcast_encoder_adapter.cc | 63 ++++++++++++++++--- media/engine/simulcast_encoder_adapter.h | 23 +++++-- .../simulcast_encoder_adapter_unittest.cc | 4 +- 4 files changed, 81 insertions(+), 17 deletions(-) diff --git a/api/video_codecs/video_encoder_software_fallback_wrapper.cc b/api/video_codecs/video_encoder_software_fallback_wrapper.cc index be79c42464..bcce9dcd93 100644 --- a/api/video_codecs/video_encoder_software_fallback_wrapper.cc +++ b/api/video_codecs/video_encoder_software_fallback_wrapper.cc @@ -25,6 +25,7 @@ #include "api/video/video_frame.h" #include "api/video_codecs/video_codec.h" #include "api/video_codecs/video_encoder.h" +#include "media/base/video_common.h" #include "modules/video_coding/include/video_error_codes.h" #include "modules/video_coding/utility/simulcast_utility.h" #include "rtc_base/checks.h" @@ -417,6 +418,13 @@ VideoEncoder::EncoderInfo VideoEncoderSoftwareFallbackWrapper::GetEncoderInfo() EncoderInfo info = IsFallbackActive() ? fallback_encoder_info : default_encoder_info; + info.requested_resolution_alignment = cricket::LeastCommonMultiple( + fallback_encoder_info.requested_resolution_alignment, + default_encoder_info.requested_resolution_alignment); + info.apply_alignment_to_all_simulcast_layers = + fallback_encoder_info.apply_alignment_to_all_simulcast_layers || + default_encoder_info.apply_alignment_to_all_simulcast_layers; + if (fallback_params_.has_value()) { const auto settings = (encoder_state_ == EncoderState::kForcedFallback) ? fallback_encoder_info.scaling_settings diff --git a/media/engine/simulcast_encoder_adapter.cc b/media/engine/simulcast_encoder_adapter.cc index 3af022ab17..116f987aa4 100644 --- a/media/engine/simulcast_encoder_adapter.cc +++ b/media/engine/simulcast_encoder_adapter.cc @@ -149,9 +149,13 @@ namespace webrtc { SimulcastEncoderAdapter::EncoderContext::EncoderContext( std::unique_ptr encoder, - bool prefer_temporal_support) + bool prefer_temporal_support, + VideoEncoder::EncoderInfo primary_info, + VideoEncoder::EncoderInfo fallback_info) : encoder_(std::move(encoder)), - prefer_temporal_support_(prefer_temporal_support) {} + prefer_temporal_support_(prefer_temporal_support), + primary_info_(std::move(primary_info)), + fallback_info_(std::move(fallback_info)) {} void SimulcastEncoderAdapter::EncoderContext::Release() { if (encoder_) { @@ -690,7 +694,7 @@ void SimulcastEncoderAdapter::DestroyStoredEncoders() { std::unique_ptr SimulcastEncoderAdapter::FetchOrCreateEncoderContext( - bool is_lowest_quality_stream) { + bool is_lowest_quality_stream) const { bool prefer_temporal_support = fallback_encoder_factory_ != nullptr && is_lowest_quality_stream && prefer_temporal_support_on_base_layer_; @@ -712,14 +716,20 @@ SimulcastEncoderAdapter::FetchOrCreateEncoderContext( } else { std::unique_ptr encoder = primary_encoder_factory_->CreateVideoEncoder(video_format_); + VideoEncoder::EncoderInfo primary_info = encoder->GetEncoderInfo(); + VideoEncoder::EncoderInfo fallback_info = primary_info; if (fallback_encoder_factory_ != nullptr) { + std::unique_ptr fallback_encoder = + fallback_encoder_factory_->CreateVideoEncoder(video_format_); + fallback_info = fallback_encoder->GetEncoderInfo(); encoder = CreateVideoEncoderSoftwareFallbackWrapper( - fallback_encoder_factory_->CreateVideoEncoder(video_format_), - std::move(encoder), prefer_temporal_support); + std::move(fallback_encoder), std::move(encoder), + prefer_temporal_support); } encoder_context = std::make_unique( - std::move(encoder), prefer_temporal_support); + std::move(encoder), prefer_temporal_support, primary_info, + fallback_info); } encoder_context->encoder().RegisterEncodeCompleteCallback( @@ -789,9 +799,11 @@ webrtc::VideoCodec SimulcastEncoderAdapter::MakeStreamCodec( void SimulcastEncoderAdapter::OverrideFromFieldTrial( VideoEncoder::EncoderInfo* info) const { if (encoder_info_override_.requested_resolution_alignment()) { - info->requested_resolution_alignment = - *encoder_info_override_.requested_resolution_alignment(); + info->requested_resolution_alignment = cricket::LeastCommonMultiple( + info->requested_resolution_alignment, + *encoder_info_override_.requested_resolution_alignment()); info->apply_alignment_to_all_simulcast_layers = + info->apply_alignment_to_all_simulcast_layers || encoder_info_override_.apply_alignment_to_all_simulcast_layers(); } if (!encoder_info_override_.resolution_bitrate_limits().empty()) { @@ -815,7 +827,34 @@ VideoEncoder::EncoderInfo SimulcastEncoderAdapter::GetEncoderInfo() const { encoder_info.apply_alignment_to_all_simulcast_layers = false; encoder_info.supports_native_handle = true; encoder_info.scaling_settings.thresholds = absl::nullopt; + if (stream_contexts_.empty()) { + // GetEncoderInfo queried before InitEncode. Only alignment info is needed + // to be filled. + // Create one encoder and query it. + + std::unique_ptr encoder_context = + FetchOrCreateEncoderContext(true); + + const VideoEncoder::EncoderInfo& primary_info = + encoder_context->PrimaryInfo(); + const VideoEncoder::EncoderInfo& fallback_info = + encoder_context->FallbackInfo(); + + encoder_info.requested_resolution_alignment = cricket::LeastCommonMultiple( + primary_info.requested_resolution_alignment, + fallback_info.requested_resolution_alignment); + + encoder_info.apply_alignment_to_all_simulcast_layers = + primary_info.apply_alignment_to_all_simulcast_layers || + fallback_info.apply_alignment_to_all_simulcast_layers; + + if (!primary_info.supports_simulcast || !fallback_info.supports_simulcast) { + encoder_info.apply_alignment_to_all_simulcast_layers = true; + } + + cached_encoder_contexts_.emplace_back(std::move(encoder_context)); + OverrideFromFieldTrial(&encoder_info); return encoder_info; } @@ -825,7 +864,6 @@ VideoEncoder::EncoderInfo SimulcastEncoderAdapter::GetEncoderInfo() const { for (size_t i = 0; i < stream_contexts_.size(); ++i) { VideoEncoder::EncoderInfo encoder_impl_info = stream_contexts_[i].encoder().GetEncoderInfo(); - if (i == 0) { // Encoder name indicates names of all sub-encoders. encoder_info.implementation_name += " ("; @@ -864,7 +902,12 @@ VideoEncoder::EncoderInfo SimulcastEncoderAdapter::GetEncoderInfo() const { encoder_info.requested_resolution_alignment = cricket::LeastCommonMultiple( encoder_info.requested_resolution_alignment, encoder_impl_info.requested_resolution_alignment); - if (encoder_impl_info.apply_alignment_to_all_simulcast_layers) { + // request alignment on all layers if any of the encoders may need it, or + // if any non-top layer encoder requests a non-trivial alignment. + if (encoder_impl_info.apply_alignment_to_all_simulcast_layers || + (encoder_impl_info.requested_resolution_alignment > 1 && + (codec_.simulcastStream[i].height < codec_.height || + codec_.simulcastStream[i].width < codec_.width))) { encoder_info.apply_alignment_to_all_simulcast_layers = true; } } diff --git a/media/engine/simulcast_encoder_adapter.h b/media/engine/simulcast_encoder_adapter.h index 2cb29edfd6..07e3ccd024 100644 --- a/media/engine/simulcast_encoder_adapter.h +++ b/media/engine/simulcast_encoder_adapter.h @@ -71,16 +71,24 @@ class RTC_EXPORT SimulcastEncoderAdapter : public VideoEncoder { class EncoderContext { public: EncoderContext(std::unique_ptr encoder, - bool prefer_temporal_support); + bool prefer_temporal_support, + VideoEncoder::EncoderInfo primary_info, + VideoEncoder::EncoderInfo fallback_info); EncoderContext& operator=(EncoderContext&&) = delete; VideoEncoder& encoder() { return *encoder_; } bool prefer_temporal_support() { return prefer_temporal_support_; } void Release(); + const VideoEncoder::EncoderInfo& PrimaryInfo() { return primary_info_; } + + const VideoEncoder::EncoderInfo& FallbackInfo() { return fallback_info_; } + private: std::unique_ptr encoder_; bool prefer_temporal_support_; + const VideoEncoder::EncoderInfo primary_info_; + const VideoEncoder::EncoderInfo fallback_info_; }; class StreamContext : public EncodedImageCallback { @@ -138,8 +146,11 @@ class RTC_EXPORT SimulcastEncoderAdapter : public VideoEncoder { void DestroyStoredEncoders(); + // This method creates encoder. May reuse previously created encoders from + // |cached_encoder_contexts_|. It's const because it's used from + // const GetEncoderInfo(). std::unique_ptr FetchOrCreateEncoderContext( - bool is_lowest_quality_stream); + bool is_lowest_quality_stream) const; webrtc::VideoCodec MakeStreamCodec(const webrtc::VideoCodec& codec, int stream_idx, @@ -169,9 +180,11 @@ class RTC_EXPORT SimulcastEncoderAdapter : public VideoEncoder { // Used for checking the single-threaded access of the encoder interface. RTC_NO_UNIQUE_ADDRESS SequenceChecker encoder_queue_; - // Store encoders in between calls to Release and InitEncode, so they don't - // have to be recreated. Remaining encoders are destroyed by the destructor. - std::list> cached_encoder_contexts_; + // Store previously created and released encoders , so they don't have to be + // recreated. Remaining encoders are destroyed by the destructor. + // Marked as |mutable| becuase we may need to temporarily create encoder in + // GetEncoderInfo(), which is const. + mutable std::list> cached_encoder_contexts_; const absl::optional experimental_boosted_screenshare_qp_; const bool boost_base_layer_quality_; diff --git a/media/engine/simulcast_encoder_adapter_unittest.cc b/media/engine/simulcast_encoder_adapter_unittest.cc index a74a2c3785..48e005f1c2 100644 --- a/media/engine/simulcast_encoder_adapter_unittest.cc +++ b/media/engine/simulcast_encoder_adapter_unittest.cc @@ -900,8 +900,6 @@ TEST_F(TestSimulcastEncoderAdapterFake, SetRatesUnderMinBitrate) { } TEST_F(TestSimulcastEncoderAdapterFake, SupportsImplementationName) { - EXPECT_EQ("SimulcastEncoderAdapter", - adapter_->GetEncoderInfo().implementation_name); SimulcastTestFixtureImpl::DefaultSettings( &codec_, static_cast(kTestTemporalLayerProfile), kVideoCodecVP8); @@ -910,6 +908,8 @@ TEST_F(TestSimulcastEncoderAdapterFake, SupportsImplementationName) { encoder_names.push_back("codec2"); encoder_names.push_back("codec3"); helper_->factory()->SetEncoderNames(encoder_names); + EXPECT_EQ("SimulcastEncoderAdapter", + adapter_->GetEncoderInfo().implementation_name); EXPECT_EQ(0, adapter_->InitEncode(&codec_, kSettings)); EXPECT_EQ("SimulcastEncoderAdapter (codec1, codec2, codec3)", adapter_->GetEncoderInfo().implementation_name); From 6a9dec9392e2854787dc936430915e8b2d1c9b74 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Tue, 13 Jul 2021 11:12:42 -0700 Subject: [PATCH 0004/1565] Roll chromium_revision fca17b9776..3b84d2c8f0 (900990:901098) Change log: https://chromium.googlesource.com/chromium/src/+log/fca17b9776..3b84d2c8f0 Full diff: https://chromium.googlesource.com/chromium/src/+/fca17b9776..3b84d2c8f0 Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/0fce7279af..34b023d846 * src/build: https://chromium.googlesource.com/chromium/src/build/+log/8269260083..d4edf4d844 * src/buildtools/third_party/libc++abi/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git/+log/cb34896ebd..6803464b0f * src/buildtools/third_party/libunwind/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git/+log/e7ac0f84fc..a5feaf6165 * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/f52bcbaa58..ecbd78e60e * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/b9b3552b27..6f95c73eca * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/f5db6b1b4e..d255894551 * src/third_party/androidx: -umIXLPTAdxRy2iaK4QFSeOf4t7PAKglJP7ggvWhfRwC.._WEcXceOuK2XsUUyrM5doOfE06y8TtpBiamn4PkQp1YC * src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/3345f09ed6..25ef034fbe * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/aecbd80f57..51a1443c7c * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/c93f12de19..816f68a7cd DEPS diff: https://chromium.googlesource.com/chromium/src/+/fca17b9776..3b84d2c8f0/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: Ibb337849dbd5cf5fe676c7f3d74dc92e5773e8b4 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225941 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34467} --- DEPS | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/DEPS b/DEPS index aa56421e8c..6ce80cea38 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': 'fca17b97760a8c391ac7865e20e1cf9243ba8b89', + 'chromium_revision': '3b84d2c8f0464b87aa24497a96f2e56077af1766', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,9 +20,9 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@0fce7279af597d8a149914c52e446cec4e5d0a53', + 'https://chromium.googlesource.com/chromium/src/base@34b023d846f09c0a83856e1c42d9de22e32bfe04', 'src/build': - 'https://chromium.googlesource.com/chromium/src/build@826926008327af276adbaafcfa92b525eb5bf326', + 'https://chromium.googlesource.com/chromium/src/build@d4edf4d84469244ea5aaf0836a472af7b683b20e', 'src/buildtools': 'https://chromium.googlesource.com/chromium/src/buildtools@2500c1d8f3a20a66a7cbafe3f69079a2edb742dd', # Gradle 6.6.1. Used for testing Android Studio project generation for WebRTC. @@ -31,13 +31,13 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@f52bcbaa5884e2a51fb00fbc84b9f2c9dee46795', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@ecbd78e60e78ba73350cea713a6d7001c80fd637', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@b9b3552b27bf3467b98b0bcf0cee657fc3217825', + 'https://chromium.googlesource.com/chromium/src/testing@6f95c73eca772dc0af0371a918288423d63f8350', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@f5db6b1b4e45ad1147ddda1c13884685e0ba59c0', + 'https://chromium.googlesource.com/chromium/src/third_party@d2558945517b2168be9db016e44d5ba4d43784a6', 'src/buildtools/linux64': { 'packages': [ @@ -75,9 +75,9 @@ deps = { 'src/buildtools/third_party/libc++/trunk': 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git@79a2e924d96e2fc1e4b937c42efd08898fa472d7', 'src/buildtools/third_party/libc++abi/trunk': - 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git@cb34896ebd62f93f708ff9aad26159cf11dde6f4', + 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git@6803464b0f46df0a51862347d39e0791b59cf568', 'src/buildtools/third_party/libunwind/trunk': - 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git@e7ac0f84fc2f2f8bd2ad151a7348e7120d77648a', + 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git@a5feaf61658af4453e282142a76aeb6f9c045311', 'src/tools/clang/dsymutil': { 'packages': [ @@ -128,7 +128,7 @@ deps = { 'src/third_party/breakpad/breakpad': 'https://chromium.googlesource.com/breakpad/breakpad.git@b95c4868b10f69e642666742233aede1eb653012', 'src/third_party/catapult': - 'https://chromium.googlesource.com/catapult.git@3345f09ed65020a999e108ea37d30b49c87e14ed', + 'https://chromium.googlesource.com/catapult.git@25ef034fbef738c4ff017d1ab1c42d7a6fad6a7f', 'src/third_party/ced/src': { 'url': 'https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git@ba412eaaacd3186085babcd901679a48863c7dd5', }, @@ -214,7 +214,7 @@ deps = { 'condition': 'checkout_android', }, 'src/third_party/perfetto': - 'https://android.googlesource.com/platform/external/perfetto.git@aecbd80f576686b67e29bdfae8c9c03bb9ce1996', + 'https://android.googlesource.com/platform/external/perfetto.git@51a1443c7cb98f1fd50e1bb87c183704b4f5c81b', 'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@eebc5cd487a89c51ba148f6d6ac45779970f72d7', 'src/third_party/libyuv': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@c93f12de192a8e60b81f30b427a0623d215902d0', + 'https://chromium.googlesource.com/chromium/src/tools@816f68a7cd12bb5928a3299f9991025e150511b9', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': '-umIXLPTAdxRy2iaK4QFSeOf4t7PAKglJP7ggvWhfRwC', + 'version': '_WEcXceOuK2XsUUyrM5doOfE06y8TtpBiamn4PkQp1YC', }, ], 'condition': 'checkout_android', From 28a2c63526f471558bc93cdcae9fab42b84b10a5 Mon Sep 17 00:00:00 2001 From: Minyue Li Date: Wed, 7 Jul 2021 15:53:38 +0200 Subject: [PATCH 0005/1565] Adding packetsDiscarded to RTCReceivedRtpStreamStats. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:12532, webrtc:7065, webrtc:8199 Change-Id: I3ba62ec65e5660e98787f629aec3ee7a0889207a Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225261 Reviewed-by: Jakob Ivarsson Reviewed-by: Henrik Boström Reviewed-by: Taylor Brandstetter Reviewed-by: Niels Moller Reviewed-by: Sam Zackrisson Reviewed-by: Sebastian Jansson Commit-Queue: Minyue Li Cr-Commit-Position: refs/heads/master@{#34468} --- api/neteq/neteq.h | 2 +- api/stats/rtcstats_objects.h | 7 ++- audio/audio_receive_stream.cc | 1 + audio/audio_receive_stream_unittest.cc | 47 ++++++++++++++++++- call/audio_receive_stream.h | 1 + media/base/media_channel.h | 5 +- media/engine/webrtc_voice_engine.cc | 1 + modules/audio_coding/acm2/acm_receiver.cc | 2 + .../include/audio_coding_module_typedefs.h | 9 ++-- pc/rtc_stats_collector.cc | 1 + pc/rtc_stats_collector_unittest.cc | 2 + pc/rtc_stats_integrationtest.cc | 16 +++++-- stats/rtcstats_objects.cc | 12 ++--- 13 files changed, 85 insertions(+), 21 deletions(-) diff --git a/api/neteq/neteq.h b/api/neteq/neteq.h index ea7079e369..81340f16f8 100644 --- a/api/neteq/neteq.h +++ b/api/neteq/neteq.h @@ -60,7 +60,7 @@ struct NetEqNetworkStatistics { // These metrics are never reset. struct NetEqLifetimeStatistics { // Stats below correspond to similarly-named fields in the WebRTC stats spec. - // https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamtrackstats + // https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats uint64_t total_samples_received = 0; uint64_t concealed_samples = 0; uint64_t concealment_events = 0; diff --git a/api/stats/rtcstats_objects.h b/api/stats/rtcstats_objects.h index 2030380918..6995db8093 100644 --- a/api/stats/rtcstats_objects.h +++ b/api/stats/rtcstats_objects.h @@ -399,13 +399,14 @@ class RTC_EXPORT RTCReceivedRtpStreamStats : public RTCRTPStreamStats { // TODO(hbos) The following fields need to be added and migrated // both from RTCInboundRtpStreamStats and RTCRemoteInboundRtpStreamStats: - // packetsReceived, packetsDiscarded, packetsRepaired, burstPacketsLost, + // packetsReceived, packetsRepaired, burstPacketsLost, // burstPacketDiscarded, burstLossCount, burstDiscardCount, burstLossRate, // burstDiscardRate, gapLossRate, gapDiscardRate, framesDropped, // partialFramesLost, fullFramesLost // crbug.com/webrtc/12532 RTCStatsMember jitter; RTCStatsMember packets_lost; // Signed per RFC 3550 + RTCStatsMember packets_discarded; protected: RTCReceivedRtpStreamStats(const std::string&& id, int64_t timestamp_us); @@ -463,8 +464,6 @@ class RTC_EXPORT RTCInboundRTPStreamStats final // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 RTCStatsMember round_trip_time; // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 - RTCStatsMember packets_discarded; - // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 RTCStatsMember packets_repaired; // TODO(hbos): Collect and populate this value. https://bugs.webrtc.org/7065 RTCStatsMember burst_packets_lost; @@ -569,7 +568,7 @@ class RTC_EXPORT RTCRemoteInboundRtpStreamStats final ~RTCRemoteInboundRtpStreamStats() override; // TODO(hbos): The following RTCReceivedRtpStreamStats metrics should also be - // implemented: packetsReceived, packetsDiscarded, packetsRepaired, + // implemented: packetsReceived, packetsRepaired, // burstPacketsLost, burstPacketsDiscarded, burstLossCount, burstDiscardCount, // burstLossRate, burstDiscardRate, gapLossRate and gapDiscardRate. // RTCRemoteInboundRtpStreamStats diff --git a/audio/audio_receive_stream.cc b/audio/audio_receive_stream.cc index f243fa67db..f3843812ee 100644 --- a/audio/audio_receive_stream.cc +++ b/audio/audio_receive_stream.cc @@ -298,6 +298,7 @@ webrtc::AudioReceiveStream::Stats AudioReceiveStream::GetStats( // Get jitter buffer and total delay (alg + jitter + playout) stats. auto ns = channel_receive_->GetNetworkStatistics(get_and_clear_legacy_stats); + stats.packets_discarded = ns.packetsDiscarded; stats.fec_packets_received = ns.fecPacketsReceived; stats.fec_packets_discarded = ns.fecPacketsDiscarded; stats.jitter_buffer_ms = ns.currentBufferSize; diff --git a/audio/audio_receive_stream_unittest.cc b/audio/audio_receive_stream_unittest.cc index fb5f1cb876..1d6183a1d4 100644 --- a/audio/audio_receive_stream_unittest.cc +++ b/audio/audio_receive_stream_unittest.cc @@ -68,8 +68,34 @@ const std::pair kReceiveCodec = { 123, {"codec_name_recv", 96000, 0}}; const NetworkStatistics kNetworkStats = { - 123, 456, false, 789012, 3456, 123, 456, 789, 543, 123, 432, 321, 123, - 101, 789, 12, 345, 678, 901, 0, -1, -1, 0, 0, 0, 0}; + /*currentBufferSize=*/123, + /*preferredBufferSize=*/456, + /*jitterPeaksFound=*/false, + /*totalSamplesReceived=*/789012, + /*concealedSamples=*/3456, + /*silentConcealedSamples=*/123, + /*concealmentEvents=*/456, + /*jitterBufferDelayMs=*/789, + /*jitterBufferEmittedCount=*/543, + /*jitterBufferTargetDelayMs=*/123, + /*insertedSamplesForDeceleration=*/432, + /*removedSamplesForAcceleration=*/321, + /*fecPacketsReceived=*/123, + /*fecPacketsDiscarded=*/101, + /*packetsDiscarded=*/989, + /*currentExpandRate=*/789, + /*currentSpeechExpandRate=*/12, + /*currentPreemptiveRate=*/345, + /*currentAccelerateRate =*/678, + /*currentSecondaryDecodedRate=*/901, + /*currentSecondaryDiscardedRate=*/0, + /*meanWaitingTimeMs=*/-1, + /*maxWaitingTimeMs=*/-1, + /*packetBufferFlushes=*/0, + /*delayedPacketOutageSamples=*/0, + /*relativePacketArrivalDelayMs=*/135, + /*interruptionCount=*/-1, + /*totalInterruptionDurationMs=*/-1}; const AudioDecodingCallStats kAudioDecodeStats = MakeAudioDecodeStatsForTest(); struct ConfigHelper { @@ -253,6 +279,13 @@ TEST(AudioReceiveStreamTest, GetStats) { EXPECT_EQ(static_cast(kNetworkStats.jitterBufferTargetDelayMs) / static_cast(rtc::kNumMillisecsPerSec), stats.jitter_buffer_target_delay_seconds); + EXPECT_EQ(kNetworkStats.insertedSamplesForDeceleration, + stats.inserted_samples_for_deceleration); + EXPECT_EQ(kNetworkStats.removedSamplesForAcceleration, + stats.removed_samples_for_acceleration); + EXPECT_EQ(kNetworkStats.fecPacketsReceived, stats.fec_packets_received); + EXPECT_EQ(kNetworkStats.fecPacketsDiscarded, stats.fec_packets_discarded); + EXPECT_EQ(kNetworkStats.packetsDiscarded, stats.packets_discarded); EXPECT_EQ(Q14ToFloat(kNetworkStats.currentExpandRate), stats.expand_rate); EXPECT_EQ(Q14ToFloat(kNetworkStats.currentSpeechExpandRate), stats.speech_expand_rate); @@ -264,6 +297,16 @@ TEST(AudioReceiveStreamTest, GetStats) { stats.accelerate_rate); EXPECT_EQ(Q14ToFloat(kNetworkStats.currentPreemptiveRate), stats.preemptive_expand_rate); + EXPECT_EQ(kNetworkStats.packetBufferFlushes, stats.jitter_buffer_flushes); + EXPECT_EQ(kNetworkStats.delayedPacketOutageSamples, + stats.delayed_packet_outage_samples); + EXPECT_EQ(static_cast(kNetworkStats.relativePacketArrivalDelayMs) / + static_cast(rtc::kNumMillisecsPerSec), + stats.relative_packet_arrival_delay_seconds); + EXPECT_EQ(kNetworkStats.interruptionCount, stats.interruption_count); + EXPECT_EQ(kNetworkStats.totalInterruptionDurationMs, + stats.total_interruption_duration_ms); + EXPECT_EQ(kAudioDecodeStats.calls_to_silence_generator, stats.decoding_calls_to_silence_generator); EXPECT_EQ(kAudioDecodeStats.calls_to_neteq, stats.decoding_calls_to_neteq); diff --git a/call/audio_receive_stream.h b/call/audio_receive_stream.h index 8403e6bea0..182cd49679 100644 --- a/call/audio_receive_stream.h +++ b/call/audio_receive_stream.h @@ -39,6 +39,7 @@ class AudioReceiveStream : public MediaReceiveStream { uint64_t fec_packets_received = 0; uint64_t fec_packets_discarded = 0; uint32_t packets_lost = 0; + uint64_t packets_discarded = 0; uint32_t nacks_sent = 0; std::string codec_name; absl::optional codec_payload_type; diff --git a/media/base/media_channel.h b/media/base/media_channel.h index 7b9a6f138c..c6bbc0735f 100644 --- a/media/base/media_channel.h +++ b/media/base/media_channel.h @@ -471,7 +471,7 @@ struct VoiceReceiverInfo : public MediaReceiverInfo { int delay_estimate_ms = 0; int audio_level = 0; // Stats below correspond to similarly-named fields in the WebRTC stats spec. - // https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamtrackstats + // https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats double total_output_energy = 0.0; uint64_t total_samples_received = 0; double total_output_duration = 0.0; @@ -483,6 +483,9 @@ struct VoiceReceiverInfo : public MediaReceiverInfo { uint64_t removed_samples_for_acceleration = 0; uint64_t fec_packets_received = 0; uint64_t fec_packets_discarded = 0; + // Stats below correspond to similarly-named fields in the WebRTC stats spec. + // https://w3c.github.io/webrtc-stats/#dom-rtcreceivedrtpstreamstats + uint64_t packets_discarded = 0; // Stats below DO NOT correspond directly to anything in the WebRTC stats // fraction of synthesized audio inserted through expansion. float expand_rate = 0.0f; diff --git a/media/engine/webrtc_voice_engine.cc b/media/engine/webrtc_voice_engine.cc index aa80c8724a..7ce61b01f9 100644 --- a/media/engine/webrtc_voice_engine.cc +++ b/media/engine/webrtc_voice_engine.cc @@ -2365,6 +2365,7 @@ bool WebRtcVoiceMediaChannel::GetStats(VoiceMediaInfo* info, rinfo.fec_packets_received = stats.fec_packets_received; rinfo.fec_packets_discarded = stats.fec_packets_discarded; rinfo.packets_lost = stats.packets_lost; + rinfo.packets_discarded = stats.packets_discarded; rinfo.codec_name = stats.codec_name; rinfo.codec_payload_type = stats.codec_payload_type; rinfo.jitter_ms = stats.jitter_ms; diff --git a/modules/audio_coding/acm2/acm_receiver.cc b/modules/audio_coding/acm2/acm_receiver.cc index 3214ce6f7b..80cb3c5ccf 100644 --- a/modules/audio_coding/acm2/acm_receiver.cc +++ b/modules/audio_coding/acm2/acm_receiver.cc @@ -307,6 +307,8 @@ void AcmReceiver::GetNetworkStatistics( neteq_->GetOperationsAndState(); acm_stat->packetBufferFlushes = neteq_operations_and_state.packet_buffer_flushes; + acm_stat->packetsDiscarded = + neteq_operations_and_state.discarded_primary_packets; } int AcmReceiver::EnableNack(size_t max_nack_list_size) { diff --git a/modules/audio_coding/include/audio_coding_module_typedefs.h b/modules/audio_coding/include/audio_coding_module_typedefs.h index a7210dadcb..e5598e3c45 100644 --- a/modules/audio_coding/include/audio_coding_module_typedefs.h +++ b/modules/audio_coding/include/audio_coding_module_typedefs.h @@ -81,19 +81,22 @@ struct NetworkStatistics { // adding extra delay due to "peaky jitter" bool jitterPeaksFound; // Stats below correspond to similarly-named fields in the WebRTC stats spec. - // https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamtrackstats + // https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats uint64_t totalSamplesReceived; uint64_t concealedSamples; uint64_t silentConcealedSamples; uint64_t concealmentEvents; uint64_t jitterBufferDelayMs; uint64_t jitterBufferEmittedCount; - // Non standard stats propagated to spec complaint GetStats API. - uint64_t jitterBufferTargetDelayMs; uint64_t insertedSamplesForDeceleration; uint64_t removedSamplesForAcceleration; uint64_t fecPacketsReceived; uint64_t fecPacketsDiscarded; + // Stats below correspond to similarly-named fields in the WebRTC stats spec. + // https://w3c.github.io/webrtc-stats/#dom-rtcreceivedrtpstreamstats + uint64_t packetsDiscarded; + // Non standard stats propagated to spec complaint GetStats API. + uint64_t jitterBufferTargetDelayMs; // Stats below DO NOT correspond directly to anything in the WebRTC stats // fraction (of original stream) of synthesized audio inserted through // expansion (in Q14) diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc index 6599d0ef49..ee5826486c 100644 --- a/pc/rtc_stats_collector.cc +++ b/pc/rtc_stats_collector.cc @@ -392,6 +392,7 @@ std::unique_ptr CreateInboundAudioStreamStats( voice_receiver_info.fec_packets_received; inbound_audio->fec_packets_discarded = voice_receiver_info.fec_packets_discarded; + inbound_audio->packets_discarded = voice_receiver_info.packets_discarded; return inbound_audio; } diff --git a/pc/rtc_stats_collector_unittest.cc b/pc/rtc_stats_collector_unittest.cc index 2ac0737715..4ec86ab24f 100644 --- a/pc/rtc_stats_collector_unittest.cc +++ b/pc/rtc_stats_collector_unittest.cc @@ -1953,6 +1953,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Audio) { cricket::SsrcReceiverInfo()); voice_media_info.receivers[0].local_stats[0].ssrc = 1; voice_media_info.receivers[0].packets_lost = -1; // Signed per RFC3550 + voice_media_info.receivers[0].packets_discarded = 7788; voice_media_info.receivers[0].packets_rcvd = 2; voice_media_info.receivers[0].nacks_sent = 5; voice_media_info.receivers[0].fec_packets_discarded = 5566; @@ -2009,6 +2010,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCInboundRTPStreamStats_Audio) { expected_audio.bytes_received = 3; expected_audio.header_bytes_received = 4; expected_audio.packets_lost = -1; + expected_audio.packets_discarded = 7788; // |expected_audio.last_packet_received_timestamp| should be undefined. expected_audio.jitter = 4.5; expected_audio.jitter_buffer_delay = 1.0; diff --git a/pc/rtc_stats_integrationtest.cc b/pc/rtc_stats_integrationtest.cc index 2dfe1b5cd5..df7b8a3ff0 100644 --- a/pc/rtc_stats_integrationtest.cc +++ b/pc/rtc_stats_integrationtest.cc @@ -800,7 +800,9 @@ class RTCStatsReportVerifier { bool VerifyRTCInboundRTPStreamStats( const RTCInboundRTPStreamStats& inbound_stream) { RTCStatsVerifier verifier(report_, &inbound_stream); - VerifyRTCReceivedRtpStreamStats(inbound_stream, verifier); + VerifyRTCReceivedRtpStreamStats(inbound_stream, verifier, + inbound_stream.media_type.is_defined() && + *inbound_stream.media_type == "audio"); verifier.TestMemberIsOptionalIDReference( inbound_stream.remote_id, RTCRemoteOutboundRtpStreamStats::kType); if (inbound_stream.media_type.is_defined() && @@ -884,7 +886,6 @@ class RTCStatsReportVerifier { verifier.TestMemberIsUndefined(inbound_stream.frames_received); } verifier.TestMemberIsUndefined(inbound_stream.round_trip_time); - verifier.TestMemberIsUndefined(inbound_stream.packets_discarded); verifier.TestMemberIsUndefined(inbound_stream.packets_repaired); verifier.TestMemberIsUndefined(inbound_stream.burst_packets_lost); verifier.TestMemberIsUndefined(inbound_stream.burst_packets_discarded); @@ -1022,16 +1023,23 @@ class RTCStatsReportVerifier { void VerifyRTCReceivedRtpStreamStats( const RTCReceivedRtpStreamStats& received_rtp, - RTCStatsVerifier& verifier) { + RTCStatsVerifier& verifier, + bool packets_discarded_defined) { VerifyRTCRTPStreamStats(received_rtp, verifier); verifier.TestMemberIsNonNegative(received_rtp.jitter); verifier.TestMemberIsDefined(received_rtp.packets_lost); + if (packets_discarded_defined) { + verifier.TestMemberIsNonNegative( + received_rtp.packets_discarded); + } else { + verifier.TestMemberIsUndefined(received_rtp.packets_discarded); + } } bool VerifyRTCRemoteInboundRtpStreamStats( const RTCRemoteInboundRtpStreamStats& remote_inbound_stream) { RTCStatsVerifier verifier(report_, &remote_inbound_stream); - VerifyRTCReceivedRtpStreamStats(remote_inbound_stream, verifier); + VerifyRTCReceivedRtpStreamStats(remote_inbound_stream, verifier, false); verifier.TestMemberIsDefined(remote_inbound_stream.fraction_lost); verifier.TestMemberIsIDReference(remote_inbound_stream.local_id, RTCOutboundRTPStreamStats::kType); diff --git a/stats/rtcstats_objects.cc b/stats/rtcstats_objects.cc index a2d7aa0b07..6af724e55b 100644 --- a/stats/rtcstats_objects.cc +++ b/stats/rtcstats_objects.cc @@ -582,7 +582,8 @@ RTCRTPStreamStats::~RTCRTPStreamStats() {} WEBRTC_RTCSTATS_IMPL( RTCReceivedRtpStreamStats, RTCRTPStreamStats, "received-rtp", &jitter, - &packets_lost) + &packets_lost, + &packets_discarded) // clang-format on RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(const std::string&& id, @@ -593,13 +594,15 @@ RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats(std::string&& id, int64_t timestamp_us) : RTCRTPStreamStats(std::move(id), timestamp_us), jitter("jitter"), - packets_lost("packetsLost") {} + packets_lost("packetsLost"), + packets_discarded("packetsDiscarded") {} RTCReceivedRtpStreamStats::RTCReceivedRtpStreamStats( const RTCReceivedRtpStreamStats& other) : RTCRTPStreamStats(other), jitter(other.jitter), - packets_lost(other.packets_lost) {} + packets_lost(other.packets_lost), + packets_discarded(other.packets_discarded) {} RTCReceivedRtpStreamStats::~RTCReceivedRtpStreamStats() {} @@ -650,7 +653,6 @@ WEBRTC_RTCSTATS_IMPL( &total_samples_duration, &frames_received, &round_trip_time, - &packets_discarded, &packets_repaired, &burst_packets_lost, &burst_packets_discarded, @@ -706,7 +708,6 @@ RTCInboundRTPStreamStats::RTCInboundRTPStreamStats(std::string&& id, total_samples_duration("totalSamplesDuration"), frames_received("framesReceived"), round_trip_time("roundTripTime"), - packets_discarded("packetsDiscarded"), packets_repaired("packetsRepaired"), burst_packets_lost("burstPacketsLost"), burst_packets_discarded("burstPacketsDiscarded"), @@ -758,7 +759,6 @@ RTCInboundRTPStreamStats::RTCInboundRTPStreamStats( total_samples_duration(other.total_samples_duration), frames_received(other.frames_received), round_trip_time(other.round_trip_time), - packets_discarded(other.packets_discarded), packets_repaired(other.packets_repaired), burst_packets_lost(other.burst_packets_lost), burst_packets_discarded(other.burst_packets_discarded), From fb5e06f169a87401a2cd65e7e222e337c2d22f0f Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Tue, 13 Jul 2021 17:02:18 -0700 Subject: [PATCH 0006/1565] Roll chromium_revision 3b84d2c8f0..059cac0a27 (901098:901269) Change log: https://chromium.googlesource.com/chromium/src/+log/3b84d2c8f0..059cac0a27 Full diff: https://chromium.googlesource.com/chromium/src/+/3b84d2c8f0..059cac0a27 Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/34b023d846..77fa6d984a * src/build: https://chromium.googlesource.com/chromium/src/build/+log/d4edf4d844..2d999384c2 * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/ecbd78e60e..f072be3de8 * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/6f95c73eca..e937af0a35 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/d255894551..6066d82f4d * src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/25ef034fbe..3c6345a736 * src/third_party/freetype/src: https://chromium.googlesource.com/chromium/src/third_party/freetype2.git/+log/d3dc2da9b2..59e95b014a * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/51a1443c7c..c70ad6b2a0 * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/816f68a7cd..a910604e4e * src/tools/luci-go: git_revision:2ac8bd9cbc20824bb04a39b0f1b77178ace930b3..git_revision:8b8a9a6040ca6debd30694a71a99a1eac97d72fd * src/tools/luci-go: git_revision:2ac8bd9cbc20824bb04a39b0f1b77178ace930b3..git_revision:8b8a9a6040ca6debd30694a71a99a1eac97d72fd * src/tools/luci-go: git_revision:2ac8bd9cbc20824bb04a39b0f1b77178ace930b3..git_revision:8b8a9a6040ca6debd30694a71a99a1eac97d72fd DEPS diff: https://chromium.googlesource.com/chromium/src/+/3b84d2c8f0..059cac0a27/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: I8275028b78a7cd0caf9b7e818c3391a1c769ce70 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226001 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34469} --- DEPS | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/DEPS b/DEPS index 6ce80cea38..9a3cff40b3 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': '3b84d2c8f0464b87aa24497a96f2e56077af1766', + 'chromium_revision': '059cac0a27d4e4ae2273dd63cb4bc119723f4451', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,9 +20,9 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@34b023d846f09c0a83856e1c42d9de22e32bfe04', + 'https://chromium.googlesource.com/chromium/src/base@77fa6d984a96e463f69440451672a17927bb420e', 'src/build': - 'https://chromium.googlesource.com/chromium/src/build@d4edf4d84469244ea5aaf0836a472af7b683b20e', + 'https://chromium.googlesource.com/chromium/src/build@2d999384c270a340f592cce0a0fb3f8f94c15290', 'src/buildtools': 'https://chromium.googlesource.com/chromium/src/buildtools@2500c1d8f3a20a66a7cbafe3f69079a2edb742dd', # Gradle 6.6.1. Used for testing Android Studio project generation for WebRTC. @@ -31,13 +31,13 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@ecbd78e60e78ba73350cea713a6d7001c80fd637', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@f072be3de80dd7f1c663a506d1ca77f80cd30149', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@6f95c73eca772dc0af0371a918288423d63f8350', + 'https://chromium.googlesource.com/chromium/src/testing@e937af0a35b00b1f266bd12f926a6a75a660ac61', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@d2558945517b2168be9db016e44d5ba4d43784a6', + 'https://chromium.googlesource.com/chromium/src/third_party@6066d82f4dbba24aa87a9d35a05fe6e3d1eac389', 'src/buildtools/linux64': { 'packages': [ @@ -128,7 +128,7 @@ deps = { 'src/third_party/breakpad/breakpad': 'https://chromium.googlesource.com/breakpad/breakpad.git@b95c4868b10f69e642666742233aede1eb653012', 'src/third_party/catapult': - 'https://chromium.googlesource.com/catapult.git@25ef034fbef738c4ff017d1ab1c42d7a6fad6a7f', + 'https://chromium.googlesource.com/catapult.git@3c6345a736f4a79e85dc46dcecc71caeebcb4499', 'src/third_party/ced/src': { 'url': 'https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git@ba412eaaacd3186085babcd901679a48863c7dd5', }, @@ -150,7 +150,7 @@ deps = { 'condition': 'checkout_linux', }, 'src/third_party/freetype/src': - 'https://chromium.googlesource.com/chromium/src/third_party/freetype2.git@d3dc2da9b27af5b90575d62989389cc65fe7977c', + 'https://chromium.googlesource.com/chromium/src/third_party/freetype2.git@59e95b014aa162393d6d569225cf713d71ffdc33', 'src/third_party/harfbuzz-ng/src': 'https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git@cc9bb294919e846ef8a0731b5e9f304f95ef3bb8', 'src/third_party/google_benchmark/src': { @@ -214,7 +214,7 @@ deps = { 'condition': 'checkout_android', }, 'src/third_party/perfetto': - 'https://android.googlesource.com/platform/external/perfetto.git@51a1443c7cb98f1fd50e1bb87c183704b4f5c81b', + 'https://android.googlesource.com/platform/external/perfetto.git@c70ad6b2a04526e0e0a98a93a56bbb0cefdc0aef', 'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@eebc5cd487a89c51ba148f6d6ac45779970f72d7', 'src/third_party/libyuv': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@816f68a7cd12bb5928a3299f9991025e150511b9', + 'https://chromium.googlesource.com/chromium/src/tools@a910604e4ed4ef08c0c01726a5b05a95bc6d8819', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -477,15 +477,15 @@ deps = { 'packages': [ { 'package': 'infra/tools/luci/isolate/${{platform}}', - 'version': 'git_revision:2ac8bd9cbc20824bb04a39b0f1b77178ace930b3', + 'version': 'git_revision:8b8a9a6040ca6debd30694a71a99a1eac97d72fd', }, { 'package': 'infra/tools/luci/isolated/${{platform}}', - 'version': 'git_revision:2ac8bd9cbc20824bb04a39b0f1b77178ace930b3', + 'version': 'git_revision:8b8a9a6040ca6debd30694a71a99a1eac97d72fd', }, { 'package': 'infra/tools/luci/swarming/${{platform}}', - 'version': 'git_revision:2ac8bd9cbc20824bb04a39b0f1b77178ace930b3', + 'version': 'git_revision:8b8a9a6040ca6debd30694a71a99a1eac97d72fd', }, ], 'dep_type': 'cipd', From 00cdadf620dc4589b15e25a27b09395b25e56b00 Mon Sep 17 00:00:00 2001 From: webrtc-version-updater Date: Tue, 13 Jul 2021 21:04:09 -0700 Subject: [PATCH 0007/1565] Update WebRTC code version (2021-07-14T04:04:07). TBR=webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com,mbonadei@webrtc.org Bug: None Change-Id: Ib592be345972559164a0cc5bd81bbd2e9e21ce44 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226002 Reviewed-by: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Commit-Queue: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Cr-Commit-Position: refs/heads/master@{#34470} --- call/version.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/call/version.cc b/call/version.cc index a76af47b41..8971a548a2 100644 --- a/call/version.cc +++ b/call/version.cc @@ -13,7 +13,7 @@ namespace webrtc { // The timestamp is always in UTC. -const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-13T04:01:55"; +const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-14T04:04:07"; void LoadWebRTCVersionInRegister() { // Using volatile to instruct the compiler to not optimize `p` away even From 2c525ff92b94cf9f79f98d3f9be6f9068fad9d36 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Tue, 13 Jul 2021 23:01:29 -0700 Subject: [PATCH 0008/1565] Roll chromium_revision 059cac0a27..161239673f (901269:901383) Change log: https://chromium.googlesource.com/chromium/src/+log/059cac0a27..161239673f Full diff: https://chromium.googlesource.com/chromium/src/+/059cac0a27..161239673f Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/77fa6d984a..5bf97d1b44 * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/e937af0a35..70c4b1c859 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/6066d82f4d..86bf03042b * src/third_party/androidx: _WEcXceOuK2XsUUyrM5doOfE06y8TtpBiamn4PkQp1YC..KAJR3quNncHGavb1kWfS9ZIG0ybkZY0B7_e0NVCq28MC * src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/3c6345a736..2814ff3716 * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/c70ad6b2a0..162fe0e78f * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/a910604e4e..791b9de481 DEPS diff: https://chromium.googlesource.com/chromium/src/+/059cac0a27..161239673f/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: Ie1fe1a9314e2ebc18efca35e10657b24b8a68ba2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226003 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34471} --- DEPS | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/DEPS b/DEPS index 9a3cff40b3..45a142d1bc 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': '059cac0a27d4e4ae2273dd63cb4bc119723f4451', + 'chromium_revision': '161239673fd3fac73ecbf3d4eedb770f3e0d7fa2', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,7 +20,7 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@77fa6d984a96e463f69440451672a17927bb420e', + 'https://chromium.googlesource.com/chromium/src/base@5bf97d1b446c8f31fc35bb189706a0b160daef7e', 'src/build': 'https://chromium.googlesource.com/chromium/src/build@2d999384c270a340f592cce0a0fb3f8f94c15290', 'src/buildtools': @@ -35,9 +35,9 @@ deps = { 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@e937af0a35b00b1f266bd12f926a6a75a660ac61', + 'https://chromium.googlesource.com/chromium/src/testing@70c4b1c8599291e33e34a8db6b7a652d0df2674b', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@6066d82f4dbba24aa87a9d35a05fe6e3d1eac389', + 'https://chromium.googlesource.com/chromium/src/third_party@86bf03042be87a590f61f1e273201ed64805935e', 'src/buildtools/linux64': { 'packages': [ @@ -128,7 +128,7 @@ deps = { 'src/third_party/breakpad/breakpad': 'https://chromium.googlesource.com/breakpad/breakpad.git@b95c4868b10f69e642666742233aede1eb653012', 'src/third_party/catapult': - 'https://chromium.googlesource.com/catapult.git@3c6345a736f4a79e85dc46dcecc71caeebcb4499', + 'https://chromium.googlesource.com/catapult.git@2814ff3716a8512518bee705a0f91425ce06b27b', 'src/third_party/ced/src': { 'url': 'https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git@ba412eaaacd3186085babcd901679a48863c7dd5', }, @@ -214,7 +214,7 @@ deps = { 'condition': 'checkout_android', }, 'src/third_party/perfetto': - 'https://android.googlesource.com/platform/external/perfetto.git@c70ad6b2a04526e0e0a98a93a56bbb0cefdc0aef', + 'https://android.googlesource.com/platform/external/perfetto.git@162fe0e78f24ee73d5ac38f81680b2ebb03f63d1', 'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@eebc5cd487a89c51ba148f6d6ac45779970f72d7', 'src/third_party/libyuv': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@a910604e4ed4ef08c0c01726a5b05a95bc6d8819', + 'https://chromium.googlesource.com/chromium/src/tools@791b9de481643d2c45f0bb981ffaa285084dad72', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': '_WEcXceOuK2XsUUyrM5doOfE06y8TtpBiamn4PkQp1YC', + 'version': 'KAJR3quNncHGavb1kWfS9ZIG0ybkZY0B7_e0NVCq28MC', }, ], 'condition': 'checkout_android', From 42d600e50d0688506295a271dbe77f7573eec470 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Wed, 14 Jul 2021 07:07:36 -0700 Subject: [PATCH 0009/1565] Roll chromium_revision 161239673f..d478ec55b6 (901383:901484) Change log: https://chromium.googlesource.com/chromium/src/+log/161239673f..d478ec55b6 Full diff: https://chromium.googlesource.com/chromium/src/+/161239673f..d478ec55b6 Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/5bf97d1b44..25c1b792c6 * src/build: https://chromium.googlesource.com/chromium/src/build/+log/2d999384c2..c8b96e2021 * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/f072be3de8..d9b34df711 * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/70c4b1c859..8424b7ed57 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/86bf03042b..239d5075f2 * src/third_party/androidx: KAJR3quNncHGavb1kWfS9ZIG0ybkZY0B7_e0NVCq28MC..PlxbY_1zdmHx9JtVYzJHudzfuY7EyHMpNvk-Qk2JlAcC * src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/2814ff3716..a67592355d * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/162fe0e78f..7b7e355d04 * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/791b9de481..c112242867 * src/tools/luci-go: git_revision:8b8a9a6040ca6debd30694a71a99a1eac97d72fd..git_revision:f0a9c0d3581d7e0d1f6f0e4805e32e872237fb62 * src/tools/luci-go: git_revision:8b8a9a6040ca6debd30694a71a99a1eac97d72fd..git_revision:f0a9c0d3581d7e0d1f6f0e4805e32e872237fb62 * src/tools/luci-go: git_revision:8b8a9a6040ca6debd30694a71a99a1eac97d72fd..git_revision:f0a9c0d3581d7e0d1f6f0e4805e32e872237fb62 DEPS diff: https://chromium.googlesource.com/chromium/src/+/161239673f..d478ec55b6/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: I1615f843a1ee46b6928a480e62ebd34caf1ce942 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226044 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34472} --- DEPS | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/DEPS b/DEPS index 45a142d1bc..8a3943da45 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': '161239673fd3fac73ecbf3d4eedb770f3e0d7fa2', + 'chromium_revision': 'd478ec55b6371585352e88b99c1a1b5bd324fc8a', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,9 +20,9 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@5bf97d1b446c8f31fc35bb189706a0b160daef7e', + 'https://chromium.googlesource.com/chromium/src/base@25c1b792c68f352af7f28983876bb18f04ebe8f3', 'src/build': - 'https://chromium.googlesource.com/chromium/src/build@2d999384c270a340f592cce0a0fb3f8f94c15290', + 'https://chromium.googlesource.com/chromium/src/build@c8b96e202193b3f7d68d5a6497516a7139c00d25', 'src/buildtools': 'https://chromium.googlesource.com/chromium/src/buildtools@2500c1d8f3a20a66a7cbafe3f69079a2edb742dd', # Gradle 6.6.1. Used for testing Android Studio project generation for WebRTC. @@ -31,13 +31,13 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@f072be3de80dd7f1c663a506d1ca77f80cd30149', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@d9b34df7117cb3845d16c93269bb25e8ea28904b', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@70c4b1c8599291e33e34a8db6b7a652d0df2674b', + 'https://chromium.googlesource.com/chromium/src/testing@8424b7ed574e3e1c4faefa4461e6a843a5226761', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@86bf03042be87a590f61f1e273201ed64805935e', + 'https://chromium.googlesource.com/chromium/src/third_party@239d5075f220619a52936ec7cc354154f7e170b6', 'src/buildtools/linux64': { 'packages': [ @@ -128,7 +128,7 @@ deps = { 'src/third_party/breakpad/breakpad': 'https://chromium.googlesource.com/breakpad/breakpad.git@b95c4868b10f69e642666742233aede1eb653012', 'src/third_party/catapult': - 'https://chromium.googlesource.com/catapult.git@2814ff3716a8512518bee705a0f91425ce06b27b', + 'https://chromium.googlesource.com/catapult.git@a67592355de8bcf2f6ae916456f10fdfb2e0e997', 'src/third_party/ced/src': { 'url': 'https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git@ba412eaaacd3186085babcd901679a48863c7dd5', }, @@ -214,7 +214,7 @@ deps = { 'condition': 'checkout_android', }, 'src/third_party/perfetto': - 'https://android.googlesource.com/platform/external/perfetto.git@162fe0e78f24ee73d5ac38f81680b2ebb03f63d1', + 'https://android.googlesource.com/platform/external/perfetto.git@7b7e355d04c3b5f759e8dfd3352b550a6ec1a0a7', 'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@eebc5cd487a89c51ba148f6d6ac45779970f72d7', 'src/third_party/libyuv': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@791b9de481643d2c45f0bb981ffaa285084dad72', + 'https://chromium.googlesource.com/chromium/src/tools@c11224286787f51d94cf08408adc610ff570f397', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'KAJR3quNncHGavb1kWfS9ZIG0ybkZY0B7_e0NVCq28MC', + 'version': 'PlxbY_1zdmHx9JtVYzJHudzfuY7EyHMpNvk-Qk2JlAcC', }, ], 'condition': 'checkout_android', @@ -477,15 +477,15 @@ deps = { 'packages': [ { 'package': 'infra/tools/luci/isolate/${{platform}}', - 'version': 'git_revision:8b8a9a6040ca6debd30694a71a99a1eac97d72fd', + 'version': 'git_revision:f0a9c0d3581d7e0d1f6f0e4805e32e872237fb62', }, { 'package': 'infra/tools/luci/isolated/${{platform}}', - 'version': 'git_revision:8b8a9a6040ca6debd30694a71a99a1eac97d72fd', + 'version': 'git_revision:f0a9c0d3581d7e0d1f6f0e4805e32e872237fb62', }, { 'package': 'infra/tools/luci/swarming/${{platform}}', - 'version': 'git_revision:8b8a9a6040ca6debd30694a71a99a1eac97d72fd', + 'version': 'git_revision:f0a9c0d3581d7e0d1f6f0e4805e32e872237fb62', }, ], 'dep_type': 'cipd', From 3c33edbf6de2016899a5b94a9e345c0a185cebb6 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Wed, 14 Jul 2021 17:02:00 -0700 Subject: [PATCH 0010/1565] Roll chromium_revision d478ec55b6..d609a9cd55 (901484:901713) Change log: https://chromium.googlesource.com/chromium/src/+log/d478ec55b6..d609a9cd55 Full diff: https://chromium.googlesource.com/chromium/src/+/d478ec55b6..d609a9cd55 Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/25c1b792c6..07114d4a23 * src/build: https://chromium.googlesource.com/chromium/src/build/+log/c8b96e2021..a0ffb5c18b * src/buildtools/third_party/libc++abi/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git/+log/6803464b0f..bb278658aa * src/buildtools/third_party/libunwind/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git/+log/a5feaf6165..333cca2038 * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/d9b34df711..349aa2754b * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/8424b7ed57..000d4a9449 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/239d5075f2..c2f35d352c * src/third_party/androidx: PlxbY_1zdmHx9JtVYzJHudzfuY7EyHMpNvk-Qk2JlAcC..kwXj5TyfSiM-CXBynUhJkK6TTJMvcWbaA3aCQu9nE4UC * src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/a67592355d..066d46004f * src/third_party/freetype/src: https://chromium.googlesource.com/chromium/src/third_party/freetype2.git/+log/59e95b014a..5d27b10f4c * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/7b7e355d04..97facadd96 * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/c112242867..4079a50fbb * src/tools/luci-go: git_revision:f0a9c0d3581d7e0d1f6f0e4805e32e872237fb62..git_revision:91a04914ac71b7b6fe7b95ce8691d45eeb69bf4f * src/tools/luci-go: git_revision:f0a9c0d3581d7e0d1f6f0e4805e32e872237fb62..git_revision:91a04914ac71b7b6fe7b95ce8691d45eeb69bf4f * src/tools/luci-go: git_revision:f0a9c0d3581d7e0d1f6f0e4805e32e872237fb62..git_revision:91a04914ac71b7b6fe7b95ce8691d45eeb69bf4f DEPS diff: https://chromium.googlesource.com/chromium/src/+/d478ec55b6..d609a9cd55/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: I32eca87bb5ace92c045152924651e947b1911577 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226140 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34473} --- DEPS | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/DEPS b/DEPS index 8a3943da45..965a3cfe60 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': 'd478ec55b6371585352e88b99c1a1b5bd324fc8a', + 'chromium_revision': 'd609a9cd55204ce1510623f5cc6d64627c3d9704', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,9 +20,9 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@25c1b792c68f352af7f28983876bb18f04ebe8f3', + 'https://chromium.googlesource.com/chromium/src/base@07114d4a23bd2c6f9e311b7a8b7525b023f581a9', 'src/build': - 'https://chromium.googlesource.com/chromium/src/build@c8b96e202193b3f7d68d5a6497516a7139c00d25', + 'https://chromium.googlesource.com/chromium/src/build@a0ffb5c18bd9af17f1a60d003eab55d166a47dae', 'src/buildtools': 'https://chromium.googlesource.com/chromium/src/buildtools@2500c1d8f3a20a66a7cbafe3f69079a2edb742dd', # Gradle 6.6.1. Used for testing Android Studio project generation for WebRTC. @@ -31,13 +31,13 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@d9b34df7117cb3845d16c93269bb25e8ea28904b', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@349aa2754b623370bf39d5fd791f0db4a2a33d77', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@8424b7ed574e3e1c4faefa4461e6a843a5226761', + 'https://chromium.googlesource.com/chromium/src/testing@000d4a944949daf755ab21d5df8b1cce013d10b0', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@239d5075f220619a52936ec7cc354154f7e170b6', + 'https://chromium.googlesource.com/chromium/src/third_party@c2f35d352c0927ea7ffb29af785f048f546bd14d', 'src/buildtools/linux64': { 'packages': [ @@ -75,9 +75,9 @@ deps = { 'src/buildtools/third_party/libc++/trunk': 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git@79a2e924d96e2fc1e4b937c42efd08898fa472d7', 'src/buildtools/third_party/libc++abi/trunk': - 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git@6803464b0f46df0a51862347d39e0791b59cf568', + 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git@bb278658aa0d4cc88dd4ca5bc5df428f92b85ddb', 'src/buildtools/third_party/libunwind/trunk': - 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git@a5feaf61658af4453e282142a76aeb6f9c045311', + 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git@333cca20381ead0d1baa7bcc38219e5bfd52f664', 'src/tools/clang/dsymutil': { 'packages': [ @@ -128,7 +128,7 @@ deps = { 'src/third_party/breakpad/breakpad': 'https://chromium.googlesource.com/breakpad/breakpad.git@b95c4868b10f69e642666742233aede1eb653012', 'src/third_party/catapult': - 'https://chromium.googlesource.com/catapult.git@a67592355de8bcf2f6ae916456f10fdfb2e0e997', + 'https://chromium.googlesource.com/catapult.git@066d46004fba4ea48646d1ee30e42e46b822e281', 'src/third_party/ced/src': { 'url': 'https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git@ba412eaaacd3186085babcd901679a48863c7dd5', }, @@ -150,7 +150,7 @@ deps = { 'condition': 'checkout_linux', }, 'src/third_party/freetype/src': - 'https://chromium.googlesource.com/chromium/src/third_party/freetype2.git@59e95b014aa162393d6d569225cf713d71ffdc33', + 'https://chromium.googlesource.com/chromium/src/third_party/freetype2.git@5d27b10f4c6c8e140bd48a001b98037ac0d54118', 'src/third_party/harfbuzz-ng/src': 'https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git@cc9bb294919e846ef8a0731b5e9f304f95ef3bb8', 'src/third_party/google_benchmark/src': { @@ -214,7 +214,7 @@ deps = { 'condition': 'checkout_android', }, 'src/third_party/perfetto': - 'https://android.googlesource.com/platform/external/perfetto.git@7b7e355d04c3b5f759e8dfd3352b550a6ec1a0a7', + 'https://android.googlesource.com/platform/external/perfetto.git@97facadd961825cf2b6eb12398e0908a102d0c4a', 'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@eebc5cd487a89c51ba148f6d6ac45779970f72d7', 'src/third_party/libyuv': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@c11224286787f51d94cf08408adc610ff570f397', + 'https://chromium.googlesource.com/chromium/src/tools@4079a50fbb7815ed4811cd7e05a4f127f722841e', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'PlxbY_1zdmHx9JtVYzJHudzfuY7EyHMpNvk-Qk2JlAcC', + 'version': 'kwXj5TyfSiM-CXBynUhJkK6TTJMvcWbaA3aCQu9nE4UC', }, ], 'condition': 'checkout_android', @@ -477,15 +477,15 @@ deps = { 'packages': [ { 'package': 'infra/tools/luci/isolate/${{platform}}', - 'version': 'git_revision:f0a9c0d3581d7e0d1f6f0e4805e32e872237fb62', + 'version': 'git_revision:91a04914ac71b7b6fe7b95ce8691d45eeb69bf4f', }, { 'package': 'infra/tools/luci/isolated/${{platform}}', - 'version': 'git_revision:f0a9c0d3581d7e0d1f6f0e4805e32e872237fb62', + 'version': 'git_revision:91a04914ac71b7b6fe7b95ce8691d45eeb69bf4f', }, { 'package': 'infra/tools/luci/swarming/${{platform}}', - 'version': 'git_revision:f0a9c0d3581d7e0d1f6f0e4805e32e872237fb62', + 'version': 'git_revision:91a04914ac71b7b6fe7b95ce8691d45eeb69bf4f', }, ], 'dep_type': 'cipd', From 621002e39f6d9fc574b9cb85136006dcf3fe92b9 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Wed, 14 Jul 2021 23:02:27 -0700 Subject: [PATCH 0011/1565] Roll chromium_revision d609a9cd55..3e91767469 (901713:901837) Change log: https://chromium.googlesource.com/chromium/src/+log/d609a9cd55..3e91767469 Full diff: https://chromium.googlesource.com/chromium/src/+/d609a9cd55..3e91767469 Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/07114d4a23..725516aa75 * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/349aa2754b..d1c4c41dbf * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/000d4a9449..facf50dac0 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/c2f35d352c..52135cd88e * src/third_party/androidx: kwXj5TyfSiM-CXBynUhJkK6TTJMvcWbaA3aCQu9nE4UC..zxYzGNpCuNmZZYQcKjcgCxw3eXROUqPq57kFfMvMuT0C * src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/066d46004f..f61fac0492 * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/4079a50fbb..93e178ad35 DEPS diff: https://chromium.googlesource.com/chromium/src/+/d609a9cd55..3e91767469/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: Iaf501cbca8a57e7b8e9f55de868c1b061a7cd477 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226121 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34474} --- DEPS | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/DEPS b/DEPS index 965a3cfe60..0339c540e7 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': 'd609a9cd55204ce1510623f5cc6d64627c3d9704', + 'chromium_revision': '3e91767469c23d3181e804abdefa208bc7bdb57e', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,7 +20,7 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@07114d4a23bd2c6f9e311b7a8b7525b023f581a9', + 'https://chromium.googlesource.com/chromium/src/base@725516aa75059049687a476dac4f61070c700fce', 'src/build': 'https://chromium.googlesource.com/chromium/src/build@a0ffb5c18bd9af17f1a60d003eab55d166a47dae', 'src/buildtools': @@ -31,13 +31,13 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@349aa2754b623370bf39d5fd791f0db4a2a33d77', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@d1c4c41dbfc81e76471180568c20b9003f535bf6', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@000d4a944949daf755ab21d5df8b1cce013d10b0', + 'https://chromium.googlesource.com/chromium/src/testing@facf50dac062324559b25d071f0c317185ae6a4c', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@c2f35d352c0927ea7ffb29af785f048f546bd14d', + 'https://chromium.googlesource.com/chromium/src/third_party@52135cd88ede573d2dd3a6253a68615e04444b94', 'src/buildtools/linux64': { 'packages': [ @@ -128,7 +128,7 @@ deps = { 'src/third_party/breakpad/breakpad': 'https://chromium.googlesource.com/breakpad/breakpad.git@b95c4868b10f69e642666742233aede1eb653012', 'src/third_party/catapult': - 'https://chromium.googlesource.com/catapult.git@066d46004fba4ea48646d1ee30e42e46b822e281', + 'https://chromium.googlesource.com/catapult.git@f61fac04928dc5d84be9dce9ea4f642527f3fd58', 'src/third_party/ced/src': { 'url': 'https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git@ba412eaaacd3186085babcd901679a48863c7dd5', }, @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@4079a50fbb7815ed4811cd7e05a4f127f722841e', + 'https://chromium.googlesource.com/chromium/src/tools@93e178ad359993c575361aa04126013fcb2c8a33', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'kwXj5TyfSiM-CXBynUhJkK6TTJMvcWbaA3aCQu9nE4UC', + 'version': 'zxYzGNpCuNmZZYQcKjcgCxw3eXROUqPq57kFfMvMuT0C', }, ], 'condition': 'checkout_android', From 0d2dc1f38fa019aa0a832ca7f11147df6204b5c0 Mon Sep 17 00:00:00 2001 From: Fanny Linderborg Date: Wed, 14 Jul 2021 14:02:11 +0000 Subject: [PATCH 0012/1565] Reference "main" branches instead of "master" branches. Both WebRTC and Chromium have migrated from the "master" to the "main" branch. TBR=hta@webrtc.org Bug: None Change-Id: I2b5e6973bdd8fdc9c1bd96e2747a8a9ac2630b14 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226080 Commit-Queue: Fanny Linderborg Reviewed-by: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34475} --- CODE_OF_CONDUCT.md | 4 ++-- README.md | 2 +- docs/bug-reporting.md | 4 ++-- docs/faq.md | 6 +++--- docs/native-code/android/index.md | 8 ++++---- docs/native-code/development/index.md | 18 +++++++++--------- .../development/prerequisite-sw/index.md | 8 ++++---- docs/native-code/index.md | 12 ++++++------ docs/native-code/ios/index.md | 6 +++--- g3doc/how_to_write_documentation.md | 3 +-- g3doc/style-guide.md | 6 +++--- .../audio_device/g3doc/audio_device_module.md | 2 +- native-api.md | 4 ++-- webrtc.gni | 2 +- 14 files changed, 42 insertions(+), 43 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 7b48e69e7a..f6b7d0f6a3 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -61,8 +61,8 @@ The decisions of the WebRTC community managers may be appealed via community-app ## Acknowledgements This Code of Conduct is based on Contributor Covenant, version 1.4, -available [here](http://contributor-covenant.org/version/1/4) and [Chromium](https://chromium.googlesource.com/chromium/src/+/master/CODE_OF_CONDUCT.md) +available [here](http://contributor-covenant.org/version/1/4) and [Chromium](https://chromium.googlesource.com/chromium/src/+/main/CODE_OF_CONDUCT.md) ## License -This Code of Conduct is available for reuse under the Creative Commons Zero (CC0) license. \ No newline at end of file +This Code of Conduct is available for reuse under the Creative Commons Zero (CC0) license. diff --git a/README.md b/README.md index 0b290fd17c..37694d9514 100644 --- a/README.md +++ b/README.md @@ -28,4 +28,4 @@ native API header files. * [Code of conduct](CODE_OF_CONDUCT.md) * [Reporting bugs](docs/bug-reporting.md) -[native-dev]: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/index.md +[native-dev]: https://webrtc.googlesource.com/src/+/main/docs/native-code/index.md diff --git a/docs/bug-reporting.md b/docs/bug-reporting.md index 4e5cbda3e2..c21186a9b7 100644 --- a/docs/bug-reporting.md +++ b/docs/bug-reporting.md @@ -166,5 +166,5 @@ page. [ChromeBugList]: https://bugs.chromium.org/p/chromium/issues/list?can=1&q=Type%3DBug-Security+component%3ABlink%3EWebRTC+-status%3ADuplicate%2CWontfix&sort=-closed&colspec=ID+Pri+M+Component+Status+Owner+Summary+OS+Closed&x=m&y=releaseblock&cells=ids [WebRtcBugList]: https://bugs.chromium.org/p/webrtc/issues/list?q=Type%3DBug-Security&can=1 [ChromeSecurity]: https://www.chromium.org/Home/chromium-security -[SeverityGuidelines]: https://chromium.googlesource.com/chromium/src/+/master/docs/security/severity-guidelines.md -[SecurityFaq]: https://chromium.googlesource.com/chromium/src/+/master/docs/security/faq.md +[SeverityGuidelines]: https://chromium.googlesource.com/chromium/src/+/main/docs/security/severity-guidelines.md +[SecurityFaq]: https://chromium.googlesource.com/chromium/src/+/main/docs/security/faq.md diff --git a/docs/faq.md b/docs/faq.md index 700fd15b9e..7511c8c95d 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -114,7 +114,7 @@ Go to [https://webrtc.googlesource.com/src][webrtc-repo-link]. We have put sample applications [here][examples-link]. -[examples-link]: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/development/index.md#example-applications +[examples-link]: https://webrtc.googlesource.com/src/+/main/docs/native-code/development/index.md#example-applications ### Are WebRTC components subject to change? @@ -133,7 +133,7 @@ feature set. Please see [Getting Started][getting-started-link] and [Contributing bug fixes][contributing-link] for more information. -[getting-started-link]: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/development/index.md +[getting-started-link]: https://webrtc.googlesource.com/src/+/main/docs/native-code/development/index.md [contributing-link]: https://webrtc.org/support/contributing @@ -191,7 +191,7 @@ royalties for WebRTC and its components including the codecs it supports (VP8 for video and iSAC and iLBC for audio). For more information, see the [License page][license-link]. -[license-link]: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/license/index.md +[license-link]: https://webrtc.googlesource.com/src/+/main/LICENSE ### What does this license let me do? diff --git a/docs/native-code/android/index.md b/docs/native-code/android/index.md index 82078210d1..e378cf9a99 100644 --- a/docs/native-code/android/index.md +++ b/docs/native-code/android/index.md @@ -150,9 +150,9 @@ If want to run Release builds instead; pass `is_debug=false` to GN (and preferably generate the projects files into a directory like `out/Release`). Then use the scripts generated in `out/Release/bin` instead. -[webrtc-prerequisite-sw]: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/development/prerequisite-sw/index.md -[webrtc-jni-doc]: https://webrtc.googlesource.com/src/+/master/sdk/android/README -[apprtc-doc]: https://webrtc.googlesource.com/src/+/master/examples/androidapp/README +[webrtc-prerequisite-sw]: https://webrtc.googlesource.com/src/+/main/docs/native-code/development/prerequisite-sw/index.md +[webrtc-jni-doc]: https://webrtc.googlesource.com/src/+/main/sdk/android/README +[apprtc-doc]: https://webrtc.googlesource.com/src/+/main/examples/androidapp/README [ninja]: https://ninja-build.org/ [prebuilt-libraries]: https://bintray.com/google/webrtc/google-webrtc -[webrtc-development]: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/development/index.md +[webrtc-development]: https://webrtc.googlesource.com/src/+/main/docs/native-code/development/index.md diff --git a/docs/native-code/development/index.md b/docs/native-code/development/index.md index b19a15ca5e..3b3940d489 100644 --- a/docs/native-code/development/index.md +++ b/docs/native-code/development/index.md @@ -9,7 +9,7 @@ pages for build instructions and example applications specific to these mobile p First, be sure to install the [prerequisite software][webrtc-prerequisite-sw]. -[webrtc-prerequisite-sw]: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/development/prerequisite-sw/index.md +[webrtc-prerequisite-sw]: https://webrtc.googlesource.com/src/+/main/docs/native-code/development/prerequisite-sw/index.md ## Getting the Code @@ -44,7 +44,7 @@ $ git config branch.autosetuprebase always ``` $ cd src -$ git checkout master +$ git checkout main $ git new-branch your-branch-name ``` @@ -58,11 +58,11 @@ make sure you're logged in. The quota is much larger for logged in users. Update your current branch with: ``` -$ git checkout master -$ git pull origin master +$ git checkout main +$ git pull origin main $ gclient sync $ git checkout my-branch -$ git merge master +$ git merge main ``` ## Building @@ -168,7 +168,7 @@ $ git checkout $ cd ~/dev/webrtc/src $ gclient sync $ # When done, go back to depot_tools, git reset --hard, run gclient again and -$ # verify the current branch becomes REMOTE:origin/master +$ # verify the current branch becomes REMOTE:origin/main ``` The above is untested and unsupported, but it might help. @@ -273,8 +273,8 @@ Target name `turnserver`. Used for unit tests. [ninja-build-rules]: https://gn.googlesource.com/gn/+/master/docs/reference.md#the-all-and-default-rules [gn]: https://gn.googlesource.com/gn/+/master/README.md [gn-doc]: https://gn.googlesource.com/gn/+/master/docs/reference.md#IDE-options -[webrtc-android-development]: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/android/index.md -[webrtc-ios-development]: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/ios/index.md +[webrtc-android-development]: https://webrtc.googlesource.com/src/+/main/docs/native-code/android/index.md +[webrtc-ios-development]: https://webrtc.googlesource.com/src/+/main/docs/native-code/ios/index.md [chromium-work-branches]: https://www.chromium.org/developers/how-tos/get-the-code/working-with-branches [chromium-work-release-branches]: https://www.chromium.org/developers/how-tos/get-the-code/working-with-release-branches [webrtc-contributing]: https://webrtc.org/support/contributing/ @@ -283,4 +283,4 @@ Target name `turnserver`. Used for unit tests. [rfc-5766]: https://tools.ietf.org/html/rfc5766 [m80-log]: https://webrtc.googlesource.com/src/+log/branch-heads/3987 [m80]: https://webrtc.googlesource.com/src/+/branch-heads/3987 -[fuzzers]: https://chromium.googlesource.com/external/webrtc/+/refs/heads/master/test/fuzzers/ +[fuzzers]: https://webrtc.googlesource.com/src/+/main/test/fuzzers/ diff --git a/docs/native-code/development/prerequisite-sw/index.md b/docs/native-code/development/prerequisite-sw/index.md index 7f49f26702..e4d5d20806 100644 --- a/docs/native-code/development/prerequisite-sw/index.md +++ b/docs/native-code/development/prerequisite-sw/index.md @@ -54,7 +54,7 @@ need to install the NDK/SDK separately. [depot-tools]: https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html#_setting_up [git]: http://git-scm.com [install-build-deps]: https://cs.chromium.org/chromium/src/build/install-build-deps.sh -[chromium-linux-build-instructions]: https://chromium.googlesource.com/chromium/src/+/master/docs/linux/build_instructions.md -[chromium-win-build-instructions]: https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md -[chromium-linux-prerequisites]: https://chromium.googlesource.com/chromium/src/+/master/docs/linux/build_instructions.md#notes -[chromium-android-build-build-instructions]: https://chromium.googlesource.com/chromium/src/+/master/docs/android_build_instructions.md +[chromium-linux-build-instructions]: https://chromium.googlesource.com/chromium/src/+/main/docs/linux/build_instructions.md +[chromium-win-build-instructions]: https://chromium.googlesource.com/chromium/src/+/main/docs/windows_build_instructions.md +[chromium-linux-prerequisites]: https://chromium.googlesource.com/chromium/src/+/main/docs/linux/build_instructions.md#notes +[chromium-android-build-build-instructions]: https://chromium.googlesource.com/chromium/src/+/main/docs/android_build_instructions.md diff --git a/docs/native-code/index.md b/docs/native-code/index.md index f91bbb7360..928af6e52e 100644 --- a/docs/native-code/index.md +++ b/docs/native-code/index.md @@ -20,7 +20,7 @@ Please read the [License & Rights][webrtc-license] and [FAQ][webrtc-faq] before downloading the source code. [webrtc-license]: https://webrtc.org/support/license -[webrtc-faq]: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/faq.md +[webrtc-faq]: https://webrtc.googlesource.com/src/+/main/docs/faq.md The WebRTC [issue tracker][webrtc-issue-tracker] can be used for submitting bugs found in native code. @@ -35,8 +35,8 @@ bugs found in native code. * [iOS][webrtc-ios-development] * [Experimental RTP header extensions][rtp-hdrext] -[webrtc-prerequitite-sw]: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/development/prerequisite-sw/index.md -[webrtc-development]: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/development/index.md -[webtc-android-development]: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/android/index.md -[webrtc-ios-development]: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/ios/index.md -[rtp-hdrext]: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/rtp-hdrext/index.md +[webrtc-prerequitite-sw]: https://webrtc.googlesource.com/src/+/main/docs/native-code/development/prerequisite-sw/index.md +[webrtc-development]: https://webrtc.googlesource.com/src/+/main/docs/native-code/development/index.md +[webtc-android-development]: https://webrtc.googlesource.com/src/+/main/docs/native-code/android/index.md +[webrtc-ios-development]: https://webrtc.googlesource.com/src/+/main/docs/native-code/ios/index.md +[rtp-hdrext]: https://webrtc.googlesource.com/src/+/main/docs/native-code/rtp-hdrext/index.md diff --git a/docs/native-code/ios/index.md b/docs/native-code/ios/index.md index e2f6c3dfd6..d04692714e 100644 --- a/docs/native-code/ios/index.md +++ b/docs/native-code/ios/index.md @@ -185,9 +185,9 @@ For instructions on how to do this see [here][strip-arch]. [cocoapods]: https://cocoapods.org/pods/GoogleWebRTC -[webrtc-prerequisite-sw]: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/development/prerequisite-sw/index.md -[webrtc-development]: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/development/index.md -[framework-script]: https://chromium.googlesource.com/external/webrtc/+/master/tools_webrtc/ios/build_ios_libs.py +[webrtc-prerequisite-sw]: https://webrtc.googlesource.com/src/+/main/docs/native-code/development/prerequisite-sw/index.md +[webrtc-development]: https://webrtc.googlesource.com/src/+/main/docs/native-code/development/index.md +[framework-script]: https://webrtc.googlesource.com/src/+/main/tools_webrtc/ios/build_ios_libs.py [ninja]: https://ninja-build.org/ [gn]: https://gn.googlesource.com/gn/+/master/README.md [ios-deploy]: https://github.com/phonegap/ios-deploy diff --git a/g3doc/how_to_write_documentation.md b/g3doc/how_to_write_documentation.md index 6fbca116a5..a29d686e66 100644 --- a/g3doc/how_to_write_documentation.md +++ b/g3doc/how_to_write_documentation.md @@ -67,6 +67,5 @@ The documentation is written in GitHub Markdown Documentation of specific classes and function APIs and their usage, including their purpose, is embedded in the .h files defining that API. See -[C++ style guide](https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++.md) +[C++ style guide](https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++.md) for pointers on how to write API documentatin in .h files. - diff --git a/g3doc/style-guide.md b/g3doc/style-guide.md index f3b0e8869d..e6195d7249 100644 --- a/g3doc/style-guide.md +++ b/g3doc/style-guide.md @@ -20,7 +20,7 @@ WebRTC follows the [Chromium C++ style guide][chr-style] and the style guide trumps the Google style guide, and the rules in this file trump them both. -[chr-style]: https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/c++/c++.md +[chr-style]: https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++.md [goog-style]: https://google.github.io/styleguide/cppguide.html ### C++ version @@ -197,13 +197,13 @@ WebRTC follows the [Google Java style guide][goog-java-style]. WebRTC follows the [Chromium Objective-C and Objective-C++ style guide][chr-objc-style]. -[chr-objc-style]: https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/objective-c/objective-c.md +[chr-objc-style]: https://chromium.googlesource.com/chromium/src/+/main/styleguide/objective-c/objective-c.md ## Python WebRTC follows [Chromium's Python style][chr-py-style]. -[chr-py-style]: https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/python/python.md +[chr-py-style]: https://chromium.googlesource.com/chromium/src/+/main/styleguide/python/python.md ## Build files diff --git a/modules/audio_device/g3doc/audio_device_module.md b/modules/audio_device/g3doc/audio_device_module.md index 3aa1a59d08..fb88b6971a 100644 --- a/modules/audio_device/g3doc/audio_device_module.md +++ b/modules/audio_device/g3doc/audio_device_module.md @@ -53,7 +53,7 @@ The most up-to-date implementations of the ADM interface are for [iOS][27] and for [Android][28]. Desktop version are not updated to comply with the latest -[C++ style guide](https://chromium.googlesource.com/chromium/src/+/master/styleguide/c++/c++.md) +[C++ style guide](https://chromium.googlesource.com/chromium/src/+/main/styleguide/c++/c++.md) and more work is also needed to improve the performance and stability of these versions. diff --git a/native-api.md b/native-api.md index a9893c37cd..53e6b1cc93 100644 --- a/native-api.md +++ b/native-api.md @@ -91,7 +91,7 @@ You can achieve this by defining the preprocessor macro argument `rtc_exclude_field_trial_default` to true and GN will define the macro for you. -[field_trial_h]: https://webrtc.googlesource.com/src/+/master/system_wrappers/include/field_trial.h +[field_trial_h]: https://webrtc.googlesource.com/src/+/main/system_wrappers/include/field_trial.h ## `WEBRTC_EXCLUDE_METRICS_DEFAULT` If you want to provide your own implementation of `webrtc::metrics` functions @@ -103,7 +103,7 @@ You can achieve this by defining the preprocessor macro argument `rtc_exclude_metrics_default` to true and GN will define the macro for you. -[metrics_h]: https://webrtc.googlesource.com/src/+/master/system_wrappers/include/metrics.h +[metrics_h]: https://webrtc.googlesource.com/src/+/main/system_wrappers/include/metrics.h ## `WEBRTC_EXCLUDE_TRANSIENT_SUPPRESSOR` The transient suppressor functionality in the audio processing module is not diff --git a/webrtc.gni b/webrtc.gni index c0ff14fe51..a338d723ed 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -23,7 +23,7 @@ if (!build_with_chromium && is_component_build) { "WebRTC static library, so there is no difference between " + "`is_component_build=true` and `is_component_build=false`.") print( - "More info about component builds at: " + "https://chromium.googlesource.com/chromium/src/+/master/docs/component_build.md") + "More info about component builds at: " + "https://chromium.googlesource.com/chromium/src/+/main/docs/component_build.md") assert(!is_component_build, "Component builds are not supported in WebRTC.") } From 3097008de03b6260da5cfabb5cbac6f6a64ca810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Spr=C3=A5ng?= Date: Thu, 15 Jul 2021 11:29:30 +0200 Subject: [PATCH 0013/1565] Rename vp9::FrameInfo to vp9::UncompressedHeader and add more fields. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These fields will be used for bitstream validation in upcoming CLs. A new vp9_constants.h file is also added, containing common constants defined by the bitstream spec. Bug: webrtc:12354 Change-Id: If04256d83409069c8bee43ad41aed41c3707dfd3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226060 Commit-Queue: Erik Språng Reviewed-by: Philip Eliasson Cr-Commit-Position: refs/heads/master@{#34476} --- modules/video_coding/BUILD.gn | 1 + .../codecs/vp9/libvpx_vp9_decoder.cc | 4 +- modules/video_coding/utility/vp9_constants.h | 200 +++++++++ .../utility/vp9_uncompressed_header_parser.cc | 391 ++++++++++++++---- .../utility/vp9_uncompressed_header_parser.h | 83 +++- ...vp9_uncompressed_header_parser_unittest.cc | 46 ++- 6 files changed, 631 insertions(+), 94 deletions(-) create mode 100644 modules/video_coding/utility/vp9_constants.h diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index 50f2e8d836..5154b51933 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -334,6 +334,7 @@ rtc_library("video_coding_utility") { "utility/simulcast_utility.h", "utility/vp8_header_parser.cc", "utility/vp8_header_parser.h", + "utility/vp9_constants.h", "utility/vp9_uncompressed_header_parser.cc", "utility/vp9_uncompressed_header_parser.h", ] diff --git a/modules/video_coding/codecs/vp9/libvpx_vp9_decoder.cc b/modules/video_coding/codecs/vp9/libvpx_vp9_decoder.cc index 3500ef5919..d10d8d10d8 100644 --- a/modules/video_coding/codecs/vp9/libvpx_vp9_decoder.cc +++ b/modules/video_coding/codecs/vp9/libvpx_vp9_decoder.cc @@ -206,8 +206,8 @@ int LibvpxVp9Decoder::Decode(const EncodedImage& input_image, } if (input_image._frameType == VideoFrameType::kVideoFrameKey) { - absl::optional frame_info = - vp9::ParseIntraFrameInfo(input_image.data(), input_image.size()); + absl::optional frame_info = + vp9::ParseUncompressedHeader(input_image.data(), input_image.size()); if (frame_info) { if (frame_info->frame_width != current_codec_.width || frame_info->frame_height != current_codec_.height) { diff --git a/modules/video_coding/utility/vp9_constants.h b/modules/video_coding/utility/vp9_constants.h new file mode 100644 index 0000000000..999e780cb7 --- /dev/null +++ b/modules/video_coding/utility/vp9_constants.h @@ -0,0 +1,200 @@ +/* + * Copyright (c) 2021 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef MODULES_VIDEO_CODING_UTILITY_VP9_CONSTANTS_H_ +#define MODULES_VIDEO_CODING_UTILITY_VP9_CONSTANTS_H_ + +#include +#include + +#include + +namespace webrtc { +namespace vp9 { + +// Number of frames that can be stored for future reference. +static constexpr size_t kNumRefFrames = 8; +// Number of frame contexts that can be store for future reference. +static constexpr size_t kNumFrameContexts = 4; +// Each inter frame can use up to 3 frames for reference. +constexpr size_t kRefsPerFrame = 3; +// Number of values that can be decoded for mv_fr. +constexpr size_t kMvFrSize = 4; +// Number of positions to search in motion vector prediction. +constexpr size_t kMvrefNeighbours = 8; +// Number of contexts when decoding intra_mode . +constexpr size_t kBlockSizeGroups = 4; +// Number of different block sizes used. +constexpr size_t kBlockSizes = 13; +// Sentinel value to mark partition choices that are illegal. +constexpr size_t kBlockInvalid = 14; +// Number of contexts when decoding partition. +constexpr size_t kPartitionContexts = 16; +// Smallest size of a mode info block. +constexpr size_t kMiSize = 8; +// Minimum width of a tile in units of superblocks (although tiles on +// the right hand edge can be narrower). +constexpr size_t kMinTileWidth_B64 = 4; +// Maximum width of a tile in units of superblocks. +constexpr size_t kMaxTileWidth_B64 = 64; +// Number of motion vectors returned by find_mv_refs process. +constexpr size_t kMaxMvRefCandidates = 2; +// Number of values that can be derived for ref_frame. +constexpr size_t kMaxRefFrames = 4; +// Number of contexts for is_inter. +constexpr size_t kIsInterContexts = 4; +// Number of contexts for comp_mode. +constexpr size_t kCompModeContexts = 5; +// Number of contexts for single_ref and comp_ref. +constexpr size_t kRefContexts = 5; +// Number of segments allowed in segmentation map. +constexpr size_t kMaxSegments = 8; +// Index for quantizer segment feature. +constexpr size_t kSegLvlAlt_Q = 0; +// Index for loop filter segment feature. +constexpr size_t kSegLvlAlt_L = 1; +// Index for reference frame segment feature. +constexpr size_t kSegLvlRefFrame = 2; +// Index for skip segment feature. +constexpr size_t kSegLvlSkip = 3; +// Number of segment features. +constexpr size_t kSegLvlMax = 4; +// Number of different plane types (Y or UV). +constexpr size_t kBlockTypes = 2; +// Number of different prediction types (intra or inter). +constexpr size_t kRefTypes = 2; +// Number of coefficient bands. +constexpr size_t kCoefBands = 6; +// Number of contexts for decoding coefficients. +constexpr size_t kPrevCoefContexts = 6; +// Number of coefficient probabilities that are directly transmitted. +constexpr size_t kUnconstrainedNodes = 3; +// Number of contexts for transform size. +constexpr size_t kTxSizeContexts = 2; +// Number of values for interp_filter. +constexpr size_t kSwitchableFilters = 3; +// Number of contexts for interp_filter. +constexpr size_t kInterpFilterContexts = 4; +// Number of contexts for decoding skip. +constexpr size_t kSkipContexts = 3; +// Number of values for partition. +constexpr size_t kPartitionTypes = 4; +// Number of values for tx_size. +constexpr size_t kTxSizes = 4; +// Number of values for tx_mode. +constexpr size_t kTxModes = 5; +// Inverse transform rows with DCT and columns with DCT. +constexpr size_t kDctDct = 0; +// Inverse transform rows with DCT and columns with ADST. +constexpr size_t kAdstDct = 1; +// Inverse transform rows with ADST and columns with DCT. +constexpr size_t kDctAdst = 2; +// Inverse transform rows with ADST and columns with ADST. +constexpr size_t kAdstAdst = 3; +// Number of values for y_mode. +constexpr size_t kMbModeCount = 14; +// Number of values for intra_mode. +constexpr size_t kIntraModes = 10; +// Number of values for inter_mode. +constexpr size_t kInterModes = 4; +// Number of contexts for inter_mode. +constexpr size_t kInterModeContexts = 7; +// Number of values for mv_joint. +constexpr size_t kMvJoints = 4; +// Number of values for mv_class. +constexpr size_t kMvClasses = 11; +// Number of values for mv_class0_bit. +constexpr size_t kClass0Size = 2; +// Maximum number of bits for decoding motion vectors. +constexpr size_t kMvOffsetBits = 10; +// Number of values allowed for a probability adjustment. +constexpr size_t kMaxProb = 255; +// Number of different mode types for loop filtering. +constexpr size_t kMaxModeLfDeltas = 2; +// Threshold at which motion vectors are considered large. +constexpr size_t kCompandedMvrefThresh = 8; +// Maximum value used for loop filtering. +constexpr size_t kMaxLoopFilter = 63; +// Number of bits of precision when scaling reference frames. +constexpr size_t kRefScaleShift = 14; +// Number of bits of precision when performing inter prediction. +constexpr size_t kSubpelBits = 4; +// 1 << kSubpelBits. +constexpr size_t kSubpelShifts = 16; +// kSubpelShifts - 1. +constexpr size_t kSubpelMask = 15; +// Value used when clipping motion vectors. +constexpr size_t kMvBorder = 128; +// Value used when clipping motion vectors. +constexpr size_t kInterpExtend = 4; +// Value used when clipping motion vectors. +constexpr size_t kBorderinpixels = 160; +// Value used in adapting probabilities. +constexpr size_t kMaxUpdateFactor = 128; +// Value used in adapting probabilities. +constexpr size_t kCountSat = 20; +// Both candidates use ZEROMV. +constexpr size_t kBothZero = 0; +// One candidate uses ZEROMV, one uses NEARMV or NEARESTMV. +constexpr size_t kZeroPlusPredicted = 1; +// Both candidates use NEARMV or NEARESTMV. +constexpr size_t kBothPredicted = 2; +// One candidate uses NEWMV, one uses ZEROMV. +constexpr size_t kNewPlusNonIntra = 3; +// Both candidates use NEWMV. +constexpr size_t kBothNew = 4; +// One candidate uses intra prediction, one uses inter prediction. +constexpr size_t kIntraPlusNonIntra = 5; +// Both candidates use intra prediction. +constexpr size_t kBothIntra = 6; +// Sentinel value marking a case that can never occur. +constexpr size_t kInvalidCase = 9; + +enum class TxMode : uint8_t { + kOnly4X4 = 0, + kAllow8X8 = 1, + kAllow16x16 = 2, + kAllow32x32 = 3, + kTxModeSelect = 4 +}; + +enum BlockSize : uint8_t { + kBlock4X4 = 0, + kBlock4X8 = 1, + kBlock8X4 = 2, + kBlock8X8 = 3, + kBlock8X16 = 4, + kBlock16X8 = 5, + kBlock16X16 = 6, + kBlock16X32 = 7, + kBlock32X16 = 8, + kBlock32X32 = 9, + kBlock32X64 = 10, + kBlock64X32 = 11, + kBlock64X64 = 12 +}; + +enum Partition : uint8_t { + kPartitionNone = 0, + kPartitionHorizontal = 1, + kPartitionVertical = 2, + kPartitionSplit = 3 +}; + +enum class ReferenceMode : uint8_t { + kSingleReference = 0, + kCompoundReference = 1, + kReferenceModeSelect = 2, +}; + +} // namespace vp9 +} // namespace webrtc + +#endif // MODULES_VIDEO_CODING_UTILITY_VP9_CONSTANTS_H_ diff --git a/modules/video_coding/utility/vp9_uncompressed_header_parser.cc b/modules/video_coding/utility/vp9_uncompressed_header_parser.cc index 07ba3255c6..7fbdd58951 100644 --- a/modules/video_coding/utility/vp9_uncompressed_header_parser.cc +++ b/modules/video_coding/utility/vp9_uncompressed_header_parser.cc @@ -12,6 +12,7 @@ #include "absl/strings/string_view.h" #include "rtc_base/bit_buffer.h" #include "rtc_base/logging.h" +#include "rtc_base/strings/string_builder.h" namespace webrtc { @@ -152,11 +153,15 @@ class BitstreamReader { // Returns true if full number of bits were read, false otherwise. bool ConsumeBits(int bits) { return buffer_->ConsumeBits(bits); } + void GetPosition(size_t* out_byte_offset, size_t* out_bit_offset) const { + buffer_->GetCurrentOffset(out_byte_offset, out_bit_offset); + } + private: rtc::BitBuffer* buffer_; }; -bool Vp9ReadColorConfig(BitstreamReader* br, FrameInfo* frame_info) { +bool Vp9ReadColorConfig(BitstreamReader* br, UncompressedHeader* frame_info) { if (frame_info->profile == 2 || frame_info->profile == 3) { READ_OR_RETURN(br->ReadBoolean(), [frame_info](bool ten_or_twelve_bits) { frame_info->bit_detph = @@ -219,7 +224,18 @@ bool Vp9ReadColorConfig(BitstreamReader* br, FrameInfo* frame_info) { return true; } -bool Vp9ReadFrameSize(BitstreamReader* br, FrameInfo* frame_info) { +bool ReadRefreshFrameFlags(BitstreamReader* br, + UncompressedHeader* frame_info) { + // Refresh frame flags. + READ_OR_RETURN(br->ReadUnsigned(), [frame_info](uint8_t flags) { + for (int i = 0; i < 8; ++i) { + frame_info->updated_buffers.set(i, (flags & (0x01 << (7 - i))) != 0); + } + }); + return true; +} + +bool Vp9ReadFrameSize(BitstreamReader* br, UncompressedHeader* frame_info) { // 16 bits: frame (width|height) - 1. READ_OR_RETURN(br->ReadUnsigned(), [frame_info](uint16_t width) { frame_info->frame_width = width + 1; @@ -230,10 +246,12 @@ bool Vp9ReadFrameSize(BitstreamReader* br, FrameInfo* frame_info) { return true; } -bool Vp9ReadRenderSize(BitstreamReader* br, FrameInfo* frame_info) { +bool Vp9ReadRenderSize(BitstreamReader* br, UncompressedHeader* frame_info) { // render_and_frame_size_different return br->IfNextBoolean( [&] { + auto& pos = frame_info->render_size_position.emplace(); + br->GetPosition(&pos.byte_offset, &pos.bit_offset); // 16 bits: render (width|height) - 1. READ_OR_RETURN(br->ReadUnsigned(), [frame_info](uint16_t width) { @@ -253,11 +271,16 @@ bool Vp9ReadRenderSize(BitstreamReader* br, FrameInfo* frame_info) { }); } -bool Vp9ReadFrameSizeFromRefs(BitstreamReader* br, FrameInfo* frame_info) { +bool Vp9ReadFrameSizeFromRefs(BitstreamReader* br, + UncompressedHeader* frame_info) { bool found_ref = false; for (size_t i = 0; !found_ref && i < kVp9NumRefsPerFrame; i++) { // Size in refs. - READ_OR_RETURN(br->ReadBoolean(), [&](bool ref) { found_ref = ref; }); + br->IfNextBoolean([&] { + frame_info->infer_size_from_reference = frame_info->reference_buffers[i]; + found_ref = true; + return true; + }); } if (!found_ref) { @@ -286,58 +309,104 @@ bool Vp9ReadLoopfilter(BitstreamReader* br) { }); } -bool Vp9ReadQp(BitstreamReader* br, FrameInfo* frame_info) { +bool Vp9ReadQp(BitstreamReader* br, UncompressedHeader* frame_info) { READ_OR_RETURN(br->ReadUnsigned(), [frame_info](uint8_t qp) { frame_info->base_qp = qp; }); // yuv offsets + frame_info->is_lossless = frame_info->base_qp == 0; for (int i = 0; i < 3; ++i) { - RETURN_IF_FALSE(br->IfNextBoolean([br] { // if delta_coded - return br->ConsumeBits(5); + RETURN_IF_FALSE(br->IfNextBoolean([&] { // if delta_coded + READ_OR_RETURN(br->ReadUnsigned(4), [&](int delta) { + if (delta != 0) { + frame_info->is_lossless = false; + } + }); + return true; })); } return true; } -bool Vp9ReadSegmentationParams(BitstreamReader* br) { - constexpr int kVp9MaxSegments = 8; - constexpr int kVp9SegLvlMax = 4; - constexpr int kSegmentationFeatureBits[kVp9SegLvlMax] = {8, 6, 2, 0}; - constexpr bool kSegmentationFeatureSigned[kVp9SegLvlMax] = {1, 1, 0, 0}; +bool Vp9ReadSegmentationParams(BitstreamReader* br, + UncompressedHeader* frame_info) { + constexpr int kSegmentationFeatureBits[kSegLvlMax] = {8, 6, 2, 0}; + constexpr bool kSegmentationFeatureSigned[kSegLvlMax] = {1, 1, 0, 0}; - RETURN_IF_FALSE(br->IfNextBoolean([&] { // segmentation_enabled - return br->IfNextBoolean([&] { // update_map - // Consume probs. + return br->IfNextBoolean([&] { // segmentation_enabled + frame_info->segmentation_enabled = true; + RETURN_IF_FALSE(br->IfNextBoolean([&] { // update_map + frame_info->segmentation_tree_probs.emplace(); for (int i = 0; i < 7; ++i) { - RETURN_IF_FALSE(br->IfNextBoolean([br] { return br->ConsumeBits(7); })); + RETURN_IF_FALSE(br->IfNextBoolean( + [&] { + READ_OR_RETURN(br->ReadUnsigned(), [&](uint8_t prob) { + (*frame_info->segmentation_tree_probs)[i] = prob; + }); + return true; + }, + [&] { + (*frame_info->segmentation_tree_probs)[i] = 255; + return true; + })); } - return br->IfNextBoolean([&] { // temporal_update - // Consume probs. - for (int i = 0; i < 3; ++i) { - RETURN_IF_FALSE( - br->IfNextBoolean([br] { return br->ConsumeBits(7); })); - } - return true; - }); - }); - })); + // temporal_update + return br->IfNextBoolean( + [&] { + frame_info->segmentation_pred_prob.emplace(); + for (int i = 0; i < 3; ++i) { + RETURN_IF_FALSE(br->IfNextBoolean( + [&] { + READ_OR_RETURN( + br->ReadUnsigned(), [&](uint8_t prob) { + (*frame_info->segmentation_pred_prob)[i] = prob; + }); + return true; + }, + [&] { + (*frame_info->segmentation_pred_prob)[i] = 255; + return true; + })); + } + return true; + }, + [&] { + frame_info->segmentation_pred_prob->fill(255); + return true; + }); + })); - return br->IfNextBoolean([&] { - RETURN_IF_FALSE(br->ConsumeBits(1)); // abs_or_delta - for (int i = 0; i < kVp9MaxSegments; ++i) { - for (int j = 0; j < kVp9SegLvlMax; ++j) { - RETURN_IF_FALSE(br->IfNextBoolean([&] { // feature_enabled - return br->ConsumeBits(kSegmentationFeatureBits[j] + - kSegmentationFeatureSigned[j]); - })); + return br->IfNextBoolean([&] { // segmentation_update_data + RETURN_IF_FALSE(br->IfNextBoolean([&] { + frame_info->segmentation_is_delta = true; + return true; + })); + + for (size_t i = 0; i < kMaxSegments; ++i) { + for (size_t j = 0; j < kSegLvlMax; ++j) { + RETURN_IF_FALSE(br->IfNextBoolean([&] { // feature_enabled + READ_OR_RETURN( + br->ReadUnsigned(kSegmentationFeatureBits[j]), + [&](uint8_t feature_value) { + frame_info->segmentation_features[i][j] = feature_value; + }); + if (kSegmentationFeatureSigned[j]) { + RETURN_IF_FALSE(br->IfNextBoolean([&] { + (*frame_info->segmentation_features[i][j]) *= -1; + return true; + })); + } + return true; + })); + } } - } - return true; + return true; + }); }); } -bool Vp9ReadTileInfo(BitstreamReader* br, FrameInfo* frame_info) { +bool Vp9ReadTileInfo(BitstreamReader* br, UncompressedHeader* frame_info) { size_t mi_cols = (frame_info->frame_width + 7) >> 3; size_t sb64_cols = (mi_cols + 7) >> 3; @@ -352,12 +421,12 @@ bool Vp9ReadTileInfo(BitstreamReader* br, FrameInfo* frame_info) { } --max_log2; - size_t cols_log2 = min_log2; + frame_info->tile_cols_log2 = min_log2; bool done = false; - while (!done && cols_log2 < max_log2) { + while (!done && frame_info->tile_cols_log2 < max_log2) { RETURN_IF_FALSE(br->IfNextBoolean( [&] { - ++cols_log2; + ++frame_info->tile_cols_log2; return true; }, [&] { @@ -365,13 +434,157 @@ bool Vp9ReadTileInfo(BitstreamReader* br, FrameInfo* frame_info) { return true; })); } - - // rows_log2; - return br->IfNextBoolean([&] { return br->ConsumeBits(1); }); + frame_info->tile_rows_log2 = 0; + RETURN_IF_FALSE(br->IfNextBoolean([&] { + ++frame_info->tile_rows_log2; + return br->IfNextBoolean([&] { + ++frame_info->tile_rows_log2; + return true; + }); + })); + return true; } + +const InterpolationFilter kLiteralToType[4] = { + InterpolationFilter::kEightTapSmooth, InterpolationFilter::kEightTap, + InterpolationFilter::kEightTapSharp, InterpolationFilter::kBilinear}; } // namespace -bool Parse(const uint8_t* buf, size_t length, FrameInfo* frame_info) { +std::string UncompressedHeader::ToString() const { + char buf[1024]; + rtc::SimpleStringBuilder oss(buf); + + oss << "Vp9UncompressedHeader { " + << "profile = " << profile; + + if (show_existing_frame) { + oss << ", show_existing_frame = " << *show_existing_frame << " }"; + return oss.str(); + } + + oss << ", frame type = " << (is_keyframe ? "key" : "delta") + << ", show_frame = " << (show_frame ? "true" : "false") + << ", error_resilient = " << (error_resilient ? "true" : "false"); + + oss << ", bit_depth = "; + switch (bit_detph) { + case BitDept::k8Bit: + oss << "8bit"; + break; + case BitDept::k10Bit: + oss << "10bit"; + break; + case BitDept::k12Bit: + oss << "12bit"; + break; + } + + if (color_space) { + oss << ", color_space = "; + switch (*color_space) { + case ColorSpace::CS_UNKNOWN: + oss << "unknown"; + break; + case ColorSpace::CS_BT_601: + oss << "CS_BT_601 Rec. ITU-R BT.601-7"; + break; + case ColorSpace::CS_BT_709: + oss << "Rec. ITU-R BT.709-6"; + break; + case ColorSpace::CS_SMPTE_170: + oss << "SMPTE-170"; + break; + case ColorSpace::CS_SMPTE_240: + oss << "SMPTE-240"; + break; + case ColorSpace::CS_BT_2020: + oss << "Rec. ITU-R BT.2020-2"; + break; + case ColorSpace::CS_RESERVED: + oss << "Reserved"; + break; + case ColorSpace::CS_RGB: + oss << "sRGB (IEC 61966-2-1)"; + break; + } + } + + if (color_range) { + oss << ", color_range = "; + switch (*color_range) { + case ColorRange::kFull: + oss << "full"; + break; + case ColorRange::kStudio: + oss << "studio"; + break; + } + } + + if (sub_sampling) { + oss << ", sub_sampling = "; + switch (*sub_sampling) { + case YuvSubsampling::k444: + oss << "444"; + break; + case YuvSubsampling::k440: + oss << "440"; + break; + case YuvSubsampling::k422: + oss << "422"; + break; + case YuvSubsampling::k420: + oss << "420"; + break; + } + } + + if (infer_size_from_reference) { + oss << ", infer_frame_resolution_from = " << *infer_size_from_reference; + } else { + oss << ", frame_width = " << frame_width + << ", frame_height = " << frame_height; + } + if (render_width != 0 && render_height != 0) { + oss << ", render_width = " << render_width + << ", render_height = " << render_height; + } + + oss << ", base qp = " << base_qp; + if (reference_buffers[0] != -1) { + oss << ", last_buffer = " << reference_buffers[0]; + } + if (reference_buffers[1] != -1) { + oss << ", golden_buffer = " << reference_buffers[1]; + } + if (reference_buffers[2] != -1) { + oss << ", altref_buffer = " << reference_buffers[2]; + } + + oss << ", updated buffers = { "; + bool first = true; + for (int i = 0; i < 8; ++i) { + if (updated_buffers.test(i)) { + if (first) { + first = false; + } else { + oss << ", "; + } + oss << i; + } + } + oss << " }"; + + oss << ", compressed_header_size_bytes = " << compressed_header_size; + + oss << " }"; + return oss.str(); +} + +bool Parse(const uint8_t* buf, + size_t length, + UncompressedHeader* frame_info, + bool qp_only) { rtc::BitBuffer bit_buffer(buf, length); BitstreamReader br(&bit_buffer); @@ -423,6 +636,9 @@ bool Parse(const uint8_t* buf, size_t length, FrameInfo* frame_info) { return false; if (!Vp9ReadRenderSize(&br, frame_info)) return false; + + // Key-frames implicitly update all buffers. + frame_info->updated_buffers.set(); } else { // Non-keyframe. bool is_intra_only = false; @@ -441,31 +657,49 @@ bool Parse(const uint8_t* buf, size_t length, FrameInfo* frame_info) { if (frame_info->profile > 0) { if (!Vp9ReadColorConfig(&br, frame_info)) return false; + } else { + frame_info->color_space = ColorSpace::CS_BT_601; + frame_info->sub_sampling = YuvSubsampling::k420; + frame_info->bit_detph = BitDept::k8Bit; } - // Refresh frame flags. - RETURN_IF_FALSE(br.ConsumeBits(8)); - if (!Vp9ReadFrameSize(&br, frame_info)) - return false; - if (!Vp9ReadRenderSize(&br, frame_info)) - return false; + frame_info->reference_buffers.fill(-1); + RETURN_IF_FALSE(ReadRefreshFrameFlags(&br, frame_info)); + RETURN_IF_FALSE(Vp9ReadFrameSize(&br, frame_info)); + RETURN_IF_FALSE(Vp9ReadRenderSize(&br, frame_info)); } else { - // Refresh frame flags. - RETURN_IF_FALSE(br.ConsumeBits(8)); + RETURN_IF_FALSE(ReadRefreshFrameFlags(&br, frame_info)); + frame_info->reference_buffers_sign_bias[0] = false; for (size_t i = 0; i < kVp9NumRefsPerFrame; i++) { - // 3 bits: Ref frame index. - // 1 bit: Ref frame sign biases. - RETURN_IF_FALSE(br.ConsumeBits(4)); + READ_OR_RETURN(br.ReadUnsigned(3), [&](uint8_t idx) { + frame_info->reference_buffers[i] = idx; + }); + READ_OR_RETURN(br.ReadBoolean(), [&](bool sign_bias) { + frame_info->reference_buffers_sign_bias[ReferenceFrame::kLast + i] = + sign_bias; + }); } if (!Vp9ReadFrameSizeFromRefs(&br, frame_info)) return false; - // Allow high precision mv. - RETURN_IF_FALSE(br.ConsumeBits(1)); + READ_OR_RETURN(br.ReadBoolean(), [&](bool allow_high_precision_mv) { + frame_info->allow_high_precision_mv = allow_high_precision_mv; + }); + // Interpolation filter. - RETURN_IF_FALSE(br.IfNextBoolean([] { return true; }, - [&br] { return br.ConsumeBits(2); })); + RETURN_IF_FALSE(br.IfNextBoolean( + [frame_info] { + frame_info->interpolation_filter = InterpolationFilter::kSwitchable; + return true; + }, + [&] { + READ_OR_RETURN( + br.ReadUnsigned(2), [frame_info](uint8_t filter) { + frame_info->interpolation_filter = kLiteralToType[filter]; + }); + return true; + })); } } @@ -476,7 +710,8 @@ bool Parse(const uint8_t* buf, size_t length, FrameInfo* frame_info) { } // Frame context index. - RETURN_IF_FALSE(br.ConsumeBits(2)); + READ_OR_RETURN(br.ReadUnsigned(2), + [&](uint8_t idx) { frame_info->frame_context_idx = idx; }); if (!Vp9ReadLoopfilter(&br)) return false; @@ -484,33 +719,39 @@ bool Parse(const uint8_t* buf, size_t length, FrameInfo* frame_info) { // Read base QP. RETURN_IF_FALSE(Vp9ReadQp(&br, frame_info)); - const bool kParseFullHeader = false; - if (kParseFullHeader) { - // Currently not used, but will be needed when parsing beyond the - // uncompressed header. - RETURN_IF_FALSE(Vp9ReadSegmentationParams(&br)); + if (qp_only) { + // Not interested in the rest of the header, return early. + return true; + } - RETURN_IF_FALSE(Vp9ReadTileInfo(&br, frame_info)); + RETURN_IF_FALSE(Vp9ReadSegmentationParams(&br, frame_info)); + RETURN_IF_FALSE(Vp9ReadTileInfo(&br, frame_info)); + READ_OR_RETURN(br.ReadUnsigned(), [frame_info](uint16_t size) { + frame_info->compressed_header_size = size; + }); - RETURN_IF_FALSE(br.ConsumeBits(16)); // header_size_in_bytes - } + // Trailing bits. + RETURN_IF_FALSE(br.ConsumeBits(bit_buffer.RemainingBitCount() % 8)); + frame_info->uncompressed_header_size = + length - (bit_buffer.RemainingBitCount() / 8); return true; } bool GetQp(const uint8_t* buf, size_t length, int* qp) { - FrameInfo frame_info; - if (!Parse(buf, length, &frame_info)) { + UncompressedHeader frame_info; + if (!Parse(buf, length, &frame_info, /*qp_only=*/true)) { return false; } *qp = frame_info.base_qp; return true; } -absl::optional ParseIntraFrameInfo(const uint8_t* buf, - size_t length) { - FrameInfo frame_info; - if (Parse(buf, length, &frame_info) && frame_info.frame_width > 0) { +absl::optional ParseUncompressedHeader(const uint8_t* buf, + size_t length) { + UncompressedHeader frame_info; + if (Parse(buf, length, &frame_info, /*qp_only=*/false) && + frame_info.frame_width > 0) { return frame_info; } return absl::nullopt; diff --git a/modules/video_coding/utility/vp9_uncompressed_header_parser.h b/modules/video_coding/utility/vp9_uncompressed_header_parser.h index 7a5e2c058b..67166e364b 100644 --- a/modules/video_coding/utility/vp9_uncompressed_header_parser.h +++ b/modules/video_coding/utility/vp9_uncompressed_header_parser.h @@ -13,7 +13,13 @@ #include #include + +#include +#include +#include + #include "absl/types/optional.h" +#include "modules/video_coding/utility/vp9_constants.h" namespace webrtc { @@ -63,27 +69,86 @@ enum class YuvSubsampling { k420, }; -struct FrameInfo { - int profile = 0; // Profile 0-3 are valid. +enum ReferenceFrame : int { + kNone = -1, + kIntra = 0, + kLast = 1, + kGolden = 2, + kAltref = 3, +}; + +enum class InterpolationFilter : uint8_t { + kEightTap = 0, + kEightTapSmooth = 1, + kEightTapSharp = 2, + kBilinear = 3, + kSwitchable = 4 +}; + +struct UncompressedHeader { + int profile = 0; // Profiles 0-3 are valid. absl::optional show_existing_frame; bool is_keyframe = false; bool show_frame = false; bool error_resilient = false; BitDept bit_detph = BitDept::k8Bit; - ColorSpace color_space = ColorSpace::CS_UNKNOWN; - ColorRange color_range; - YuvSubsampling sub_sampling; + absl::optional color_space; + absl::optional color_range; + absl::optional sub_sampling; int frame_width = 0; int frame_height = 0; int render_width = 0; int render_height = 0; + // Width/height of the tiles used (in units of 8x8 blocks). + size_t tile_cols_log2 = 0; // tile_cols = 1 << tile_cols_log2 + size_t tile_rows_log2 = 0; // tile_rows = 1 << tile_rows_log2 + struct BitstreamPosition { + size_t byte_offset = 0; + size_t bit_offset = 0; + }; + absl::optional render_size_position; + InterpolationFilter interpolation_filter = InterpolationFilter::kEightTap; + bool allow_high_precision_mv = false; int base_qp = 0; + bool is_lossless = false; + uint8_t frame_context_idx = 0; + + bool segmentation_enabled = false; + absl::optional> segmentation_tree_probs; + absl::optional> segmentation_pred_prob; + bool segmentation_is_delta = false; + absl::optional segmentation_features[kMaxSegments][kSegLvlMax]; + + // Which of the 8 reference buffers may be used as references for this frame. + // -1 indicates not used (e.g. {-1, -1, -1} for intra-only frames). + std::array reference_buffers = {-1, -1, -1}; + // Sign bias corresponding to reference buffers, where the index is a + // ReferenceFrame. + // false/0 indidate backwards reference, true/1 indicate forwards reference). + std::array reference_buffers_sign_bias = {false, false, + false, false}; + + // Indicates which reference buffer [0,7] to infer the frame size from. + absl::optional infer_size_from_reference; + // Which of the 8 reference buffers are updated by this frame. + std::bitset updated_buffers = 0; + + // Header sizes, in bytes. + uint32_t uncompressed_header_size = 0; + uint32_t compressed_header_size = 0; + + bool is_intra_only() const { + return reference_buffers[0] == -1 && reference_buffers[1] == -1 && + reference_buffers[2] == -1; + } + + std::string ToString() const; }; -// Parses frame information for a VP9 key-frame or all-intra frame from a -// bitstream. Returns nullopt on failure or if not a key-frame. -absl::optional ParseIntraFrameInfo(const uint8_t* buf, - size_t length); +// Parses the uncompressed header and populates (most) values in a +// UncompressedHeader struct. Returns nullopt on failure. +absl::optional ParseUncompressedHeader(const uint8_t* buf, + size_t length); } // namespace vp9 diff --git a/modules/video_coding/utility/vp9_uncompressed_header_parser_unittest.cc b/modules/video_coding/utility/vp9_uncompressed_header_parser_unittest.cc index b69b45d5c4..672becc9e3 100644 --- a/modules/video_coding/utility/vp9_uncompressed_header_parser_unittest.cc +++ b/modules/video_coding/utility/vp9_uncompressed_header_parser_unittest.cc @@ -15,6 +15,11 @@ namespace webrtc { namespace vp9 { +using ::testing::AllOf; +using ::testing::ElementsAreArray; +using ::testing::Eq; +using ::testing::Field; +using ::testing::Optional; TEST(Vp9UncompressedHeaderParserTest, FrameWithSegmentation) { // Uncompressed header from a frame generated with libvpx. @@ -26,21 +31,46 @@ TEST(Vp9UncompressedHeaderParserTest, FrameWithSegmentation) { 0x2e, 0x73, 0xb7, 0xee, 0x22, 0x06, 0x81, 0x82, 0xd4, 0xef, 0xc3, 0x58, 0x1f, 0x12, 0xd2, 0x7b, 0x28, 0x1f, 0x80, 0xfc, 0x07, 0xe0, 0x00, 0x00}; - absl::optional frame_info = - ParseIntraFrameInfo(kHeader, sizeof(kHeader)); - // Segmentation info is not actually populated in FrameInfo struct, but it - // needs to be parsed otherwise we end up on the wrong offset. The check for - // segmentation is thus that we have a valid return value. + absl::optional frame_info = + ParseUncompressedHeader(kHeader, sizeof(kHeader)); ASSERT_TRUE(frame_info.has_value()); - EXPECT_EQ(frame_info->is_keyframe, false); - EXPECT_EQ(frame_info->error_resilient, true); - EXPECT_EQ(frame_info->show_frame, true); + EXPECT_FALSE(frame_info->is_keyframe); + EXPECT_TRUE(frame_info->error_resilient); + EXPECT_TRUE(frame_info->show_frame); + EXPECT_FALSE(frame_info->show_existing_frame); EXPECT_EQ(frame_info->base_qp, 185); EXPECT_EQ(frame_info->frame_width, 320); EXPECT_EQ(frame_info->frame_height, 240); EXPECT_EQ(frame_info->render_width, 640); EXPECT_EQ(frame_info->render_height, 480); + EXPECT_TRUE(frame_info->allow_high_precision_mv); + EXPECT_EQ(frame_info->frame_context_idx, 0u); + EXPECT_EQ(frame_info->interpolation_filter, InterpolationFilter::kSwitchable); + EXPECT_EQ(frame_info->is_lossless, false); + EXPECT_EQ(frame_info->profile, 0); + EXPECT_THAT(frame_info->reference_buffers, ElementsAreArray({0, 0, 0})); + EXPECT_THAT(frame_info->reference_buffers_sign_bias, + ElementsAreArray({false, false, false, false})); + EXPECT_EQ(frame_info->updated_buffers, 0b10000000); + EXPECT_EQ(frame_info->tile_cols_log2, 0u); + EXPECT_EQ(frame_info->tile_rows_log2, 0u); + EXPECT_THAT( + frame_info->render_size_position, + ::testing::Optional(AllOf( + Field(&UncompressedHeader::BitstreamPosition::byte_offset, 8u), + Field(&UncompressedHeader::BitstreamPosition::bit_offset, 0u)))); + EXPECT_EQ(frame_info->compressed_header_size, 23u); + EXPECT_EQ(frame_info->uncompressed_header_size, 37u); + + EXPECT_TRUE(frame_info->segmentation_enabled); + EXPECT_FALSE(frame_info->segmentation_is_delta); + EXPECT_THAT(frame_info->segmentation_pred_prob, + Optional(ElementsAreArray({205, 1, 1}))); + EXPECT_THAT(frame_info->segmentation_tree_probs, + Optional(ElementsAreArray({255, 255, 128, 1, 128, 128, 128}))); + EXPECT_THAT(frame_info->segmentation_features[1][kSegLvlAlt_Q], Eq(-63)); + EXPECT_THAT(frame_info->segmentation_features[2][kSegLvlAlt_Q], Eq(-81)); } } // namespace vp9 From f48c3736e0078a990c4532f7d64a59b2528ab1c0 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Thu, 15 Jul 2021 14:39:43 +0200 Subject: [PATCH 0014/1565] Add ability to configure video codecs at peer level (PC level framework) Bug: b/192821182 Change-Id: Ic1b55028102fbd331f0fb6a3a8c758c311267cbc Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226220 Reviewed-by: Andrey Logvin Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34477} --- .../peerconnection_quality_test_fixture.h | 55 ++++++++++++------- test/pc/e2e/peer_configurer.cc | 26 ++++++--- test/pc/e2e/peer_configurer.h | 6 ++ test/pc/e2e/peer_connection_quality_test.cc | 19 ++++--- .../e2e/peer_connection_quality_test_params.h | 2 + test/pc/e2e/sdp/sdp_changer.cc | 24 ++++---- test/pc/e2e/sdp/sdp_changer.h | 17 +++--- 7 files changed, 91 insertions(+), 58 deletions(-) diff --git a/api/test/peerconnection_quality_test_fixture.h b/api/test/peerconnection_quality_test_fixture.h index 8717e8f73d..20d9c74efa 100644 --- a/api/test/peerconnection_quality_test_fixture.h +++ b/api/test/peerconnection_quality_test_fixture.h @@ -268,6 +268,27 @@ class PeerConnectionE2EQualityTestFixture { absl::optional sync_group; }; + struct VideoCodecConfig { + explicit VideoCodecConfig(std::string name) + : name(std::move(name)), required_params() {} + VideoCodecConfig(std::string name, + std::map required_params) + : name(std::move(name)), required_params(std::move(required_params)) {} + // Next two fields are used to specify concrete video codec, that should be + // used in the test. Video code will be negotiated in SDP during offer/ + // answer exchange. + // Video codec name. You can find valid names in + // media/base/media_constants.h + std::string name = cricket::kVp8CodecName; + // Map of parameters, that have to be specified on SDP codec. Each parameter + // is described by key and value. Codec parameters will match the specified + // map if and only if for each key from |required_params| there will be + // a parameter with name equal to this key and parameter value will be equal + // to the value from |required_params| for this key. + // If empty then only name will be used to match the codec. + std::map required_params; + }; + // This class is used to fully configure one peer inside the call. class PeerConfigurer { public: @@ -343,6 +364,14 @@ class PeerConnectionE2EQualityTestFixture { // applied to all summed RTP streams for this peer. virtual PeerConfigurer* SetBitrateSettings( BitrateSettings bitrate_settings) = 0; + // Set the list of video codecs used by the peer during the test. These + // codecs will be negotiated in SDP during offer/answer exchange. The order + // of these codecs during negotiation will be the same as in |video_codecs|. + // Codecs have to be available in codecs list provided by peer connection to + // be negotiated. If some of specified codecs won't be found, the test will + // crash. + virtual PeerConfigurer* SetVideoCodecs( + std::vector video_codecs) = 0; }; // Contains configuration for echo emulator. @@ -352,27 +381,6 @@ class PeerConnectionE2EQualityTestFixture { TimeDelta echo_delay = TimeDelta::Millis(50); }; - struct VideoCodecConfig { - explicit VideoCodecConfig(std::string name) - : name(std::move(name)), required_params() {} - VideoCodecConfig(std::string name, - std::map required_params) - : name(std::move(name)), required_params(std::move(required_params)) {} - // Next two fields are used to specify concrete video codec, that should be - // used in the test. Video code will be negotiated in SDP during offer/ - // answer exchange. - // Video codec name. You can find valid names in - // media/base/media_constants.h - std::string name = cricket::kVp8CodecName; - // Map of parameters, that have to be specified on SDP codec. Each parameter - // is described by key and value. Codec parameters will match the specified - // map if and only if for each key from |required_params| there will be - // a parameter with name equal to this key and parameter value will be equal - // to the value from |required_params| for this key. - // If empty then only name will be used to match the codec. - std::map required_params; - }; - // Contains parameters, that describe how long framework should run quality // test. struct RunParams { @@ -383,6 +391,11 @@ class PeerConnectionE2EQualityTestFixture { // it will be shut downed. TimeDelta run_duration; + // DEPRECATED: Instead of setting the codecs in RunParams (which apply to + // all the participants in the call, please set them with + // PeerConfigurer, this will allow more flexibility and let + // different Peers support different codecs. + // // List of video codecs to use during the test. These codecs will be // negotiated in SDP during offer/answer exchange. The order of these codecs // during negotiation will be the same as in |video_codecs|. Codecs have diff --git a/test/pc/e2e/peer_configurer.cc b/test/pc/e2e/peer_configurer.cc index 18570c2c6b..caf29eb992 100644 --- a/test/pc/e2e/peer_configurer.cc +++ b/test/pc/e2e/peer_configurer.cc @@ -90,11 +90,22 @@ void SetDefaultValuesForMissingParams( *p->name + "_auto_audio_stream_label_"); audio_stream_names_provider.MaybeSetName(&p->audio_config->stream_label); } - } - if (run_params->video_codecs.empty()) { - run_params->video_codecs.push_back( - VideoCodecConfig(cricket::kVp8CodecName)); + if (p->video_codecs.empty()) { + // TODO(mbonadei): Remove the usage of RunParams to set codecs, this is + // only needed for backwards compatibility. + if (!run_params->video_codecs.empty()) { + p->video_codecs = run_params->video_codecs; + } else { + p->video_codecs.push_back( + PeerConnectionE2EQualityTestFixture::VideoCodecConfig( + cricket::kVp8CodecName)); + } + } else { + RTC_CHECK(run_params->video_codecs.empty()) + << "Setting video_codecs in both PeerConfigurer and RunParams is not " + "supported."; + } } } @@ -102,7 +113,6 @@ void ValidateParams( const RunParams& run_params, const std::vector>& peers) { RTC_CHECK_GT(run_params.video_encoder_bitrate_multiplier, 0.0); - RTC_CHECK_GE(run_params.video_codecs.size(), 1); std::set peer_names; std::set video_labels; @@ -113,6 +123,8 @@ void ValidateParams( for (size_t i = 0; i < peers.size(); ++i) { Params* p = peers[i]->params(); + // Each peer should at least support 1 video codec. + RTC_CHECK_GE(p->video_codecs.size(), 1); { RTC_CHECK(p->name); @@ -160,14 +172,14 @@ void ValidateParams( RTC_CHECK_LT(*video_config.simulcast_config->target_spatial_index, video_config.simulcast_config->simulcast_streams_count); } - RTC_CHECK_EQ(run_params.video_codecs.size(), 1) + RTC_CHECK_EQ(p->video_codecs.size(), 1) << "Only 1 video codec is supported when simulcast is enabled in " << "at least 1 video config"; RTC_CHECK(!video_config.max_encode_bitrate_bps) << "Setting max encode bitrate is not implemented for simulcast."; RTC_CHECK(!video_config.min_encode_bitrate_bps) << "Setting min encode bitrate is not implemented for simulcast."; - if (run_params.video_codecs[0].name == cricket::kVp8CodecName && + if (p->video_codecs[0].name == cricket::kVp8CodecName && !video_config.simulcast_config->encoding_params.empty()) { RTC_CHECK_EQ(video_config.simulcast_config->simulcast_streams_count, video_config.simulcast_config->encoding_params.size()) diff --git a/test/pc/e2e/peer_configurer.h b/test/pc/e2e/peer_configurer.h index 422d3d7341..bacfb7a295 100644 --- a/test/pc/e2e/peer_configurer.h +++ b/test/pc/e2e/peer_configurer.h @@ -168,6 +168,12 @@ class PeerConfigurerImpl final params_->bitrate_settings = bitrate_settings; return this; } + PeerConfigurer* SetVideoCodecs( + std::vector + video_codecs) override { + params_->video_codecs = std::move(video_codecs); + return this; + } PeerConfigurer* SetIceTransportFactory( std::unique_ptr factory) override { diff --git a/test/pc/e2e/peer_connection_quality_test.cc b/test/pc/e2e/peer_connection_quality_test.cc index 38a9ebf801..6fbfd37eac 100644 --- a/test/pc/e2e/peer_connection_quality_test.cc +++ b/test/pc/e2e/peer_connection_quality_test.cc @@ -444,8 +444,9 @@ void PeerConnectionE2EQualityTest::SetupCallOnSignalingThread( RtpTransceiverInit transceiver_params; if (video_config.simulcast_config) { transceiver_params.direction = RtpTransceiverDirection::kSendOnly; - // Because simulcast enabled |run_params.video_codecs| has only 1 element. - if (run_params.video_codecs[0].name == cricket::kVp8CodecName) { + // Because simulcast enabled |alice_->params()->video_codecs| has only 1 + // element. + if (alice_->params()->video_codecs[0].name == cricket::kVp8CodecName) { // For Vp8 simulcast we need to add as many RtpEncodingParameters to the // track as many simulcast streams requested. If they specified in // |video_config.simulcast_config| it should be copied from there. @@ -508,14 +509,14 @@ void PeerConnectionE2EQualityTest::SetPeerCodecPreferences( const RunParams& run_params) { std::vector with_rtx_video_capabilities = FilterVideoCodecCapabilities( - run_params.video_codecs, true, run_params.use_ulp_fec, + peer->params()->video_codecs, true, run_params.use_ulp_fec, run_params.use_flex_fec, peer->pc_factory() ->GetRtpSenderCapabilities(cricket::MediaType::MEDIA_TYPE_VIDEO) .codecs); std::vector without_rtx_video_capabilities = FilterVideoCodecCapabilities( - run_params.video_codecs, false, run_params.use_ulp_fec, + peer->params()->video_codecs, false, run_params.use_ulp_fec, run_params.use_flex_fec, peer->pc_factory() ->GetRtpSenderCapabilities(cricket::MediaType::MEDIA_TYPE_VIDEO) @@ -552,8 +553,7 @@ PeerConnectionE2EQualityTest::CreateSignalingInterceptor( video_config.simulcast_config->simulcast_streams_count}); } } - PatchingParams patching_params(run_params.video_codecs, - run_params.use_conference_mode, + PatchingParams patching_params(run_params.use_conference_mode, stream_label_to_simulcast_streams_count); return std::make_unique(patching_params); } @@ -594,8 +594,8 @@ void PeerConnectionE2EQualityTest::ExchangeOfferAnswer( RTC_CHECK(offer); offer->ToString(&log_output); RTC_LOG(INFO) << "Original offer: " << log_output; - LocalAndRemoteSdp patch_result = - signaling_interceptor->PatchOffer(std::move(offer)); + LocalAndRemoteSdp patch_result = signaling_interceptor->PatchOffer( + std::move(offer), alice_->params()->video_codecs[0]); patch_result.local_sdp->ToString(&log_output); RTC_LOG(INFO) << "Offer to set as local description: " << log_output; patch_result.remote_sdp->ToString(&log_output); @@ -611,7 +611,8 @@ void PeerConnectionE2EQualityTest::ExchangeOfferAnswer( RTC_CHECK(answer); answer->ToString(&log_output); RTC_LOG(INFO) << "Original answer: " << log_output; - patch_result = signaling_interceptor->PatchAnswer(std::move(answer)); + patch_result = signaling_interceptor->PatchAnswer( + std::move(answer), bob_->params()->video_codecs[0]); patch_result.local_sdp->ToString(&log_output); RTC_LOG(INFO) << "Answer to set as local description: " << log_output; patch_result.remote_sdp->ToString(&log_output); diff --git a/test/pc/e2e/peer_connection_quality_test_params.h b/test/pc/e2e/peer_connection_quality_test_params.h index e1c0232cb2..31938f77f5 100644 --- a/test/pc/e2e/peer_connection_quality_test_params.h +++ b/test/pc/e2e/peer_connection_quality_test_params.h @@ -116,6 +116,8 @@ struct Params { PeerConnectionInterface::RTCConfiguration rtc_configuration; BitrateSettings bitrate_settings; + std::vector + video_codecs; }; } // namespace webrtc_pc_e2e diff --git a/test/pc/e2e/sdp/sdp_changer.cc b/test/pc/e2e/sdp/sdp_changer.cc index b46aea1c5f..aa067f0c40 100644 --- a/test/pc/e2e/sdp/sdp_changer.cc +++ b/test/pc/e2e/sdp/sdp_changer.cc @@ -166,14 +166,15 @@ void SignalingInterceptor::FillSimulcastContext( } LocalAndRemoteSdp SignalingInterceptor::PatchOffer( - std::unique_ptr offer) { + std::unique_ptr offer, + const PeerConnectionE2EQualityTestFixture::VideoCodecConfig& first_codec) { for (auto& content : offer->description()->contents()) { context_.mids_order.push_back(content.mid()); cricket::MediaContentDescription* media_desc = content.media_description(); if (media_desc->type() != cricket::MediaType::MEDIA_TYPE_VIDEO) { continue; } - if (content.media_description()->streams().size() == 0) { + if (content.media_description()->streams().empty()) { // It means that this media section describes receive only media section // in SDP. RTC_CHECK_EQ(content.media_description()->direction(), @@ -183,13 +184,13 @@ LocalAndRemoteSdp SignalingInterceptor::PatchOffer( media_desc->set_conference_mode(params_.use_conference_mode); } - if (params_.stream_label_to_simulcast_streams_count.size() > 0) { + if (!params_.stream_label_to_simulcast_streams_count.empty()) { // Because simulcast enabled |params_.video_codecs| has only 1 element. - if (params_.video_codecs[0].name == cricket::kVp8CodecName) { + if (first_codec.name == cricket::kVp8CodecName) { return PatchVp8Offer(std::move(offer)); } - if (params_.video_codecs[0].name == cricket::kVp9CodecName) { + if (first_codec.name == cricket::kVp9CodecName) { return PatchVp9Offer(std::move(offer)); } } @@ -362,7 +363,8 @@ LocalAndRemoteSdp SignalingInterceptor::PatchVp9Offer( } LocalAndRemoteSdp SignalingInterceptor::PatchAnswer( - std::unique_ptr answer) { + std::unique_ptr answer, + const PeerConnectionE2EQualityTestFixture::VideoCodecConfig& first_codec) { for (auto& content : answer->description()->contents()) { cricket::MediaContentDescription* media_desc = content.media_description(); if (media_desc->type() != cricket::MediaType::MEDIA_TYPE_VIDEO) { @@ -375,13 +377,13 @@ LocalAndRemoteSdp SignalingInterceptor::PatchAnswer( media_desc->set_conference_mode(params_.use_conference_mode); } - if (params_.stream_label_to_simulcast_streams_count.size() > 0) { + if (!params_.stream_label_to_simulcast_streams_count.empty()) { // Because simulcast enabled |params_.video_codecs| has only 1 element. - if (params_.video_codecs[0].name == cricket::kVp8CodecName) { + if (first_codec.name == cricket::kVp8CodecName) { return PatchVp8Answer(std::move(answer)); } - if (params_.video_codecs[0].name == cricket::kVp9CodecName) { + if (first_codec.name == cricket::kVp9CodecName) { return PatchVp9Answer(std::move(answer)); } } @@ -534,7 +536,7 @@ SignalingInterceptor::PatchOffererIceCandidates( // This is candidate for simulcast section, so it should be transformed // into candidates for replicated sections. The sdpMLineIndex is set to // -1 and ignored if the rid is present. - for (auto rid : simulcast_info_it->second->rids) { + for (const std::string& rid : simulcast_info_it->second->rids) { out.push_back(CreateIceCandidate(rid, -1, candidate->candidate())); } } else { @@ -560,7 +562,7 @@ SignalingInterceptor::PatchAnswererIceCandidates( // section. out.push_back(CreateIceCandidate(simulcast_info_it->second->mid, 0, candidate->candidate())); - } else if (context_.simulcast_infos_by_rid.size()) { + } else if (!context_.simulcast_infos_by_rid.empty()) { // When using simulcast and bundle, put everything on the first m-line. out.push_back(CreateIceCandidate("", 0, candidate->candidate())); } else { diff --git a/test/pc/e2e/sdp/sdp_changer.h b/test/pc/e2e/sdp/sdp_changer.h index 11e3d421d3..943d332945 100644 --- a/test/pc/e2e/sdp/sdp_changer.h +++ b/test/pc/e2e/sdp/sdp_changer.h @@ -61,17 +61,12 @@ struct LocalAndRemoteSdp { struct PatchingParams { PatchingParams( - std::vector - video_codecs, bool use_conference_mode, std::map stream_label_to_simulcast_streams_count) - : video_codecs(std::move(video_codecs)), - use_conference_mode(use_conference_mode), + : use_conference_mode(use_conference_mode), stream_label_to_simulcast_streams_count( stream_label_to_simulcast_streams_count) {} - std::vector - video_codecs; bool use_conference_mode; std::map stream_label_to_simulcast_streams_count; }; @@ -81,9 +76,11 @@ class SignalingInterceptor { explicit SignalingInterceptor(PatchingParams params) : params_(params) {} LocalAndRemoteSdp PatchOffer( - std::unique_ptr offer); + std::unique_ptr offer, + const PeerConnectionE2EQualityTestFixture::VideoCodecConfig& first_codec); LocalAndRemoteSdp PatchAnswer( - std::unique_ptr offer); + std::unique_ptr answer, + const PeerConnectionE2EQualityTestFixture::VideoCodecConfig& first_codec); std::vector> PatchOffererIceCandidates( rtc::ArrayView candidates); @@ -132,9 +129,9 @@ class SignalingInterceptor { LocalAndRemoteSdp PatchVp9Offer( std::unique_ptr offer); LocalAndRemoteSdp PatchVp8Answer( - std::unique_ptr offer); + std::unique_ptr answer); LocalAndRemoteSdp PatchVp9Answer( - std::unique_ptr offer); + std::unique_ptr answer); void FillSimulcastContext(SessionDescriptionInterface* offer); std::unique_ptr RestoreMediaSectionsOrder( From 8d60ca92097aad1c62d6dcd7d2a6e3237f640fb0 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Thu, 15 Jul 2021 16:08:23 +0200 Subject: [PATCH 0015/1565] Add backwards compatibilty to peer codecs config. This is a small follow-up to https://webrtc-review.googlesource.com/c/src/+/226220 in order to make the switch incremental. No-Try: True Bug: b/192821182 Change-Id: I2e36c74eb97b5ee30cbd5c383eebff73e9389408 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226221 Commit-Queue: Mirko Bonadei Reviewed-by: Andrey Logvin Cr-Commit-Position: refs/heads/master@{#34478} --- test/pc/e2e/peer_configurer.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/pc/e2e/peer_configurer.cc b/test/pc/e2e/peer_configurer.cc index caf29eb992..50ce51b49a 100644 --- a/test/pc/e2e/peer_configurer.cc +++ b/test/pc/e2e/peer_configurer.cc @@ -100,6 +100,9 @@ void SetDefaultValuesForMissingParams( p->video_codecs.push_back( PeerConnectionE2EQualityTestFixture::VideoCodecConfig( cricket::kVp8CodecName)); + run_params->video_codecs = { + PeerConnectionE2EQualityTestFixture::VideoCodecConfig( + cricket::kVp8CodecName)}; } } else { RTC_CHECK(run_params->video_codecs.empty()) From 151083378aff69acd428d7f26a03c848fe33379b Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Thu, 15 Jul 2021 09:03:22 -0700 Subject: [PATCH 0016/1565] Roll chromium_revision 3e91767469..bb7a52d748 (901837:901976) Change log: https://chromium.googlesource.com/chromium/src/+log/3e91767469..bb7a52d748 Full diff: https://chromium.googlesource.com/chromium/src/+/3e91767469..bb7a52d748 Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/725516aa75..a373a93d0e * src/build: https://chromium.googlesource.com/chromium/src/build/+log/a0ffb5c18b..535c82e635 * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/d1c4c41dbf..9bce1fc462 * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/facf50dac0..5a62f2988f * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/52135cd88e..adf99d3287 * src/third_party/androidx: zxYzGNpCuNmZZYQcKjcgCxw3eXROUqPq57kFfMvMuT0C..b--AoMYQfqDHN-sIzYSbG81zEmkj3AaINEpQJDwib6gC * src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/f61fac0492..4ba18870d2 * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/97facadd96..5e0184587a * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/93e178ad35..725ae6ef7f DEPS diff: https://chromium.googlesource.com/chromium/src/+/3e91767469..bb7a52d748/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: I7745260410d0b2f684c4e23f83f6aefe2ed9f191 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226260 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34479} --- DEPS | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/DEPS b/DEPS index 0339c540e7..6948aa3437 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': '3e91767469c23d3181e804abdefa208bc7bdb57e', + 'chromium_revision': 'bb7a52d7486d0d9ee9f175fd4e0834c44332ee0c', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,9 +20,9 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@725516aa75059049687a476dac4f61070c700fce', + 'https://chromium.googlesource.com/chromium/src/base@a373a93d0e2fcf4cf1d5650e5714f89b6eaba344', 'src/build': - 'https://chromium.googlesource.com/chromium/src/build@a0ffb5c18bd9af17f1a60d003eab55d166a47dae', + 'https://chromium.googlesource.com/chromium/src/build@535c82e63519e9ef2e7d8cc5f9cdbc0877414942', 'src/buildtools': 'https://chromium.googlesource.com/chromium/src/buildtools@2500c1d8f3a20a66a7cbafe3f69079a2edb742dd', # Gradle 6.6.1. Used for testing Android Studio project generation for WebRTC. @@ -31,13 +31,13 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@d1c4c41dbfc81e76471180568c20b9003f535bf6', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@9bce1fc46246f410aea19c75e7892d665b237153', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@facf50dac062324559b25d071f0c317185ae6a4c', + 'https://chromium.googlesource.com/chromium/src/testing@5a62f2988f62a90111583424e591fd409de02bb4', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@52135cd88ede573d2dd3a6253a68615e04444b94', + 'https://chromium.googlesource.com/chromium/src/third_party@adf99d3287fb451a92a31d35db9db20914626009', 'src/buildtools/linux64': { 'packages': [ @@ -128,7 +128,7 @@ deps = { 'src/third_party/breakpad/breakpad': 'https://chromium.googlesource.com/breakpad/breakpad.git@b95c4868b10f69e642666742233aede1eb653012', 'src/third_party/catapult': - 'https://chromium.googlesource.com/catapult.git@f61fac04928dc5d84be9dce9ea4f642527f3fd58', + 'https://chromium.googlesource.com/catapult.git@4ba18870d259bfdfdfe9947cb80cae8747d2563f', 'src/third_party/ced/src': { 'url': 'https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git@ba412eaaacd3186085babcd901679a48863c7dd5', }, @@ -214,7 +214,7 @@ deps = { 'condition': 'checkout_android', }, 'src/third_party/perfetto': - 'https://android.googlesource.com/platform/external/perfetto.git@97facadd961825cf2b6eb12398e0908a102d0c4a', + 'https://android.googlesource.com/platform/external/perfetto.git@5e0184587a2853fa0bdb659e8716b0b3e6ca962f', 'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@eebc5cd487a89c51ba148f6d6ac45779970f72d7', 'src/third_party/libyuv': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@93e178ad359993c575361aa04126013fcb2c8a33', + 'https://chromium.googlesource.com/chromium/src/tools@725ae6ef7fcfb77d22f9a2affeb57107d1dfc2d0', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'zxYzGNpCuNmZZYQcKjcgCxw3eXROUqPq57kFfMvMuT0C', + 'version': 'b--AoMYQfqDHN-sIzYSbG81zEmkj3AaINEpQJDwib6gC', }, ], 'condition': 'checkout_android', From 9fc266371257c066d65858a91ad0a889fdb3429e Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Fri, 18 Jun 2021 23:37:37 +0900 Subject: [PATCH 0017/1565] Hide VideoCodecType from Android SDK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This has not been used since https://webrtc-review.googlesource.com/c/src/+/172721 . Bug: None Change-Id: Id617b9f6770b342b324fe0da84bf402cea1e783c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/223081 Reviewed-by: Niels Moller Reviewed-by: Xavier Lepaul‎ Commit-Queue: Byoungchan Lee Cr-Commit-Position: refs/heads/master@{#34480} --- api/video/BUILD.gn | 6 ------ api/video/video_codec_type.h | 1 - sdk/android/BUILD.gn | 1 - 3 files changed, 8 deletions(-) diff --git a/api/video/BUILD.gn b/api/video/BUILD.gn index ec90bc137e..41367132f6 100644 --- a/api/video/BUILD.gn +++ b/api/video/BUILD.gn @@ -69,12 +69,6 @@ rtc_library("video_frame") { absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] } -if (is_android) { - java_cpp_enum("video_frame_enums") { - sources = [ "video_codec_type.h" ] - } -} - rtc_library("video_frame_i010") { visibility = [ "*" ] sources = [ diff --git a/api/video/video_codec_type.h b/api/video/video_codec_type.h index 12dcfac1b9..74a4bc4258 100644 --- a/api/video/video_codec_type.h +++ b/api/video/video_codec_type.h @@ -13,7 +13,6 @@ namespace webrtc { -// GENERATED_JAVA_ENUM_PACKAGE: org.webrtc enum VideoCodecType { // There are various memset(..., 0, ...) calls in the code that rely on // kVideoCodecGeneric being zero. diff --git a/sdk/android/BUILD.gn b/sdk/android/BUILD.gn index be15a7d643..57b9d629be 100644 --- a/sdk/android/BUILD.gn +++ b/sdk/android/BUILD.gn @@ -323,7 +323,6 @@ if (is_android) { ] srcjar_deps = [ "//api:priority_enums", - "//api/video:video_frame_enums", "//rtc_base:network_monitor_enums", ] } From 7bba23e57e6688da3027bd637664cafa1ea4ea29 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Thu, 15 Jul 2021 13:03:06 -0700 Subject: [PATCH 0018/1565] Roll chromium_revision bb7a52d748..511859460e (901976:902090) Change log: https://chromium.googlesource.com/chromium/src/+log/bb7a52d748..511859460e Full diff: https://chromium.googlesource.com/chromium/src/+/bb7a52d748..511859460e Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/a373a93d0e..ab81c676d9 * src/build: https://chromium.googlesource.com/chromium/src/build/+log/535c82e635..abfeb64d31 * src/buildtools/third_party/libc++abi/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git/+log/bb278658aa..486cb62885 * src/buildtools/third_party/libunwind/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git/+log/333cca2038..70006b7957 * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/9bce1fc462..4a62dab34c * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/adf99d3287..fb7d406460 * src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/4ba18870d2..1bbcf82927 * src/third_party/icu: https://chromium.googlesource.com/chromium/deps/icu.git/+log/b9dfc58bf9..2a822c5626 * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/5e0184587a..8a77c3ee7b * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/725ae6ef7f..affc1deb62 DEPS diff: https://chromium.googlesource.com/chromium/src/+/bb7a52d748..511859460e/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: I00db45ea5c67f7f3fe9036ad326704d47c2aa932 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226340 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34481} --- DEPS | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/DEPS b/DEPS index 6948aa3437..53d17fa745 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': 'bb7a52d7486d0d9ee9f175fd4e0834c44332ee0c', + 'chromium_revision': '511859460e719ed5c3d7f7d3d1e7fcaf6735af98', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,9 +20,9 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@a373a93d0e2fcf4cf1d5650e5714f89b6eaba344', + 'https://chromium.googlesource.com/chromium/src/base@ab81c676d94e6f6ee40c914d42c7f6b45f80de7b', 'src/build': - 'https://chromium.googlesource.com/chromium/src/build@535c82e63519e9ef2e7d8cc5f9cdbc0877414942', + 'https://chromium.googlesource.com/chromium/src/build@abfeb64d31d38e17a4731c865bc932bcf2880ab7', 'src/buildtools': 'https://chromium.googlesource.com/chromium/src/buildtools@2500c1d8f3a20a66a7cbafe3f69079a2edb742dd', # Gradle 6.6.1. Used for testing Android Studio project generation for WebRTC. @@ -31,13 +31,13 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@9bce1fc46246f410aea19c75e7892d665b237153', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@4a62dab34c7ea7b0de4eb71d188b5cc5d6869487', 'condition': 'checkout_ios', }, 'src/testing': 'https://chromium.googlesource.com/chromium/src/testing@5a62f2988f62a90111583424e591fd409de02bb4', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@adf99d3287fb451a92a31d35db9db20914626009', + 'https://chromium.googlesource.com/chromium/src/third_party@fb7d4064600f15323f740abf72caa8544acb9e24', 'src/buildtools/linux64': { 'packages': [ @@ -75,9 +75,9 @@ deps = { 'src/buildtools/third_party/libc++/trunk': 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git@79a2e924d96e2fc1e4b937c42efd08898fa472d7', 'src/buildtools/third_party/libc++abi/trunk': - 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git@bb278658aa0d4cc88dd4ca5bc5df428f92b85ddb', + 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git@486cb6288513c44a65f36dd9c75c111fb7df794c', 'src/buildtools/third_party/libunwind/trunk': - 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git@333cca20381ead0d1baa7bcc38219e5bfd52f664', + 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git@70006b7957faf73ffa9830063545f5dec0c72155', 'src/tools/clang/dsymutil': { 'packages': [ @@ -128,7 +128,7 @@ deps = { 'src/third_party/breakpad/breakpad': 'https://chromium.googlesource.com/breakpad/breakpad.git@b95c4868b10f69e642666742233aede1eb653012', 'src/third_party/catapult': - 'https://chromium.googlesource.com/catapult.git@4ba18870d259bfdfdfe9947cb80cae8747d2563f', + 'https://chromium.googlesource.com/catapult.git@1bbcf82927b4633df768513bd3fa99090ce90104', 'src/third_party/ced/src': { 'url': 'https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git@ba412eaaacd3186085babcd901679a48863c7dd5', }, @@ -172,7 +172,7 @@ deps = { 'src/third_party/googletest/src': 'https://chromium.googlesource.com/external/github.com/google/googletest.git@4ec4cd23f486bf70efcc5d2caa40f24368f752e3', 'src/third_party/icu': { - 'url': 'https://chromium.googlesource.com/chromium/deps/icu.git@b9dfc58bf9b02ea0365509244aca13841322feb0', + 'url': 'https://chromium.googlesource.com/chromium/deps/icu.git@2a822c5626ab1ed40366758e4740b4f0ea40237d', }, 'src/third_party/jdk': { 'packages': [ @@ -214,7 +214,7 @@ deps = { 'condition': 'checkout_android', }, 'src/third_party/perfetto': - 'https://android.googlesource.com/platform/external/perfetto.git@5e0184587a2853fa0bdb659e8716b0b3e6ca962f', + 'https://android.googlesource.com/platform/external/perfetto.git@8a77c3ee7bace99c4a69f061ce5efad9ef88d907', 'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@eebc5cd487a89c51ba148f6d6ac45779970f72d7', 'src/third_party/libyuv': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@725ae6ef7fcfb77d22f9a2affeb57107d1dfc2d0', + 'https://chromium.googlesource.com/chromium/src/tools@affc1deb6253cce3608fa393e21309d9f541a35e', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', From 9d58f97f904806ab43ea703e6dd1ef93b0f7ad55 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Thu, 15 Jul 2021 17:14:54 +0200 Subject: [PATCH 0019/1565] Set video codecs with PeerConfigurer in tests. Bug: b/192821182 Change-Id: I78f68acb22530f533b5848b20e14d9990d8a554a Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226240 Reviewed-by: Andrey Logvin Reviewed-by: Ilya Nikolaevskiy Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34482} --- test/pc/e2e/peer_connection_e2e_smoke_test.cc | 31 ++-- video/pc_full_stack_tests.cc | 160 ++++++++++-------- 2 files changed, 114 insertions(+), 77 deletions(-) diff --git a/test/pc/e2e/peer_connection_e2e_smoke_test.cc b/test/pc/e2e/peer_connection_e2e_smoke_test.cc index 10f62835a9..92104c7395 100644 --- a/test/pc/e2e/peer_connection_e2e_smoke_test.cc +++ b/test/pc/e2e/peer_connection_e2e_smoke_test.cc @@ -147,6 +147,8 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Smoke) { audio.sampling_frequency_in_hz = 48000; audio.sync_group = "alice-media"; alice->SetAudioConfig(std::move(audio)); + alice->SetVideoCodecs( + {VideoCodecConfig(cricket::kVp9CodecName, {{"profile-id", "0"}})}); }); AddPeer(network_links.second, [](PeerConfigurer* charlie) { charlie->SetName("charlie"); @@ -161,6 +163,8 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Smoke) { audio.input_file_name = test::ResourcePath("pc_quality_smoke_test_bob_source", "wav"); charlie->SetAudioConfig(std::move(audio)); + charlie->SetVideoCodecs( + {VideoCodecConfig(cricket::kVp9CodecName, {{"profile-id", "0"}})}); }); fixture()->AddQualityMetricsReporter( std::make_unique( @@ -169,8 +173,6 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Smoke) { {"charlie", network_links.second->endpoints()}}), network_emulation())); RunParams run_params(TimeDelta::Seconds(2)); - run_params.video_codecs = { - VideoCodecConfig(cricket::kVp9CodecName, {{"profile-id", "0"}})}; run_params.use_flex_fec = true; run_params.use_ulp_fec = true; run_params.video_encoder_bitrate_multiplier = 1.1; @@ -217,8 +219,13 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_ChangeNetworkConditions) { video.stream_label = "alice-video"; video.sync_group = "alice-media"; alice->AddVideoConfig(std::move(video)); + alice->SetVideoCodecs( + {VideoCodecConfig(cricket::kVp9CodecName, {{"profile-id", "0"}})}); + }); + AddPeer(bob_network, [](PeerConfigurer* bob) { + bob->SetVideoCodecs( + {VideoCodecConfig(cricket::kVp9CodecName, {{"profile-id", "0"}})}); }); - AddPeer(bob_network, [](PeerConfigurer* bob) {}); fixture()->AddQualityMetricsReporter( std::make_unique( std::map>( @@ -233,8 +240,6 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_ChangeNetworkConditions) { }); RunParams run_params(TimeDelta::Seconds(2)); - run_params.video_codecs = { - VideoCodecConfig(cricket::kVp9CodecName, {{"profile-id", "0"}})}; run_params.use_flex_fec = true; run_params.use_ulp_fec = true; run_params.video_encoder_bitrate_multiplier = 1.1; @@ -323,7 +328,6 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Simulcast) { }); AddPeer(network_links.second, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(2)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; RunAndCheckEachVideoStreamReceivedFrames(run_params); } @@ -350,10 +354,12 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_Svc) { audio.input_file_name = test::ResourcePath("pc_quality_smoke_test_alice_source", "wav"); alice->SetAudioConfig(std::move(audio)); + alice->SetVideoCodecs({VideoCodecConfig(cricket::kVp9CodecName)}); + }); + AddPeer(network_links.second, [](PeerConfigurer* bob) { + bob->SetVideoCodecs({VideoCodecConfig(cricket::kVp9CodecName)}); }); - AddPeer(network_links.second, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(2)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp9CodecName)}; RunAndCheckEachVideoStreamReceivedFrames(run_params); } @@ -384,11 +390,14 @@ TEST_F(PeerConnectionE2EQualityTestSmokeTest, MAYBE_HighBitrate) { test::ResourcePath("pc_quality_smoke_test_alice_source", "wav"); audio.sampling_frequency_in_hz = 48000; alice->SetAudioConfig(std::move(audio)); + alice->SetVideoCodecs( + {VideoCodecConfig(cricket::kVp9CodecName, {{"profile-id", "0"}})}); + }); + AddPeer(network_links.second, [](PeerConfigurer* bob) { + bob->SetVideoCodecs( + {VideoCodecConfig(cricket::kVp9CodecName, {{"profile-id", "0"}})}); }); - AddPeer(network_links.second, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(2)); - run_params.video_codecs = { - VideoCodecConfig(cricket::kVp9CodecName, {{"profile-id", "0"}})}; RunAndCheckEachVideoStreamReceivedFrames(run_params); } diff --git a/video/pc_full_stack_tests.cc b/video/pc_full_stack_tests.cc index 5cebf41e91..6fb83f8c25 100644 --- a/video/pc_full_stack_tests.cc +++ b/video/pc_full_stack_tests.cc @@ -121,12 +121,18 @@ TEST(PCFullStackTest, Pc_Foreman_Cif_Net_Delay_0_0_Plr_0_VP9) { auto frame_generator = CreateFromYuvFileFrameGenerator( video, ClipNameToClipPath("foreman_cif")); alice->AddVideoConfig(std::move(video), std::move(frame_generator)); + alice->SetVideoCodecs({VideoCodecConfig( + /*name=*/cricket::kVp9CodecName, /*required_params=*/{ + {kVP9FmtpProfileId, + VP9ProfileToString(VP9Profile::kProfile0)}})}); }, - [](PeerConfigurer* bob) {}); + [](PeerConfigurer* bob) { + bob->SetVideoCodecs({VideoCodecConfig( + /*name=*/cricket::kVp9CodecName, /*required_params=*/{ + {kVP9FmtpProfileId, + VP9ProfileToString(VP9Profile::kProfile0)}})}); + }); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig( - /*name=*/cricket::kVp9CodecName, /*required_params=*/{ - {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -149,12 +155,18 @@ TEST(PCGenericDescriptorTest, auto frame_generator = CreateFromYuvFileFrameGenerator( video, ClipNameToClipPath("foreman_cif")); alice->AddVideoConfig(std::move(video), std::move(frame_generator)); + alice->SetVideoCodecs({VideoCodecConfig( + /*name=*/cricket::kVp9CodecName, /*required_params=*/{ + {kVP9FmtpProfileId, + VP9ProfileToString(VP9Profile::kProfile0)}})}); }, - [](PeerConfigurer* bob) {}); + [](PeerConfigurer* bob) { + bob->SetVideoCodecs({VideoCodecConfig( + /*name=*/cricket::kVp9CodecName, /*required_params=*/{ + {kVP9FmtpProfileId, + VP9ProfileToString(VP9Profile::kProfile0)}})}); + }); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig( - /*name=*/cricket::kVp9CodecName, /*required_params=*/{ - {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -184,12 +196,18 @@ TEST(PCFullStackTest, MAYBE_Pc_Generator_Net_Delay_0_0_Plr_0_VP9Profile2) { auto frame_generator = CreateSquareFrameGenerator( video, test::FrameGeneratorInterface::OutputType::kI010); alice->AddVideoConfig(std::move(video), std::move(frame_generator)); + alice->SetVideoCodecs({VideoCodecConfig( + /*name=*/cricket::kVp9CodecName, /*required_params=*/{ + {kVP9FmtpProfileId, + VP9ProfileToString(VP9Profile::kProfile2)}})}); }, - [](PeerConfigurer* bob) {}); + [](PeerConfigurer* bob) { + bob->SetVideoCodecs({VideoCodecConfig( + /*name=*/cricket::kVp9CodecName, /*required_params=*/{ + {kVP9FmtpProfileId, + VP9ProfileToString(VP9Profile::kProfile2)}})}); + }); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig( - /*name=*/cricket::kVp9CodecName, /*required_params=*/{ - {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile2)}})}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -243,7 +261,6 @@ TEST(PCFullStackTest, Pc_Net_Delay_0_0_Plr_0) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -267,7 +284,6 @@ TEST(PCGenericDescriptorTest, }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -297,7 +313,6 @@ TEST(PCGenericDescriptorTest, }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -322,7 +337,6 @@ TEST(PCFullStackTest, Pc_Foreman_Cif_Link_150kbps_Net_Delay_0_0_Plr_0) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -348,7 +362,6 @@ TEST(PCFullStackTest, Pc_Foreman_Cif_Link_130kbps_Delay100ms_Loss1_Ulpfec) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = true; fixture->Run(std::move(run_params)); @@ -374,7 +387,6 @@ TEST(PCFullStackTest, Pc_Foreman_Cif_Link_50kbps_Delay100ms_Loss1_Ulpfec) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = true; fixture->Run(std::move(run_params)); @@ -402,7 +414,6 @@ TEST(PCFullStackTest, }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; run_params.video_encoder_bitrate_multiplier = 1.30; @@ -434,7 +445,6 @@ TEST(PCFullStackTest, Pc_Foreman_Cif_Link_250kbps_Delay100ms_10pkts_Loss1) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; run_params.video_encoder_bitrate_multiplier = 1.30; @@ -461,7 +471,6 @@ TEST(PCGenericDescriptorTest, }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -487,7 +496,6 @@ TEST(PCGenericDescriptorTest, }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = true; fixture->Run(std::move(run_params)); @@ -512,7 +520,6 @@ TEST(PCFullStackTest, Pc_Foreman_Cif_Delay_50_0_Plr_5_Flexfec) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = true; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -538,7 +545,6 @@ TEST(PCFullStackTest, Pc_Foreman_Cif_500kbps_Delay_50_0_Plr_3_Flexfec) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = true; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -564,7 +570,6 @@ TEST(PCFullStackTest, Pc_Foreman_Cif_500kbps_Delay_50_0_Plr_3_Ulpfec) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = true; fixture->Run(std::move(run_params)); @@ -585,10 +590,12 @@ TEST(PCFullStackTest, Pc_Foreman_Cif_Net_Delay_0_0_Plr_0_H264) { auto frame_generator = CreateFromYuvFileFrameGenerator( video, ClipNameToClipPath("foreman_cif")); alice->AddVideoConfig(std::move(video), std::move(frame_generator)); + alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)}); }, - [](PeerConfigurer* bob) {}); + [](PeerConfigurer* bob) { + bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)}); + }); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -614,10 +621,12 @@ TEST(PCFullStackTest, Pc_Foreman_Cif_30kbps_Net_Delay_0_0_Plr_0_H264) { bitrate_settings.start_bitrate_bps = 30000; bitrate_settings.max_bitrate_bps = 30000; alice->SetBitrateSettings(bitrate_settings); + alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)}); }, - [](PeerConfigurer* bob) {}); + [](PeerConfigurer* bob) { + bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)}); + }); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -640,10 +649,12 @@ TEST(PCGenericDescriptorTest, auto frame_generator = CreateFromYuvFileFrameGenerator( video, ClipNameToClipPath("foreman_cif")); alice->AddVideoConfig(std::move(video), std::move(frame_generator)); + alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)}); }, - [](PeerConfigurer* bob) {}); + [](PeerConfigurer* bob) { + bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)}); + }); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -668,10 +679,12 @@ TEST(PCFullStackTest, Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Sps_Pps_Idr) { auto frame_generator = CreateFromYuvFileFrameGenerator( video, ClipNameToClipPath("foreman_cif")); alice->AddVideoConfig(std::move(video), std::move(frame_generator)); + alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)}); }, - [](PeerConfigurer* bob) {}); + [](PeerConfigurer* bob) { + bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)}); + }); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -693,10 +706,12 @@ TEST(PCFullStackTest, Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Flexfec) { auto frame_generator = CreateFromYuvFileFrameGenerator( video, ClipNameToClipPath("foreman_cif")); alice->AddVideoConfig(std::move(video), std::move(frame_generator)); + alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)}); }, - [](PeerConfigurer* bob) {}); + [](PeerConfigurer* bob) { + bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)}); + }); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)}; run_params.use_flex_fec = true; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -720,10 +735,12 @@ TEST(PCFullStackTest, DISABLED_Pc_Foreman_Cif_Delay_50_0_Plr_5_H264_Ulpfec) { auto frame_generator = CreateFromYuvFileFrameGenerator( video, ClipNameToClipPath("foreman_cif")); alice->AddVideoConfig(std::move(video), std::move(frame_generator)); + alice->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)}); }, - [](PeerConfigurer* bob) {}); + [](PeerConfigurer* bob) { + bob->SetVideoCodecs({VideoCodecConfig(cricket::kH264CodecName)}); + }); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kH264CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = true; fixture->Run(std::move(run_params)); @@ -749,7 +766,6 @@ TEST(PCFullStackTest, Pc_Foreman_Cif_500kbps) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -775,7 +791,6 @@ TEST(PCFullStackTest, Pc_Foreman_Cif_500kbps_32pkts_Queue) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -801,7 +816,6 @@ TEST(PCFullStackTest, Pc_Foreman_Cif_500kbps_100ms) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -828,7 +842,6 @@ TEST(PCGenericDescriptorTest, }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -875,7 +888,6 @@ TEST(PCFullStackTest, Pc_Foreman_Cif_1000kbps_100ms_32pkts_Queue) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -902,7 +914,6 @@ TEST(PCFullStackTest, Pc_Conference_Motion_Hd_2000kbps_100ms_32pkts_Queue) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -1052,12 +1063,18 @@ TEST(PCFullStackTest, Pc_Conference_Motion_Hd_2000kbps_100ms_32pkts_Queue_Vp9) { auto frame_generator = CreateFromYuvFileFrameGenerator( video, ClipNameToClipPath("ConferenceMotion_1280_720_50")); alice->AddVideoConfig(std::move(video), std::move(frame_generator)); + alice->SetVideoCodecs({VideoCodecConfig( + /*name=*/cricket::kVp9CodecName, /*required_params=*/{ + {kVP9FmtpProfileId, + VP9ProfileToString(VP9Profile::kProfile0)}})}); }, - [](PeerConfigurer* bob) {}); + [](PeerConfigurer* bob) { + bob->SetVideoCodecs({VideoCodecConfig( + /*name=*/cricket::kVp9CodecName, /*required_params=*/{ + {kVP9FmtpProfileId, + VP9ProfileToString(VP9Profile::kProfile0)}})}); + }); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig( - /*name=*/cricket::kVp9CodecName, /*required_params=*/{ - {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -1082,7 +1099,6 @@ TEST(PCFullStackTest, Pc_Screenshare_Slides_No_Conference_Mode) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -1105,7 +1121,6 @@ TEST(PCFullStackTest, Pc_Screenshare_Slides) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; run_params.use_conference_mode = true; @@ -1134,7 +1149,6 @@ TEST(PCFullStackTest, Pc_Screenshare_Slides_Simulcast_No_Conference_Mode) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -1160,7 +1174,6 @@ TEST(PCFullStackTest, Pc_Screenshare_Slides_Simulcast) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; run_params.use_conference_mode = true; @@ -1364,12 +1377,18 @@ TEST(PCFullStackTest, Pc_Screenshare_Slides_Vp9_3sl_High_Fps) { auto frame_generator = CreateScreenShareFrameGenerator( video, ScreenShareConfig(TimeDelta::Seconds(10))); alice->AddVideoConfig(std::move(video), std::move(frame_generator)); + alice->SetVideoCodecs({VideoCodecConfig( + /*name=*/cricket::kVp9CodecName, /*required_params=*/{ + {kVP9FmtpProfileId, + VP9ProfileToString(VP9Profile::kProfile0)}})}); }, - [](PeerConfigurer* bob) {}); + [](PeerConfigurer* bob) { + bob->SetVideoCodecs({VideoCodecConfig( + /*name=*/cricket::kVp9CodecName, /*required_params=*/{ + {kVP9FmtpProfileId, + VP9ProfileToString(VP9Profile::kProfile0)}})}); + }); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig( - /*name=*/cricket::kVp9CodecName, /*required_params=*/{ - {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -1393,12 +1412,18 @@ TEST(PCFullStackTest, Pc_Vp9svc_3sl_High) { auto frame_generator = CreateFromYuvFileFrameGenerator( video, ClipNameToClipPath("ConferenceMotion_1280_720_50")); alice->AddVideoConfig(std::move(video), std::move(frame_generator)); + alice->SetVideoCodecs({VideoCodecConfig( + /*name=*/cricket::kVp9CodecName, /*required_params=*/{ + {kVP9FmtpProfileId, + VP9ProfileToString(VP9Profile::kProfile0)}})}); }, - [](PeerConfigurer* bob) {}); + [](PeerConfigurer* bob) { + bob->SetVideoCodecs({VideoCodecConfig( + /*name=*/cricket::kVp9CodecName, /*required_params=*/{ + {kVP9FmtpProfileId, + VP9ProfileToString(VP9Profile::kProfile0)}})}); + }); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig( - /*name=*/cricket::kVp9CodecName, /*required_params=*/{ - {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -1422,12 +1447,18 @@ TEST(PCFullStackTest, Pc_Vp9svc_3sl_Low) { auto frame_generator = CreateFromYuvFileFrameGenerator( video, ClipNameToClipPath("ConferenceMotion_1280_720_50")); alice->AddVideoConfig(std::move(video), std::move(frame_generator)); + alice->SetVideoCodecs({VideoCodecConfig( + /*name=*/cricket::kVp9CodecName, /*required_params=*/{ + {kVP9FmtpProfileId, + VP9ProfileToString(VP9Profile::kProfile0)}})}); }, - [](PeerConfigurer* bob) {}); + [](PeerConfigurer* bob) { + bob->SetVideoCodecs({VideoCodecConfig( + /*name=*/cricket::kVp9CodecName, /*required_params=*/{ + {kVP9FmtpProfileId, + VP9ProfileToString(VP9Profile::kProfile0)}})}); + }); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig( - /*name=*/cricket::kVp9CodecName, /*required_params=*/{ - {kVP9FmtpProfileId, VP9ProfileToString(VP9Profile::kProfile0)}})}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -1552,7 +1583,6 @@ TEST(PCFullStackTest, MAYBE_Pc_Simulcast_HD_High) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -1578,7 +1608,6 @@ TEST(PCFullStackTest, Pc_Simulcast_Vp8_3sl_High) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); @@ -1603,7 +1632,6 @@ TEST(PCFullStackTest, Pc_Simulcast_Vp8_3sl_Low) { }, [](PeerConfigurer* bob) {}); RunParams run_params(TimeDelta::Seconds(kTestDurationSec)); - run_params.video_codecs = {VideoCodecConfig(cricket::kVp8CodecName)}; run_params.use_flex_fec = false; run_params.use_ulp_fec = false; fixture->Run(std::move(run_params)); From 07b3ff93e284b503ee848574028044f286afde34 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Thu, 15 Jul 2021 17:01:26 -0700 Subject: [PATCH 0020/1565] Roll chromium_revision 511859460e..57f461a23c (902090:902224) Change log: https://chromium.googlesource.com/chromium/src/+log/511859460e..57f461a23c Full diff: https://chromium.googlesource.com/chromium/src/+/511859460e..57f461a23c Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/ab81c676d9..ae10d027f5 * src/build: https://chromium.googlesource.com/chromium/src/build/+log/abfeb64d31..c0b24c3c75 * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/4a62dab34c..033dd5117b * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/5a62f2988f..3dc66ccc60 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/fb7d406460..f474f22627 * src/third_party/freetype/src: https://chromium.googlesource.com/chromium/src/third_party/freetype2.git/+log/5d27b10f4c..86b9c9347f * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/affc1deb62..0dcb32f24b DEPS diff: https://chromium.googlesource.com/chromium/src/+/511859460e..57f461a23c/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: Id715afb91daba5d56bc0762c7a0caed329f9117e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226360 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34483} --- DEPS | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/DEPS b/DEPS index 53d17fa745..c9e0746800 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': '511859460e719ed5c3d7f7d3d1e7fcaf6735af98', + 'chromium_revision': '57f461a23c3cd064c1ba5b367fb2a196f396eb6f', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,9 +20,9 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@ab81c676d94e6f6ee40c914d42c7f6b45f80de7b', + 'https://chromium.googlesource.com/chromium/src/base@ae10d027f56c4cab8f0538cda6eef1eee4ab6620', 'src/build': - 'https://chromium.googlesource.com/chromium/src/build@abfeb64d31d38e17a4731c865bc932bcf2880ab7', + 'https://chromium.googlesource.com/chromium/src/build@c0b24c3c75018170c4b74839d61ccbf1721235d2', 'src/buildtools': 'https://chromium.googlesource.com/chromium/src/buildtools@2500c1d8f3a20a66a7cbafe3f69079a2edb742dd', # Gradle 6.6.1. Used for testing Android Studio project generation for WebRTC. @@ -31,13 +31,13 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@4a62dab34c7ea7b0de4eb71d188b5cc5d6869487', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@033dd5117bfc46158bafc3e5c0aca40384c61136', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@5a62f2988f62a90111583424e591fd409de02bb4', + 'https://chromium.googlesource.com/chromium/src/testing@3dc66ccc606789ad4ef91abcbe8e46d3a59f1c77', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@fb7d4064600f15323f740abf72caa8544acb9e24', + 'https://chromium.googlesource.com/chromium/src/third_party@f474f226276d54f20f6f99876a385f78cf8ac5a6', 'src/buildtools/linux64': { 'packages': [ @@ -150,7 +150,7 @@ deps = { 'condition': 'checkout_linux', }, 'src/third_party/freetype/src': - 'https://chromium.googlesource.com/chromium/src/third_party/freetype2.git@5d27b10f4c6c8e140bd48a001b98037ac0d54118', + 'https://chromium.googlesource.com/chromium/src/third_party/freetype2.git@86b9c9347f99174f4fea3e9deca5800e57a987f2', 'src/third_party/harfbuzz-ng/src': 'https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git@cc9bb294919e846ef8a0731b5e9f304f95ef3bb8', 'src/third_party/google_benchmark/src': { @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@affc1deb6253cce3608fa393e21309d9f541a35e', + 'https://chromium.googlesource.com/chromium/src/tools@0dcb32f24bbf3d5525ffc8f3caa7c7511554dc95', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', From 556ca9d83301dac0e1a3c5e1f9ff423e6ddb1fdf Mon Sep 17 00:00:00 2001 From: webrtc-version-updater Date: Thu, 15 Jul 2021 21:04:28 -0700 Subject: [PATCH 0021/1565] Update WebRTC code version (2021-07-16T04:04:26). TBR=webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com,mbonadei@webrtc.org Bug: None Change-Id: Ia699c59ce766e898092e27639d99f118204e9028 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226303 Reviewed-by: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Commit-Queue: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Cr-Commit-Position: refs/heads/master@{#34484} --- call/version.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/call/version.cc b/call/version.cc index 8971a548a2..70e3457a53 100644 --- a/call/version.cc +++ b/call/version.cc @@ -13,7 +13,7 @@ namespace webrtc { // The timestamp is always in UTC. -const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-14T04:04:07"; +const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-16T04:04:25"; void LoadWebRTCVersionInRegister() { // Using volatile to instruct the compiler to not optimize `p` away even From 1f88aba9bd481d8918c8fecf885675631eda5228 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Thu, 15 Jul 2021 23:02:53 -0700 Subject: [PATCH 0022/1565] Roll chromium_revision 57f461a23c..30c3e3e29c (902224:902336) Change log: https://chromium.googlesource.com/chromium/src/+log/57f461a23c..30c3e3e29c Full diff: https://chromium.googlesource.com/chromium/src/+/57f461a23c..30c3e3e29c Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/ae10d027f5..aaf3d7311f * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/033dd5117b..e2ba281b9f * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/3dc66ccc60..d5800742c1 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/f474f22627..72f9be6111 * src/third_party/androidx: b--AoMYQfqDHN-sIzYSbG81zEmkj3AaINEpQJDwib6gC..4TJowTg6khWl4yuneqtj7HHyMIuSVpcOie01pubHj-UC * src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/1bbcf82927..88e3e03477 * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/8a77c3ee7b..90b2155f7c * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/0dcb32f24b..104d3bd588 DEPS diff: https://chromium.googlesource.com/chromium/src/+/57f461a23c..30c3e3e29c/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: Ib22c14a7ee2e6f9f4a043b431cde5f1713bf7568 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226362 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34485} --- DEPS | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/DEPS b/DEPS index c9e0746800..69f207eab7 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': '57f461a23c3cd064c1ba5b367fb2a196f396eb6f', + 'chromium_revision': '30c3e3e29c6e631bda40ad832f6c52b2dc0d9430', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,7 +20,7 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@ae10d027f56c4cab8f0538cda6eef1eee4ab6620', + 'https://chromium.googlesource.com/chromium/src/base@aaf3d7311f26f381ec0af67b682bed8cf5c245e6', 'src/build': 'https://chromium.googlesource.com/chromium/src/build@c0b24c3c75018170c4b74839d61ccbf1721235d2', 'src/buildtools': @@ -31,13 +31,13 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@033dd5117bfc46158bafc3e5c0aca40384c61136', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@e2ba281b9fe2dec1c5e08830db87797c157d7600', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@3dc66ccc606789ad4ef91abcbe8e46d3a59f1c77', + 'https://chromium.googlesource.com/chromium/src/testing@d5800742c176722eb9d4deb10059cfefdea20874', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@f474f226276d54f20f6f99876a385f78cf8ac5a6', + 'https://chromium.googlesource.com/chromium/src/third_party@72f9be6111b539b61a3e8a262167c5252720bcd8', 'src/buildtools/linux64': { 'packages': [ @@ -128,7 +128,7 @@ deps = { 'src/third_party/breakpad/breakpad': 'https://chromium.googlesource.com/breakpad/breakpad.git@b95c4868b10f69e642666742233aede1eb653012', 'src/third_party/catapult': - 'https://chromium.googlesource.com/catapult.git@1bbcf82927b4633df768513bd3fa99090ce90104', + 'https://chromium.googlesource.com/catapult.git@88e3e034773b9925f8ae6d0e858d9523bece5edc', 'src/third_party/ced/src': { 'url': 'https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git@ba412eaaacd3186085babcd901679a48863c7dd5', }, @@ -214,7 +214,7 @@ deps = { 'condition': 'checkout_android', }, 'src/third_party/perfetto': - 'https://android.googlesource.com/platform/external/perfetto.git@8a77c3ee7bace99c4a69f061ce5efad9ef88d907', + 'https://android.googlesource.com/platform/external/perfetto.git@90b2155f7c11dbf3b4b1d02131d20a942120ff9c', 'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@eebc5cd487a89c51ba148f6d6ac45779970f72d7', 'src/third_party/libyuv': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@0dcb32f24bbf3d5525ffc8f3caa7c7511554dc95', + 'https://chromium.googlesource.com/chromium/src/tools@104d3bd5886da27af53f436a436035638889b7ba', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'b--AoMYQfqDHN-sIzYSbG81zEmkj3AaINEpQJDwib6gC', + 'version': '4TJowTg6khWl4yuneqtj7HHyMIuSVpcOie01pubHj-UC', }, ], 'condition': 'checkout_android', From 84b583f577ace8c3622502590e3453214e29edfc Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Fri, 16 Jul 2021 09:18:50 +0200 Subject: [PATCH 0023/1565] Remove video_codecs from RunParams (PC level framework). Bug: b/192821182 Change-Id: I17f728665a86d511c469dc8f29a29e56b2f28a25 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226321 Reviewed-by: Andrey Logvin Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34486} --- .../peerconnection_quality_test_fixture.h | 13 ------------- test/pc/e2e/peer_configurer.cc | 19 +++---------------- 2 files changed, 3 insertions(+), 29 deletions(-) diff --git a/api/test/peerconnection_quality_test_fixture.h b/api/test/peerconnection_quality_test_fixture.h index 20d9c74efa..1619bd7169 100644 --- a/api/test/peerconnection_quality_test_fixture.h +++ b/api/test/peerconnection_quality_test_fixture.h @@ -391,19 +391,6 @@ class PeerConnectionE2EQualityTestFixture { // it will be shut downed. TimeDelta run_duration; - // DEPRECATED: Instead of setting the codecs in RunParams (which apply to - // all the participants in the call, please set them with - // PeerConfigurer, this will allow more flexibility and let - // different Peers support different codecs. - // - // List of video codecs to use during the test. These codecs will be - // negotiated in SDP during offer/answer exchange. The order of these codecs - // during negotiation will be the same as in |video_codecs|. Codecs have - // to be available in codecs list provided by peer connection to be - // negotiated. If some of specified codecs won't be found, the test will - // crash. - // If list is empty Vp8 with no required_params will be used. - std::vector video_codecs; bool use_ulp_fec = false; bool use_flex_fec = false; // Specifies how much video encoder target bitrate should be different than diff --git a/test/pc/e2e/peer_configurer.cc b/test/pc/e2e/peer_configurer.cc index 50ce51b49a..1829147658 100644 --- a/test/pc/e2e/peer_configurer.cc +++ b/test/pc/e2e/peer_configurer.cc @@ -92,22 +92,9 @@ void SetDefaultValuesForMissingParams( } if (p->video_codecs.empty()) { - // TODO(mbonadei): Remove the usage of RunParams to set codecs, this is - // only needed for backwards compatibility. - if (!run_params->video_codecs.empty()) { - p->video_codecs = run_params->video_codecs; - } else { - p->video_codecs.push_back( - PeerConnectionE2EQualityTestFixture::VideoCodecConfig( - cricket::kVp8CodecName)); - run_params->video_codecs = { - PeerConnectionE2EQualityTestFixture::VideoCodecConfig( - cricket::kVp8CodecName)}; - } - } else { - RTC_CHECK(run_params->video_codecs.empty()) - << "Setting video_codecs in both PeerConfigurer and RunParams is not " - "supported."; + p->video_codecs.push_back( + PeerConnectionE2EQualityTestFixture::VideoCodecConfig( + cricket::kVp8CodecName)); } } } From d33d0e8765af96fddcbc14a16022b11929863259 Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Sun, 20 Jun 2021 21:46:52 +0900 Subject: [PATCH 0024/1565] Hide AndroidVideoBuffer class and use factory function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a step to ensure that the Java to C++ Video Frame Buffer conversion respects its types. Bug: webrtc:12602 Change-Id: I1b688b1f421f44474e022b433f9075e75744d86f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/223082 Reviewed-by: Xavier Lepaul‎ Commit-Queue: Xavier Lepaul‎ Cr-Commit-Position: refs/heads/master@{#34487} --- .../src/jni/android_video_track_source.cc | 6 +- .../src/jni/android_video_track_source.h | 2 +- sdk/android/src/jni/video_encoder_wrapper.cc | 1 + sdk/android/src/jni/video_encoder_wrapper.h | 1 - sdk/android/src/jni/video_frame.cc | 55 +++++++++++++++++-- sdk/android/src/jni/video_frame.h | 48 +--------------- 6 files changed, 59 insertions(+), 54 deletions(-) diff --git a/sdk/android/src/jni/android_video_track_source.cc b/sdk/android/src/jni/android_video_track_source.cc index 72cf3955f0..ae9d651d67 100644 --- a/sdk/android/src/jni/android_video_track_source.cc +++ b/sdk/android/src/jni/android_video_track_source.cc @@ -10,11 +10,11 @@ #include "sdk/android/src/jni/android_video_track_source.h" -#include "sdk/android/generated_video_jni/NativeAndroidVideoTrackSource_jni.h" - #include #include "rtc_base/logging.h" +#include "sdk/android/generated_video_jni/NativeAndroidVideoTrackSource_jni.h" +#include "sdk/android/src/jni/video_frame.h" namespace webrtc { namespace jni { @@ -132,7 +132,7 @@ void AndroidVideoTrackSource::OnFrameCaptured( jlong j_timestamp_ns, const JavaRef& j_video_frame_buffer) { rtc::scoped_refptr buffer = - AndroidVideoBuffer::Create(env, j_video_frame_buffer); + JavaToNativeFrameBuffer(env, j_video_frame_buffer); const VideoRotation rotation = jintToVideoRotation(j_rotation); // AdaptedVideoTrackSource handles applying rotation for I420 frames. diff --git a/sdk/android/src/jni/android_video_track_source.h b/sdk/android/src/jni/android_video_track_source.h index eeac48f1e8..625633b90b 100644 --- a/sdk/android/src/jni/android_video_track_source.h +++ b/sdk/android/src/jni/android_video_track_source.h @@ -18,7 +18,7 @@ #include "rtc_base/checks.h" #include "rtc_base/thread.h" #include "rtc_base/timestamp_aligner.h" -#include "sdk/android/src/jni/video_frame.h" +#include "sdk/android/src/jni/jni_helpers.h" namespace webrtc { namespace jni { diff --git a/sdk/android/src/jni/video_encoder_wrapper.cc b/sdk/android/src/jni/video_encoder_wrapper.cc index 4e6d764457..fe7508709f 100644 --- a/sdk/android/src/jni/video_encoder_wrapper.cc +++ b/sdk/android/src/jni/video_encoder_wrapper.cc @@ -27,6 +27,7 @@ #include "sdk/android/native_api/jni/java_types.h" #include "sdk/android/src/jni/encoded_image.h" #include "sdk/android/src/jni/video_codec_status.h" +#include "sdk/android/src/jni/video_frame.h" namespace webrtc { namespace jni { diff --git a/sdk/android/src/jni/video_encoder_wrapper.h b/sdk/android/src/jni/video_encoder_wrapper.h index 1a42b05bc6..ae45004324 100644 --- a/sdk/android/src/jni/video_encoder_wrapper.h +++ b/sdk/android/src/jni/video_encoder_wrapper.h @@ -25,7 +25,6 @@ #include "modules/video_coding/svc/scalable_video_controller_no_layering.h" #include "rtc_base/synchronization/mutex.h" #include "sdk/android/src/jni/jni_helpers.h" -#include "sdk/android/src/jni/video_frame.h" namespace webrtc { namespace jni { diff --git a/sdk/android/src/jni/video_frame.cc b/sdk/android/src/jni/video_frame.cc index 98728032e8..e27a5c841b 100644 --- a/sdk/android/src/jni/video_frame.cc +++ b/sdk/android/src/jni/video_frame.cc @@ -10,12 +10,8 @@ #include "sdk/android/src/jni/video_frame.h" -#include - #include "api/scoped_refptr.h" #include "common_video/include/video_frame_buffer.h" -#include "rtc_base/checks.h" -#include "rtc_base/logging.h" #include "rtc_base/ref_counted_object.h" #include "rtc_base/time_utils.h" #include "sdk/android/generated_video_jni/VideoFrame_jni.h" @@ -27,6 +23,51 @@ namespace jni { namespace { +class AndroidVideoBuffer : public VideoFrameBuffer { + public: + // Creates a native VideoFrameBuffer from a Java VideoFrame.Buffer. + static rtc::scoped_refptr Create( + JNIEnv* jni, + const JavaRef& j_video_frame_buffer); + + // Similar to the Create() above, but adopts and takes ownership of the Java + // VideoFrame.Buffer. I.e. retain() will not be called, but release() will be + // called when the returned AndroidVideoBuffer is destroyed. + static rtc::scoped_refptr Adopt( + JNIEnv* jni, + const JavaRef& j_video_frame_buffer); + + ~AndroidVideoBuffer() override; + + const ScopedJavaGlobalRef& video_frame_buffer() const; + + // Crops a region defined by |crop_x|, |crop_y|, |crop_width| and + // |crop_height|. Scales it to size |scale_width| x |scale_height|. + rtc::scoped_refptr CropAndScale(int crop_x, + int crop_y, + int crop_width, + int crop_height, + int scale_width, + int scale_height) override; + + protected: + // Should not be called directly. Adopts the Java VideoFrame.Buffer. Use + // Create() or Adopt() instead for clarity. + AndroidVideoBuffer(JNIEnv* jni, const JavaRef& j_video_frame_buffer); + + private: + Type type() const override; + int width() const override; + int height() const override; + + rtc::scoped_refptr ToI420() override; + + const int width_; + const int height_; + // Holds a VideoFrame.Buffer. + const ScopedJavaGlobalRef j_video_frame_buffer_; +}; + class AndroidVideoI420Buffer : public I420BufferInterface { public: // Adopts and takes ownership of the Java VideoFrame.Buffer. I.e. retain() @@ -189,6 +230,12 @@ rtc::scoped_refptr AndroidVideoBuffer::ToI420() { return AndroidVideoI420Buffer::Adopt(jni, width_, height_, j_i420_buffer); } +rtc::scoped_refptr JavaToNativeFrameBuffer( + JNIEnv* jni, + const JavaRef& j_video_frame_buffer) { + return AndroidVideoBuffer::Create(jni, j_video_frame_buffer); +} + VideoFrame JavaToNativeFrame(JNIEnv* jni, const JavaRef& j_video_frame, uint32_t timestamp_rtp) { diff --git a/sdk/android/src/jni/video_frame.h b/sdk/android/src/jni/video_frame.h index d1e463bba2..9b916de40b 100644 --- a/sdk/android/src/jni/video_frame.h +++ b/sdk/android/src/jni/video_frame.h @@ -15,56 +15,14 @@ #include "api/video/video_frame.h" #include "api/video/video_frame_buffer.h" -#include "api/video/video_rotation.h" #include "sdk/android/src/jni/jni_helpers.h" namespace webrtc { namespace jni { -class AndroidVideoBuffer : public VideoFrameBuffer { - public: - // Creates a native VideoFrameBuffer from a Java VideoFrame.Buffer. - static rtc::scoped_refptr Create( - JNIEnv* jni, - const JavaRef& j_video_frame_buffer); - - // Similar to the Create() above, but adopts and takes ownership of the Java - // VideoFrame.Buffer. I.e. retain() will not be called, but release() will be - // called when the returned AndroidVideoBuffer is destroyed. - static rtc::scoped_refptr Adopt( - JNIEnv* jni, - const JavaRef& j_video_frame_buffer); - - ~AndroidVideoBuffer() override; - - const ScopedJavaGlobalRef& video_frame_buffer() const; - - // Crops a region defined by |crop_x|, |crop_y|, |crop_width| and - // |crop_height|. Scales it to size |scale_width| x |scale_height|. - rtc::scoped_refptr CropAndScale(int crop_x, - int crop_y, - int crop_width, - int crop_height, - int scale_width, - int scale_height) override; - - protected: - // Should not be called directly. Adopts the Java VideoFrame.Buffer. Use - // Create() or Adopt() instead for clarity. - AndroidVideoBuffer(JNIEnv* jni, const JavaRef& j_video_frame_buffer); - - private: - Type type() const override; - int width() const override; - int height() const override; - - rtc::scoped_refptr ToI420() override; - - const int width_; - const int height_; - // Holds a VideoFrame.Buffer. - const ScopedJavaGlobalRef j_video_frame_buffer_; -}; +rtc::scoped_refptr JavaToNativeFrameBuffer( + JNIEnv* jni, + const JavaRef& j_video_frame_buffer); VideoFrame JavaToNativeFrame(JNIEnv* jni, const JavaRef& j_video_frame, From 48a8047f830d84a7e1c3e97ab9a852be9cdada20 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Fri, 16 Jul 2021 09:03:47 -0700 Subject: [PATCH 0025/1565] Roll chromium_revision 30c3e3e29c..158387e06b (902336:902438) Change log: https://chromium.googlesource.com/chromium/src/+log/30c3e3e29c..158387e06b Full diff: https://chromium.googlesource.com/chromium/src/+/30c3e3e29c..158387e06b Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/aaf3d7311f..90784234b3 * src/build: https://chromium.googlesource.com/chromium/src/build/+log/c0b24c3c75..a728360d58 * src/buildtools: https://chromium.googlesource.com/chromium/src/buildtools/+log/2500c1d8f3..37dc929ecb * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/e2ba281b9f..f7198f68ac * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/d5800742c1..5b7a22b0e5 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/72f9be6111..819399e640 * src/third_party/androidx: 4TJowTg6khWl4yuneqtj7HHyMIuSVpcOie01pubHj-UC..UAMCrUju8eVq7BoerUp34C1tN7f6snsrm-nKamz4gBYC * src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/88e3e03477..7a1b1a88c5 * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/90b2155f7c..3901618837 * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/104d3bd588..e7588e5654 DEPS diff: https://chromium.googlesource.com/chromium/src/+/30c3e3e29c..158387e06b/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: I3f74ce2c187ef90aed36d3f419fd4aa29fd1eca9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226305 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34488} --- DEPS | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/DEPS b/DEPS index 69f207eab7..53ba7783f9 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': '30c3e3e29c6e631bda40ad832f6c52b2dc0d9430', + 'chromium_revision': '158387e06bcdc586b4e2d6760bd4bc9740e697c9', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,24 +20,24 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@aaf3d7311f26f381ec0af67b682bed8cf5c245e6', + 'https://chromium.googlesource.com/chromium/src/base@90784234b333dfb0973002455e6139c52a97ceb8', 'src/build': - 'https://chromium.googlesource.com/chromium/src/build@c0b24c3c75018170c4b74839d61ccbf1721235d2', + 'https://chromium.googlesource.com/chromium/src/build@a728360d58d9283017e7d7c4deb74b1535d0fd03', 'src/buildtools': - 'https://chromium.googlesource.com/chromium/src/buildtools@2500c1d8f3a20a66a7cbafe3f69079a2edb742dd', + 'https://chromium.googlesource.com/chromium/src/buildtools@37dc929ecb351687006a61744b116cda601753d7', # Gradle 6.6.1. Used for testing Android Studio project generation for WebRTC. 'src/examples/androidtests/third_party/gradle': { 'url': 'https://chromium.googlesource.com/external/github.com/gradle/gradle.git@f2d1fb54a951d8b11d25748e4711bec8d128d7e3', 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@e2ba281b9fe2dec1c5e08830db87797c157d7600', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@f7198f68acd2232dda5efc39d7f2e2078a6e821d', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@d5800742c176722eb9d4deb10059cfefdea20874', + 'https://chromium.googlesource.com/chromium/src/testing@5b7a22b0e587056660b5d380488cee1b9b11aeee', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@72f9be6111b539b61a3e8a262167c5252720bcd8', + 'https://chromium.googlesource.com/chromium/src/third_party@819399e64093cfb8427bbc77073398dd9facfd9c', 'src/buildtools/linux64': { 'packages': [ @@ -128,7 +128,7 @@ deps = { 'src/third_party/breakpad/breakpad': 'https://chromium.googlesource.com/breakpad/breakpad.git@b95c4868b10f69e642666742233aede1eb653012', 'src/third_party/catapult': - 'https://chromium.googlesource.com/catapult.git@88e3e034773b9925f8ae6d0e858d9523bece5edc', + 'https://chromium.googlesource.com/catapult.git@7a1b1a88c5cd469e81442471d9a5e01e27ce2b9c', 'src/third_party/ced/src': { 'url': 'https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git@ba412eaaacd3186085babcd901679a48863c7dd5', }, @@ -214,7 +214,7 @@ deps = { 'condition': 'checkout_android', }, 'src/third_party/perfetto': - 'https://android.googlesource.com/platform/external/perfetto.git@90b2155f7c11dbf3b4b1d02131d20a942120ff9c', + 'https://android.googlesource.com/platform/external/perfetto.git@390161883794a40acb72e661d14c39b712cd70ec', 'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@eebc5cd487a89c51ba148f6d6ac45779970f72d7', 'src/third_party/libyuv': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@104d3bd5886da27af53f436a436035638889b7ba', + 'https://chromium.googlesource.com/chromium/src/tools@e7588e5654295db8228d58a706789a337f3470a4', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': '4TJowTg6khWl4yuneqtj7HHyMIuSVpcOie01pubHj-UC', + 'version': 'UAMCrUju8eVq7BoerUp34C1tN7f6snsrm-nKamz4gBYC', }, ], 'condition': 'checkout_android', From 2b4f5130dd4170056b0faaaa67bf9d7b160d415e Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Fri, 16 Jul 2021 17:13:54 +0200 Subject: [PATCH 0026/1565] api/test: Create MockAudioSink Bug: webrtc:9620 Change-Id: Iae339c07c91a42dcb3bb79f0c8003311810224a7 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226324 Commit-Queue: Florent Castelli Reviewed-by: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34489} --- api/BUILD.gn | 12 +++++++++ api/test/compile_all_headers.cc | 1 + api/test/mock_audio_sink.h | 44 +++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 api/test/mock_audio_sink.h diff --git a/api/BUILD.gn b/api/BUILD.gn index c775a1a871..a5e7d91a6d 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -834,6 +834,17 @@ if (rtc_include_tests) { ] } + rtc_source_set("mock_audio_sink") { + testonly = true + sources = [ "test/mock_audio_sink.h" ] + + deps = [ + "../api:media_stream_interface", + "../test:test_support", + ] + absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] + } + rtc_source_set("mock_data_channel") { visibility = [ "*" ] testonly = true @@ -1118,6 +1129,7 @@ if (rtc_include_tests) { ":fake_frame_encryptor", ":mock_async_dns_resolver", ":mock_audio_mixer", + ":mock_audio_sink", ":mock_data_channel", ":mock_frame_decryptor", ":mock_frame_encryptor", diff --git a/api/test/compile_all_headers.cc b/api/test/compile_all_headers.cc index 5ecdcc1eb8..ff4601aa21 100644 --- a/api/test/compile_all_headers.cc +++ b/api/test/compile_all_headers.cc @@ -32,6 +32,7 @@ #include "api/test/fake_frame_encryptor.h" #include "api/test/mock_async_dns_resolver.h" #include "api/test/mock_audio_mixer.h" +#include "api/test/mock_audio_sink.h" #include "api/test/mock_data_channel.h" #include "api/test/mock_frame_decryptor.h" #include "api/test/mock_frame_encryptor.h" diff --git a/api/test/mock_audio_sink.h b/api/test/mock_audio_sink.h new file mode 100644 index 0000000000..0c17dc45ca --- /dev/null +++ b/api/test/mock_audio_sink.h @@ -0,0 +1,44 @@ +/* + * Copyright 2021 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef API_TEST_MOCK_AUDIO_SINK_H_ +#define API_TEST_MOCK_AUDIO_SINK_H_ + +#include "absl/types/optional.h" +#include "api/media_stream_interface.h" +#include "test/gmock.h" + +namespace webrtc { + +class MockAudioSink final : public webrtc::AudioTrackSinkInterface { + public: + MOCK_METHOD(void, + OnData, + (const void* audio_data, + int bits_per_sample, + int sample_rate, + size_t number_of_channels, + size_t number_of_frames), + (override)); + + MOCK_METHOD(void, + OnData, + (const void* audio_data, + int bits_per_sample, + int sample_rate, + size_t number_of_channels, + size_t number_of_frames, + absl::optional absolute_capture_timestamp_ms), + (override)); +}; + +} // namespace webrtc + +#endif // API_TEST_MOCK_AUDIO_SINK_H_ From 29ae340770f3e26f24d16e63549b6c81c140704b Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Fri, 16 Jul 2021 13:01:43 -0700 Subject: [PATCH 0027/1565] Roll chromium_revision 158387e06b..9a6c109576 (902438:902607) Change log: https://chromium.googlesource.com/chromium/src/+log/158387e06b..9a6c109576 Full diff: https://chromium.googlesource.com/chromium/src/+/158387e06b..9a6c109576 Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/90784234b3..064ee1f49c * src/build: https://chromium.googlesource.com/chromium/src/build/+log/a728360d58..0fdda7df84 * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/f7198f68ac..321c1660a9 * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/5b7a22b0e5..79ddd3d8fd * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/819399e640..f8ae5b857c * src/third_party/androidx: UAMCrUju8eVq7BoerUp34C1tN7f6snsrm-nKamz4gBYC..a_MqXpypcBgG1_VAVteEsFfnTeRzsXL9Y7tPf_0Aq0YC * src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/7a1b1a88c5..1ef8e41f0e * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/3901618837..c647483ca5 * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/e7588e5654..922f510d87 * src/tools/luci-go: git_revision:91a04914ac71b7b6fe7b95ce8691d45eeb69bf4f..git_revision:d10ff2af1182ccaad573bc5acb84a36f4c280876 * src/tools/luci-go: git_revision:91a04914ac71b7b6fe7b95ce8691d45eeb69bf4f..git_revision:d10ff2af1182ccaad573bc5acb84a36f4c280876 * src/tools/luci-go: git_revision:91a04914ac71b7b6fe7b95ce8691d45eeb69bf4f..git_revision:d10ff2af1182ccaad573bc5acb84a36f4c280876 DEPS diff: https://chromium.googlesource.com/chromium/src/+/158387e06b..9a6c109576/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: I8c0992e401984d9b106cd3d2ab2b8df1c2e6af39 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226307 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34490} --- DEPS | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/DEPS b/DEPS index 53ba7783f9..2b28fcb6d9 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': '158387e06bcdc586b4e2d6760bd4bc9740e697c9', + 'chromium_revision': '9a6c1095769ee6a4e085a9f694bd1651fff2b627', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,9 +20,9 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@90784234b333dfb0973002455e6139c52a97ceb8', + 'https://chromium.googlesource.com/chromium/src/base@064ee1f49ca6d3b2ba50ea1a236c507dab3d67b1', 'src/build': - 'https://chromium.googlesource.com/chromium/src/build@a728360d58d9283017e7d7c4deb74b1535d0fd03', + 'https://chromium.googlesource.com/chromium/src/build@0fdda7df8447a11caa83cd00cdd3eb384bbb8116', 'src/buildtools': 'https://chromium.googlesource.com/chromium/src/buildtools@37dc929ecb351687006a61744b116cda601753d7', # Gradle 6.6.1. Used for testing Android Studio project generation for WebRTC. @@ -31,13 +31,13 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@f7198f68acd2232dda5efc39d7f2e2078a6e821d', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@321c1660a9f9fb5e7b11a0614e09fd8f0ae92e2a', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@5b7a22b0e587056660b5d380488cee1b9b11aeee', + 'https://chromium.googlesource.com/chromium/src/testing@79ddd3d8fdecfc593d986d908d7817118a3607c8', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@819399e64093cfb8427bbc77073398dd9facfd9c', + 'https://chromium.googlesource.com/chromium/src/third_party@f8ae5b857c329947de0043d2e7135cbf6588f099', 'src/buildtools/linux64': { 'packages': [ @@ -128,7 +128,7 @@ deps = { 'src/third_party/breakpad/breakpad': 'https://chromium.googlesource.com/breakpad/breakpad.git@b95c4868b10f69e642666742233aede1eb653012', 'src/third_party/catapult': - 'https://chromium.googlesource.com/catapult.git@7a1b1a88c5cd469e81442471d9a5e01e27ce2b9c', + 'https://chromium.googlesource.com/catapult.git@1ef8e41f0e93096daf74803fdc794cacb016d8b2', 'src/third_party/ced/src': { 'url': 'https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git@ba412eaaacd3186085babcd901679a48863c7dd5', }, @@ -214,7 +214,7 @@ deps = { 'condition': 'checkout_android', }, 'src/third_party/perfetto': - 'https://android.googlesource.com/platform/external/perfetto.git@390161883794a40acb72e661d14c39b712cd70ec', + 'https://android.googlesource.com/platform/external/perfetto.git@c647483ca5ff97691d327dc2224995e47d3dc899', 'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@eebc5cd487a89c51ba148f6d6ac45779970f72d7', 'src/third_party/libyuv': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@e7588e5654295db8228d58a706789a337f3470a4', + 'https://chromium.googlesource.com/chromium/src/tools@922f510d876d9d7503a5f310ebf551d421a89de6', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'UAMCrUju8eVq7BoerUp34C1tN7f6snsrm-nKamz4gBYC', + 'version': 'a_MqXpypcBgG1_VAVteEsFfnTeRzsXL9Y7tPf_0Aq0YC', }, ], 'condition': 'checkout_android', @@ -477,15 +477,15 @@ deps = { 'packages': [ { 'package': 'infra/tools/luci/isolate/${{platform}}', - 'version': 'git_revision:91a04914ac71b7b6fe7b95ce8691d45eeb69bf4f', + 'version': 'git_revision:d10ff2af1182ccaad573bc5acb84a36f4c280876', }, { 'package': 'infra/tools/luci/isolated/${{platform}}', - 'version': 'git_revision:91a04914ac71b7b6fe7b95ce8691d45eeb69bf4f', + 'version': 'git_revision:d10ff2af1182ccaad573bc5acb84a36f4c280876', }, { 'package': 'infra/tools/luci/swarming/${{platform}}', - 'version': 'git_revision:91a04914ac71b7b6fe7b95ce8691d45eeb69bf4f', + 'version': 'git_revision:d10ff2af1182ccaad573bc5acb84a36f4c280876', }, ], 'dep_type': 'cipd', From 0fc787ba93c8328917a373accc95e8501f4bf4bf Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Fri, 16 Jul 2021 17:36:52 +0200 Subject: [PATCH 0028/1565] api/test: Add Create() method to MockPeerConnectionInterface Bug: webrtc:9620 Change-Id: Id389e433cceed6435f6d07c1eae70c2d582c617f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226323 Commit-Queue: Florent Castelli Reviewed-by: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34491} --- api/BUILD.gn | 2 ++ api/DEPS | 4 ++++ api/test/mock_peerconnectioninterface.h | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/api/BUILD.gn b/api/BUILD.gn index a5e7d91a6d..b80e500527 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -949,6 +949,8 @@ if (rtc_include_tests) { deps = [ ":libjingle_peerconnection_api", + "../api:scoped_refptr", + "../rtc_base:refcount", "../test:test_support", ] } diff --git a/api/DEPS b/api/DEPS index cdd17e9909..e912cd49f8 100644 --- a/api/DEPS +++ b/api/DEPS @@ -271,6 +271,10 @@ specific_include_rules = { "+test/gmock.h", ], + "mock_peerconnectioninterface\.h": [ + "+rtc_base/ref_counted_object.h", + ], + "simulated_network\.h": [ "+rtc_base/random.h", "+rtc_base/thread_annotations.h", diff --git a/api/test/mock_peerconnectioninterface.h b/api/test/mock_peerconnectioninterface.h index b5d94238c8..cd67d32a10 100644 --- a/api/test/mock_peerconnectioninterface.h +++ b/api/test/mock_peerconnectioninterface.h @@ -18,7 +18,9 @@ #include #include "api/peer_connection_interface.h" +#include "api/scoped_refptr.h" #include "api/sctp_transport_interface.h" +#include "rtc_base/ref_counted_object.h" #include "test/gmock.h" namespace webrtc { @@ -26,6 +28,10 @@ namespace webrtc { class MockPeerConnectionInterface : public rtc::RefCountedObject { public: + static rtc::scoped_refptr Create() { + return new MockPeerConnectionInterface(); + } + // PeerConnectionInterface MOCK_METHOD(rtc::scoped_refptr, local_streams, From edd9250cc6279bc713d32499823484de2dc75169 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Fri, 16 Jul 2021 17:03:12 -0700 Subject: [PATCH 0029/1565] Roll chromium_revision 9a6c109576..f60544555b (902607:902743) Change log: https://chromium.googlesource.com/chromium/src/+log/9a6c109576..f60544555b Full diff: https://chromium.googlesource.com/chromium/src/+/9a6c109576..f60544555b Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/064ee1f49c..4045370905 * src/build: https://chromium.googlesource.com/chromium/src/build/+log/0fdda7df84..fd86d60f33 * src/buildtools/third_party/libc++abi/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git/+log/486cb62885..7d5c92f6cf * src/buildtools/third_party/libunwind/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git/+log/70006b7957..d7b11d7989 * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/321c1660a9..a543d33a9c * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/79ddd3d8fd..bb9c57349c * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/f8ae5b857c..3401b3a22f * src/third_party/libjpeg_turbo: https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git/+log/e9e400e0af..ad8b3b0f84 * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/922f510d87..20bde85c52 DEPS diff: https://chromium.googlesource.com/chromium/src/+/9a6c109576..f60544555b/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: I8da37c2e4edc8249f8b8cfdbba3b92edf8089984 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226309 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34492} --- DEPS | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/DEPS b/DEPS index 2b28fcb6d9..ea3bc767e1 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': '9a6c1095769ee6a4e085a9f694bd1651fff2b627', + 'chromium_revision': 'f60544555bae6ed83d17c2b169fbc3190c98af9a', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,9 +20,9 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@064ee1f49ca6d3b2ba50ea1a236c507dab3d67b1', + 'https://chromium.googlesource.com/chromium/src/base@4045370905def8e415021737f13e02ed6444a45c', 'src/build': - 'https://chromium.googlesource.com/chromium/src/build@0fdda7df8447a11caa83cd00cdd3eb384bbb8116', + 'https://chromium.googlesource.com/chromium/src/build@fd86d60f33cbc794537c4da2ef7e298d7f81138e', 'src/buildtools': 'https://chromium.googlesource.com/chromium/src/buildtools@37dc929ecb351687006a61744b116cda601753d7', # Gradle 6.6.1. Used for testing Android Studio project generation for WebRTC. @@ -31,13 +31,13 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@321c1660a9f9fb5e7b11a0614e09fd8f0ae92e2a', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@a543d33a9c452924f0d42b40d405a9c75a6cad9e', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@79ddd3d8fdecfc593d986d908d7817118a3607c8', + 'https://chromium.googlesource.com/chromium/src/testing@bb9c57349c71bf1550a80afcf435343a10e25ee7', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@f8ae5b857c329947de0043d2e7135cbf6588f099', + 'https://chromium.googlesource.com/chromium/src/third_party@3401b3a22f018229116f0be8a31beb8117e76181', 'src/buildtools/linux64': { 'packages': [ @@ -75,9 +75,9 @@ deps = { 'src/buildtools/third_party/libc++/trunk': 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git@79a2e924d96e2fc1e4b937c42efd08898fa472d7', 'src/buildtools/third_party/libc++abi/trunk': - 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git@486cb6288513c44a65f36dd9c75c111fb7df794c', + 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git@7d5c92f6cfb1ddb73158233a194bb568c5b13554', 'src/buildtools/third_party/libunwind/trunk': - 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git@70006b7957faf73ffa9830063545f5dec0c72155', + 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git@d7b11d7989774617bd7df93af95734faac8c0b2c', 'src/tools/clang/dsymutil': { 'packages': [ @@ -204,7 +204,7 @@ deps = { 'src/third_party/libFuzzer/src': 'https://chromium.googlesource.com/chromium/llvm-project/compiler-rt/lib/fuzzer.git@debe7d2d1982e540fbd6bd78604bf001753f9e74', 'src/third_party/libjpeg_turbo': - 'https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git@e9e400e0af31baf72d235655850bc00e55b6c145', + 'https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git@ad8b3b0f84baf155f3bde5626c3bf9d20535bcae', 'src/third_party/libsrtp': 'https://chromium.googlesource.com/chromium/deps/libsrtp.git@5b7c744eb8310250ccc534f3f86a2015b3887a0a', 'src/third_party/libaom/source/libaom': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@922f510d876d9d7503a5f310ebf551d421a89de6', + 'https://chromium.googlesource.com/chromium/src/tools@20bde85c52520d0ad3e2602b0ce99f1c0db876ea', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', From 523a5886c319de861cf7560e61e1f646bcd39758 Mon Sep 17 00:00:00 2001 From: webrtc-version-updater Date: Fri, 16 Jul 2021 21:04:22 -0700 Subject: [PATCH 0030/1565] Update WebRTC code version (2021-07-17T04:04:21). TBR=webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com,mbonadei@webrtc.org Bug: None Change-Id: Id01e5d736dffcbb700140d4bbee46d2189ee883d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226311 Reviewed-by: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Commit-Queue: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Cr-Commit-Position: refs/heads/master@{#34493} --- call/version.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/call/version.cc b/call/version.cc index 70e3457a53..a19de55703 100644 --- a/call/version.cc +++ b/call/version.cc @@ -13,7 +13,7 @@ namespace webrtc { // The timestamp is always in UTC. -const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-16T04:04:25"; +const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-17T04:04:21"; void LoadWebRTCVersionInRegister() { // Using volatile to instruct the compiler to not optimize `p` away even From 63cc46c1f5b0ed5012465f391d5fd7c5717aeab4 Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Sat, 17 Jul 2021 01:32:40 +0200 Subject: [PATCH 0031/1565] api/test: Move MockVideoTrack to its own file for sharing Bug: webrtc:9620 Change-Id: Iebe11d3e481dd8046771ded2608a4c57288cd22d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226325 Reviewed-by: Taylor Brandstetter Reviewed-by: Mirko Bonadei Commit-Queue: Florent Castelli Cr-Commit-Position: refs/heads/master@{#34494} --- api/BUILD.gn | 15 +++++++ api/DEPS | 4 ++ api/test/compile_all_headers.cc | 1 + api/test/mock_video_track.h | 69 +++++++++++++++++++++++++++++ pc/BUILD.gn | 1 + pc/track_media_info_map_unittest.cc | 42 +----------------- 6 files changed, 92 insertions(+), 40 deletions(-) create mode 100644 api/test/mock_video_track.h diff --git a/api/BUILD.gn b/api/BUILD.gn index b80e500527..fa9279004a 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -1057,6 +1057,20 @@ if (rtc_include_tests) { ] } + rtc_library("mock_video_track") { + visibility = [ "*" ] + + testonly = true + sources = [ "test/mock_video_track.h" ] + + deps = [ + "../api:media_stream_interface", + "../api:scoped_refptr", + "../rtc_base:refcount", + "../test:test_support", + ] + } + rtc_library("create_time_controller") { visibility = [ "*" ] testonly = true @@ -1145,6 +1159,7 @@ if (rtc_include_tests) { ":mock_video_codec_factory", ":mock_video_decoder", ":mock_video_encoder", + ":mock_video_track", ":rtc_api_unittests", "units:units_unittests", ] diff --git a/api/DEPS b/api/DEPS index e912cd49f8..d201a4413a 100644 --- a/api/DEPS +++ b/api/DEPS @@ -275,6 +275,10 @@ specific_include_rules = { "+rtc_base/ref_counted_object.h", ], + "mock_video_track\.h": [ + "+rtc_base/ref_counted_object.h", + ], + "simulated_network\.h": [ "+rtc_base/random.h", "+rtc_base/thread_annotations.h", diff --git a/api/test/compile_all_headers.cc b/api/test/compile_all_headers.cc index ff4601aa21..9275eb0791 100644 --- a/api/test/compile_all_headers.cc +++ b/api/test/compile_all_headers.cc @@ -49,3 +49,4 @@ #include "api/test/mock_video_decoder_factory.h" #include "api/test/mock_video_encoder.h" #include "api/test/mock_video_encoder_factory.h" +#include "api/test/mock_video_track.h" diff --git a/api/test/mock_video_track.h b/api/test/mock_video_track.h new file mode 100644 index 0000000000..58a531bf42 --- /dev/null +++ b/api/test/mock_video_track.h @@ -0,0 +1,69 @@ +/* + * Copyright 2021 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#ifndef API_TEST_MOCK_VIDEO_TRACK_H_ +#define API_TEST_MOCK_VIDEO_TRACK_H_ + +#include + +#include "api/media_stream_interface.h" +#include "api/scoped_refptr.h" +#include "rtc_base/ref_counted_object.h" +#include "test/gmock.h" + +namespace webrtc { + +class MockVideoTrack final + : public rtc::RefCountedObject { + public: + static rtc::scoped_refptr Create() { + return new MockVideoTrack(); + } + + // NotifierInterface + MOCK_METHOD(void, + RegisterObserver, + (ObserverInterface * observer), + (override)); + MOCK_METHOD(void, + UnregisterObserver, + (ObserverInterface * observer), + (override)); + + // MediaStreamTrackInterface + MOCK_METHOD(std::string, kind, (), (const, override)); + MOCK_METHOD(std::string, id, (), (const, override)); + MOCK_METHOD(bool, enabled, (), (const, override)); + MOCK_METHOD(bool, set_enabled, (bool enable), (override)); + MOCK_METHOD(TrackState, state, (), (const, override)); + + // VideoSourceInterface + MOCK_METHOD(void, + AddOrUpdateSink, + (rtc::VideoSinkInterface * sink, + const rtc::VideoSinkWants& wants), + (override)); + // RemoveSink must guarantee that at the time the method returns, + // there is no current and no future calls to VideoSinkInterface::OnFrame. + MOCK_METHOD(void, + RemoveSink, + (rtc::VideoSinkInterface * sink), + (override)); + + // VideoTrackInterface + MOCK_METHOD(VideoTrackSourceInterface*, GetSource, (), (const, override)); + + MOCK_METHOD(ContentHint, content_hint, (), (const, override)); + MOCK_METHOD(void, set_content_hint, (ContentHint hint), (override)); +}; + +} // namespace webrtc + +#endif // API_TEST_MOCK_VIDEO_TRACK_H_ diff --git a/pc/BUILD.gn b/pc/BUILD.gn index 460462e54a..d5d11f6156 100644 --- a/pc/BUILD.gn +++ b/pc/BUILD.gn @@ -1094,6 +1094,7 @@ if (rtc_include_tests && !build_with_chromium) { "../api:libjingle_peerconnection_api", "../api:media_stream_interface", "../api:mock_rtp", + "../api:mock_video_track", "../api:packet_socket_factory", "../api:rtc_error", "../api:rtp_transceiver_direction", diff --git a/pc/track_media_info_map_unittest.cc b/pc/track_media_info_map_unittest.cc index 1d5caacddb..a0e37a23c1 100644 --- a/pc/track_media_info_map_unittest.cc +++ b/pc/track_media_info_map_unittest.cc @@ -17,6 +17,7 @@ #include #include "api/rtp_sender_interface.h" +#include "api/test/mock_video_track.h" #include "api/transport/rtp/rtp_source.h" #include "media/base/media_channel.h" #include "pc/audio_track.h" @@ -31,45 +32,6 @@ namespace webrtc { namespace { -class MockVideoTrack : public VideoTrackInterface { - public: - // NotifierInterface - MOCK_METHOD(void, - RegisterObserver, - (ObserverInterface * observer), - (override)); - MOCK_METHOD(void, - UnregisterObserver, - (ObserverInterface * observer), - (override)); - - // MediaStreamTrackInterface - MOCK_METHOD(std::string, kind, (), (const, override)); - MOCK_METHOD(std::string, id, (), (const, override)); - MOCK_METHOD(bool, enabled, (), (const, override)); - MOCK_METHOD(bool, set_enabled, (bool enable), (override)); - MOCK_METHOD(TrackState, state, (), (const, override)); - - // VideoSourceInterface - MOCK_METHOD(void, - AddOrUpdateSink, - (rtc::VideoSinkInterface * sink, - const rtc::VideoSinkWants& wants), - (override)); - // RemoveSink must guarantee that at the time the method returns, - // there is no current and no future calls to VideoSinkInterface::OnFrame. - MOCK_METHOD(void, - RemoveSink, - (rtc::VideoSinkInterface * sink), - (override)); - - // VideoTrackInterface - MOCK_METHOD(VideoTrackSourceInterface*, GetSource, (), (const, override)); - - MOCK_METHOD(ContentHint, content_hint, (), (const, override)); - MOCK_METHOD(void, set_content_hint, (ContentHint hint), (override)); -}; - RtpParameters CreateRtpParametersWithSsrcs( std::initializer_list ssrcs) { RtpParameters params; @@ -126,7 +88,7 @@ rtc::scoped_refptr CreateVideoTrack( rtc::scoped_refptr CreateMockVideoTrack( const std::string& id) { - auto track = rtc::make_ref_counted(); + auto track = MockVideoTrack::Create(); EXPECT_CALL(*track, kind()) .WillRepeatedly(::testing::Return(VideoTrack::kVideoKind)); return track; From 093f524ec8f42e72bf033dcb33984da1717d76ea Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Sat, 17 Jul 2021 00:48:10 +0200 Subject: [PATCH 0032/1565] api/test: Fix visibility of MockAudioSink Bug: webrtc:9620 Change-Id: Iaff79457b37937f0d0dc6734ea34ede61aff883d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226326 Reviewed-by: Taylor Brandstetter Commit-Queue: Florent Castelli Cr-Commit-Position: refs/heads/master@{#34495} --- api/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/api/BUILD.gn b/api/BUILD.gn index fa9279004a..767056fb44 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -835,6 +835,7 @@ if (rtc_include_tests) { } rtc_source_set("mock_audio_sink") { + visibility = [ "*" ] testonly = true sources = [ "test/mock_audio_sink.h" ] From 62af58448ed0502a96daa50dfd22bd291fb954e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Spr=C3=A5ng?= Date: Sat, 17 Jul 2021 16:31:45 +0000 Subject: [PATCH 0033/1565] Revert "Rename vp9::FrameInfo to vp9::UncompressedHeader and add more fields." MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 3097008de03b6260da5cfabb5cbac6f6a64ca810. Reason for revert: suspected crash Bug: chromium:1230239 TBR=philipel@webrtc.org Original change's description: > Rename vp9::FrameInfo to vp9::UncompressedHeader and add more fields. > > These fields will be used for bitstream validation in upcoming CLs. > A new vp9_constants.h file is also added, containing common constants > defined by the bitstream spec. > > Bug: webrtc:12354 > Change-Id: If04256d83409069c8bee43ad41aed41c3707dfd3 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226060 > Commit-Queue: Erik Språng > Reviewed-by: Philip Eliasson > Cr-Commit-Position: refs/heads/master@{#34476} # Not skipping CQ checks because original CL landed > 1 day ago. Bug: webrtc:12354 Change-Id: Ia4d5180d593c66a053d5747e714a579c62ea2a37 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226327 Reviewed-by: Erik Språng Commit-Queue: Erik Språng Cr-Commit-Position: refs/heads/master@{#34496} --- modules/video_coding/BUILD.gn | 1 - .../codecs/vp9/libvpx_vp9_decoder.cc | 4 +- modules/video_coding/utility/vp9_constants.h | 200 --------- .../utility/vp9_uncompressed_header_parser.cc | 391 ++++-------------- .../utility/vp9_uncompressed_header_parser.h | 83 +--- ...vp9_uncompressed_header_parser_unittest.cc | 46 +-- 6 files changed, 94 insertions(+), 631 deletions(-) delete mode 100644 modules/video_coding/utility/vp9_constants.h diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index 5154b51933..50f2e8d836 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -334,7 +334,6 @@ rtc_library("video_coding_utility") { "utility/simulcast_utility.h", "utility/vp8_header_parser.cc", "utility/vp8_header_parser.h", - "utility/vp9_constants.h", "utility/vp9_uncompressed_header_parser.cc", "utility/vp9_uncompressed_header_parser.h", ] diff --git a/modules/video_coding/codecs/vp9/libvpx_vp9_decoder.cc b/modules/video_coding/codecs/vp9/libvpx_vp9_decoder.cc index d10d8d10d8..3500ef5919 100644 --- a/modules/video_coding/codecs/vp9/libvpx_vp9_decoder.cc +++ b/modules/video_coding/codecs/vp9/libvpx_vp9_decoder.cc @@ -206,8 +206,8 @@ int LibvpxVp9Decoder::Decode(const EncodedImage& input_image, } if (input_image._frameType == VideoFrameType::kVideoFrameKey) { - absl::optional frame_info = - vp9::ParseUncompressedHeader(input_image.data(), input_image.size()); + absl::optional frame_info = + vp9::ParseIntraFrameInfo(input_image.data(), input_image.size()); if (frame_info) { if (frame_info->frame_width != current_codec_.width || frame_info->frame_height != current_codec_.height) { diff --git a/modules/video_coding/utility/vp9_constants.h b/modules/video_coding/utility/vp9_constants.h deleted file mode 100644 index 999e780cb7..0000000000 --- a/modules/video_coding/utility/vp9_constants.h +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (c) 2021 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef MODULES_VIDEO_CODING_UTILITY_VP9_CONSTANTS_H_ -#define MODULES_VIDEO_CODING_UTILITY_VP9_CONSTANTS_H_ - -#include -#include - -#include - -namespace webrtc { -namespace vp9 { - -// Number of frames that can be stored for future reference. -static constexpr size_t kNumRefFrames = 8; -// Number of frame contexts that can be store for future reference. -static constexpr size_t kNumFrameContexts = 4; -// Each inter frame can use up to 3 frames for reference. -constexpr size_t kRefsPerFrame = 3; -// Number of values that can be decoded for mv_fr. -constexpr size_t kMvFrSize = 4; -// Number of positions to search in motion vector prediction. -constexpr size_t kMvrefNeighbours = 8; -// Number of contexts when decoding intra_mode . -constexpr size_t kBlockSizeGroups = 4; -// Number of different block sizes used. -constexpr size_t kBlockSizes = 13; -// Sentinel value to mark partition choices that are illegal. -constexpr size_t kBlockInvalid = 14; -// Number of contexts when decoding partition. -constexpr size_t kPartitionContexts = 16; -// Smallest size of a mode info block. -constexpr size_t kMiSize = 8; -// Minimum width of a tile in units of superblocks (although tiles on -// the right hand edge can be narrower). -constexpr size_t kMinTileWidth_B64 = 4; -// Maximum width of a tile in units of superblocks. -constexpr size_t kMaxTileWidth_B64 = 64; -// Number of motion vectors returned by find_mv_refs process. -constexpr size_t kMaxMvRefCandidates = 2; -// Number of values that can be derived for ref_frame. -constexpr size_t kMaxRefFrames = 4; -// Number of contexts for is_inter. -constexpr size_t kIsInterContexts = 4; -// Number of contexts for comp_mode. -constexpr size_t kCompModeContexts = 5; -// Number of contexts for single_ref and comp_ref. -constexpr size_t kRefContexts = 5; -// Number of segments allowed in segmentation map. -constexpr size_t kMaxSegments = 8; -// Index for quantizer segment feature. -constexpr size_t kSegLvlAlt_Q = 0; -// Index for loop filter segment feature. -constexpr size_t kSegLvlAlt_L = 1; -// Index for reference frame segment feature. -constexpr size_t kSegLvlRefFrame = 2; -// Index for skip segment feature. -constexpr size_t kSegLvlSkip = 3; -// Number of segment features. -constexpr size_t kSegLvlMax = 4; -// Number of different plane types (Y or UV). -constexpr size_t kBlockTypes = 2; -// Number of different prediction types (intra or inter). -constexpr size_t kRefTypes = 2; -// Number of coefficient bands. -constexpr size_t kCoefBands = 6; -// Number of contexts for decoding coefficients. -constexpr size_t kPrevCoefContexts = 6; -// Number of coefficient probabilities that are directly transmitted. -constexpr size_t kUnconstrainedNodes = 3; -// Number of contexts for transform size. -constexpr size_t kTxSizeContexts = 2; -// Number of values for interp_filter. -constexpr size_t kSwitchableFilters = 3; -// Number of contexts for interp_filter. -constexpr size_t kInterpFilterContexts = 4; -// Number of contexts for decoding skip. -constexpr size_t kSkipContexts = 3; -// Number of values for partition. -constexpr size_t kPartitionTypes = 4; -// Number of values for tx_size. -constexpr size_t kTxSizes = 4; -// Number of values for tx_mode. -constexpr size_t kTxModes = 5; -// Inverse transform rows with DCT and columns with DCT. -constexpr size_t kDctDct = 0; -// Inverse transform rows with DCT and columns with ADST. -constexpr size_t kAdstDct = 1; -// Inverse transform rows with ADST and columns with DCT. -constexpr size_t kDctAdst = 2; -// Inverse transform rows with ADST and columns with ADST. -constexpr size_t kAdstAdst = 3; -// Number of values for y_mode. -constexpr size_t kMbModeCount = 14; -// Number of values for intra_mode. -constexpr size_t kIntraModes = 10; -// Number of values for inter_mode. -constexpr size_t kInterModes = 4; -// Number of contexts for inter_mode. -constexpr size_t kInterModeContexts = 7; -// Number of values for mv_joint. -constexpr size_t kMvJoints = 4; -// Number of values for mv_class. -constexpr size_t kMvClasses = 11; -// Number of values for mv_class0_bit. -constexpr size_t kClass0Size = 2; -// Maximum number of bits for decoding motion vectors. -constexpr size_t kMvOffsetBits = 10; -// Number of values allowed for a probability adjustment. -constexpr size_t kMaxProb = 255; -// Number of different mode types for loop filtering. -constexpr size_t kMaxModeLfDeltas = 2; -// Threshold at which motion vectors are considered large. -constexpr size_t kCompandedMvrefThresh = 8; -// Maximum value used for loop filtering. -constexpr size_t kMaxLoopFilter = 63; -// Number of bits of precision when scaling reference frames. -constexpr size_t kRefScaleShift = 14; -// Number of bits of precision when performing inter prediction. -constexpr size_t kSubpelBits = 4; -// 1 << kSubpelBits. -constexpr size_t kSubpelShifts = 16; -// kSubpelShifts - 1. -constexpr size_t kSubpelMask = 15; -// Value used when clipping motion vectors. -constexpr size_t kMvBorder = 128; -// Value used when clipping motion vectors. -constexpr size_t kInterpExtend = 4; -// Value used when clipping motion vectors. -constexpr size_t kBorderinpixels = 160; -// Value used in adapting probabilities. -constexpr size_t kMaxUpdateFactor = 128; -// Value used in adapting probabilities. -constexpr size_t kCountSat = 20; -// Both candidates use ZEROMV. -constexpr size_t kBothZero = 0; -// One candidate uses ZEROMV, one uses NEARMV or NEARESTMV. -constexpr size_t kZeroPlusPredicted = 1; -// Both candidates use NEARMV or NEARESTMV. -constexpr size_t kBothPredicted = 2; -// One candidate uses NEWMV, one uses ZEROMV. -constexpr size_t kNewPlusNonIntra = 3; -// Both candidates use NEWMV. -constexpr size_t kBothNew = 4; -// One candidate uses intra prediction, one uses inter prediction. -constexpr size_t kIntraPlusNonIntra = 5; -// Both candidates use intra prediction. -constexpr size_t kBothIntra = 6; -// Sentinel value marking a case that can never occur. -constexpr size_t kInvalidCase = 9; - -enum class TxMode : uint8_t { - kOnly4X4 = 0, - kAllow8X8 = 1, - kAllow16x16 = 2, - kAllow32x32 = 3, - kTxModeSelect = 4 -}; - -enum BlockSize : uint8_t { - kBlock4X4 = 0, - kBlock4X8 = 1, - kBlock8X4 = 2, - kBlock8X8 = 3, - kBlock8X16 = 4, - kBlock16X8 = 5, - kBlock16X16 = 6, - kBlock16X32 = 7, - kBlock32X16 = 8, - kBlock32X32 = 9, - kBlock32X64 = 10, - kBlock64X32 = 11, - kBlock64X64 = 12 -}; - -enum Partition : uint8_t { - kPartitionNone = 0, - kPartitionHorizontal = 1, - kPartitionVertical = 2, - kPartitionSplit = 3 -}; - -enum class ReferenceMode : uint8_t { - kSingleReference = 0, - kCompoundReference = 1, - kReferenceModeSelect = 2, -}; - -} // namespace vp9 -} // namespace webrtc - -#endif // MODULES_VIDEO_CODING_UTILITY_VP9_CONSTANTS_H_ diff --git a/modules/video_coding/utility/vp9_uncompressed_header_parser.cc b/modules/video_coding/utility/vp9_uncompressed_header_parser.cc index 7fbdd58951..07ba3255c6 100644 --- a/modules/video_coding/utility/vp9_uncompressed_header_parser.cc +++ b/modules/video_coding/utility/vp9_uncompressed_header_parser.cc @@ -12,7 +12,6 @@ #include "absl/strings/string_view.h" #include "rtc_base/bit_buffer.h" #include "rtc_base/logging.h" -#include "rtc_base/strings/string_builder.h" namespace webrtc { @@ -153,15 +152,11 @@ class BitstreamReader { // Returns true if full number of bits were read, false otherwise. bool ConsumeBits(int bits) { return buffer_->ConsumeBits(bits); } - void GetPosition(size_t* out_byte_offset, size_t* out_bit_offset) const { - buffer_->GetCurrentOffset(out_byte_offset, out_bit_offset); - } - private: rtc::BitBuffer* buffer_; }; -bool Vp9ReadColorConfig(BitstreamReader* br, UncompressedHeader* frame_info) { +bool Vp9ReadColorConfig(BitstreamReader* br, FrameInfo* frame_info) { if (frame_info->profile == 2 || frame_info->profile == 3) { READ_OR_RETURN(br->ReadBoolean(), [frame_info](bool ten_or_twelve_bits) { frame_info->bit_detph = @@ -224,18 +219,7 @@ bool Vp9ReadColorConfig(BitstreamReader* br, UncompressedHeader* frame_info) { return true; } -bool ReadRefreshFrameFlags(BitstreamReader* br, - UncompressedHeader* frame_info) { - // Refresh frame flags. - READ_OR_RETURN(br->ReadUnsigned(), [frame_info](uint8_t flags) { - for (int i = 0; i < 8; ++i) { - frame_info->updated_buffers.set(i, (flags & (0x01 << (7 - i))) != 0); - } - }); - return true; -} - -bool Vp9ReadFrameSize(BitstreamReader* br, UncompressedHeader* frame_info) { +bool Vp9ReadFrameSize(BitstreamReader* br, FrameInfo* frame_info) { // 16 bits: frame (width|height) - 1. READ_OR_RETURN(br->ReadUnsigned(), [frame_info](uint16_t width) { frame_info->frame_width = width + 1; @@ -246,12 +230,10 @@ bool Vp9ReadFrameSize(BitstreamReader* br, UncompressedHeader* frame_info) { return true; } -bool Vp9ReadRenderSize(BitstreamReader* br, UncompressedHeader* frame_info) { +bool Vp9ReadRenderSize(BitstreamReader* br, FrameInfo* frame_info) { // render_and_frame_size_different return br->IfNextBoolean( [&] { - auto& pos = frame_info->render_size_position.emplace(); - br->GetPosition(&pos.byte_offset, &pos.bit_offset); // 16 bits: render (width|height) - 1. READ_OR_RETURN(br->ReadUnsigned(), [frame_info](uint16_t width) { @@ -271,16 +253,11 @@ bool Vp9ReadRenderSize(BitstreamReader* br, UncompressedHeader* frame_info) { }); } -bool Vp9ReadFrameSizeFromRefs(BitstreamReader* br, - UncompressedHeader* frame_info) { +bool Vp9ReadFrameSizeFromRefs(BitstreamReader* br, FrameInfo* frame_info) { bool found_ref = false; for (size_t i = 0; !found_ref && i < kVp9NumRefsPerFrame; i++) { // Size in refs. - br->IfNextBoolean([&] { - frame_info->infer_size_from_reference = frame_info->reference_buffers[i]; - found_ref = true; - return true; - }); + READ_OR_RETURN(br->ReadBoolean(), [&](bool ref) { found_ref = ref; }); } if (!found_ref) { @@ -309,104 +286,58 @@ bool Vp9ReadLoopfilter(BitstreamReader* br) { }); } -bool Vp9ReadQp(BitstreamReader* br, UncompressedHeader* frame_info) { +bool Vp9ReadQp(BitstreamReader* br, FrameInfo* frame_info) { READ_OR_RETURN(br->ReadUnsigned(), [frame_info](uint8_t qp) { frame_info->base_qp = qp; }); // yuv offsets - frame_info->is_lossless = frame_info->base_qp == 0; for (int i = 0; i < 3; ++i) { - RETURN_IF_FALSE(br->IfNextBoolean([&] { // if delta_coded - READ_OR_RETURN(br->ReadUnsigned(4), [&](int delta) { - if (delta != 0) { - frame_info->is_lossless = false; - } - }); - return true; + RETURN_IF_FALSE(br->IfNextBoolean([br] { // if delta_coded + return br->ConsumeBits(5); })); } return true; } -bool Vp9ReadSegmentationParams(BitstreamReader* br, - UncompressedHeader* frame_info) { - constexpr int kSegmentationFeatureBits[kSegLvlMax] = {8, 6, 2, 0}; - constexpr bool kSegmentationFeatureSigned[kSegLvlMax] = {1, 1, 0, 0}; +bool Vp9ReadSegmentationParams(BitstreamReader* br) { + constexpr int kVp9MaxSegments = 8; + constexpr int kVp9SegLvlMax = 4; + constexpr int kSegmentationFeatureBits[kVp9SegLvlMax] = {8, 6, 2, 0}; + constexpr bool kSegmentationFeatureSigned[kVp9SegLvlMax] = {1, 1, 0, 0}; - return br->IfNextBoolean([&] { // segmentation_enabled - frame_info->segmentation_enabled = true; - RETURN_IF_FALSE(br->IfNextBoolean([&] { // update_map - frame_info->segmentation_tree_probs.emplace(); + RETURN_IF_FALSE(br->IfNextBoolean([&] { // segmentation_enabled + return br->IfNextBoolean([&] { // update_map + // Consume probs. for (int i = 0; i < 7; ++i) { - RETURN_IF_FALSE(br->IfNextBoolean( - [&] { - READ_OR_RETURN(br->ReadUnsigned(), [&](uint8_t prob) { - (*frame_info->segmentation_tree_probs)[i] = prob; - }); - return true; - }, - [&] { - (*frame_info->segmentation_tree_probs)[i] = 255; - return true; - })); + RETURN_IF_FALSE(br->IfNextBoolean([br] { return br->ConsumeBits(7); })); } - // temporal_update - return br->IfNextBoolean( - [&] { - frame_info->segmentation_pred_prob.emplace(); - for (int i = 0; i < 3; ++i) { - RETURN_IF_FALSE(br->IfNextBoolean( - [&] { - READ_OR_RETURN( - br->ReadUnsigned(), [&](uint8_t prob) { - (*frame_info->segmentation_pred_prob)[i] = prob; - }); - return true; - }, - [&] { - (*frame_info->segmentation_pred_prob)[i] = 255; - return true; - })); - } - return true; - }, - [&] { - frame_info->segmentation_pred_prob->fill(255); - return true; - }); - })); - - return br->IfNextBoolean([&] { // segmentation_update_data - RETURN_IF_FALSE(br->IfNextBoolean([&] { - frame_info->segmentation_is_delta = true; - return true; - })); - - for (size_t i = 0; i < kMaxSegments; ++i) { - for (size_t j = 0; j < kSegLvlMax; ++j) { - RETURN_IF_FALSE(br->IfNextBoolean([&] { // feature_enabled - READ_OR_RETURN( - br->ReadUnsigned(kSegmentationFeatureBits[j]), - [&](uint8_t feature_value) { - frame_info->segmentation_features[i][j] = feature_value; - }); - if (kSegmentationFeatureSigned[j]) { - RETURN_IF_FALSE(br->IfNextBoolean([&] { - (*frame_info->segmentation_features[i][j]) *= -1; - return true; - })); - } - return true; - })); + return br->IfNextBoolean([&] { // temporal_update + // Consume probs. + for (int i = 0; i < 3; ++i) { + RETURN_IF_FALSE( + br->IfNextBoolean([br] { return br->ConsumeBits(7); })); } - } - return true; + return true; + }); }); + })); + + return br->IfNextBoolean([&] { + RETURN_IF_FALSE(br->ConsumeBits(1)); // abs_or_delta + for (int i = 0; i < kVp9MaxSegments; ++i) { + for (int j = 0; j < kVp9SegLvlMax; ++j) { + RETURN_IF_FALSE(br->IfNextBoolean([&] { // feature_enabled + return br->ConsumeBits(kSegmentationFeatureBits[j] + + kSegmentationFeatureSigned[j]); + })); + } + } + return true; }); } -bool Vp9ReadTileInfo(BitstreamReader* br, UncompressedHeader* frame_info) { +bool Vp9ReadTileInfo(BitstreamReader* br, FrameInfo* frame_info) { size_t mi_cols = (frame_info->frame_width + 7) >> 3; size_t sb64_cols = (mi_cols + 7) >> 3; @@ -421,12 +352,12 @@ bool Vp9ReadTileInfo(BitstreamReader* br, UncompressedHeader* frame_info) { } --max_log2; - frame_info->tile_cols_log2 = min_log2; + size_t cols_log2 = min_log2; bool done = false; - while (!done && frame_info->tile_cols_log2 < max_log2) { + while (!done && cols_log2 < max_log2) { RETURN_IF_FALSE(br->IfNextBoolean( [&] { - ++frame_info->tile_cols_log2; + ++cols_log2; return true; }, [&] { @@ -434,157 +365,13 @@ bool Vp9ReadTileInfo(BitstreamReader* br, UncompressedHeader* frame_info) { return true; })); } - frame_info->tile_rows_log2 = 0; - RETURN_IF_FALSE(br->IfNextBoolean([&] { - ++frame_info->tile_rows_log2; - return br->IfNextBoolean([&] { - ++frame_info->tile_rows_log2; - return true; - }); - })); - return true; -} - -const InterpolationFilter kLiteralToType[4] = { - InterpolationFilter::kEightTapSmooth, InterpolationFilter::kEightTap, - InterpolationFilter::kEightTapSharp, InterpolationFilter::kBilinear}; -} // namespace - -std::string UncompressedHeader::ToString() const { - char buf[1024]; - rtc::SimpleStringBuilder oss(buf); - - oss << "Vp9UncompressedHeader { " - << "profile = " << profile; - - if (show_existing_frame) { - oss << ", show_existing_frame = " << *show_existing_frame << " }"; - return oss.str(); - } - - oss << ", frame type = " << (is_keyframe ? "key" : "delta") - << ", show_frame = " << (show_frame ? "true" : "false") - << ", error_resilient = " << (error_resilient ? "true" : "false"); - - oss << ", bit_depth = "; - switch (bit_detph) { - case BitDept::k8Bit: - oss << "8bit"; - break; - case BitDept::k10Bit: - oss << "10bit"; - break; - case BitDept::k12Bit: - oss << "12bit"; - break; - } - - if (color_space) { - oss << ", color_space = "; - switch (*color_space) { - case ColorSpace::CS_UNKNOWN: - oss << "unknown"; - break; - case ColorSpace::CS_BT_601: - oss << "CS_BT_601 Rec. ITU-R BT.601-7"; - break; - case ColorSpace::CS_BT_709: - oss << "Rec. ITU-R BT.709-6"; - break; - case ColorSpace::CS_SMPTE_170: - oss << "SMPTE-170"; - break; - case ColorSpace::CS_SMPTE_240: - oss << "SMPTE-240"; - break; - case ColorSpace::CS_BT_2020: - oss << "Rec. ITU-R BT.2020-2"; - break; - case ColorSpace::CS_RESERVED: - oss << "Reserved"; - break; - case ColorSpace::CS_RGB: - oss << "sRGB (IEC 61966-2-1)"; - break; - } - } - - if (color_range) { - oss << ", color_range = "; - switch (*color_range) { - case ColorRange::kFull: - oss << "full"; - break; - case ColorRange::kStudio: - oss << "studio"; - break; - } - } - if (sub_sampling) { - oss << ", sub_sampling = "; - switch (*sub_sampling) { - case YuvSubsampling::k444: - oss << "444"; - break; - case YuvSubsampling::k440: - oss << "440"; - break; - case YuvSubsampling::k422: - oss << "422"; - break; - case YuvSubsampling::k420: - oss << "420"; - break; - } - } - - if (infer_size_from_reference) { - oss << ", infer_frame_resolution_from = " << *infer_size_from_reference; - } else { - oss << ", frame_width = " << frame_width - << ", frame_height = " << frame_height; - } - if (render_width != 0 && render_height != 0) { - oss << ", render_width = " << render_width - << ", render_height = " << render_height; - } - - oss << ", base qp = " << base_qp; - if (reference_buffers[0] != -1) { - oss << ", last_buffer = " << reference_buffers[0]; - } - if (reference_buffers[1] != -1) { - oss << ", golden_buffer = " << reference_buffers[1]; - } - if (reference_buffers[2] != -1) { - oss << ", altref_buffer = " << reference_buffers[2]; - } - - oss << ", updated buffers = { "; - bool first = true; - for (int i = 0; i < 8; ++i) { - if (updated_buffers.test(i)) { - if (first) { - first = false; - } else { - oss << ", "; - } - oss << i; - } - } - oss << " }"; - - oss << ", compressed_header_size_bytes = " << compressed_header_size; - - oss << " }"; - return oss.str(); + // rows_log2; + return br->IfNextBoolean([&] { return br->ConsumeBits(1); }); } +} // namespace -bool Parse(const uint8_t* buf, - size_t length, - UncompressedHeader* frame_info, - bool qp_only) { +bool Parse(const uint8_t* buf, size_t length, FrameInfo* frame_info) { rtc::BitBuffer bit_buffer(buf, length); BitstreamReader br(&bit_buffer); @@ -636,9 +423,6 @@ bool Parse(const uint8_t* buf, return false; if (!Vp9ReadRenderSize(&br, frame_info)) return false; - - // Key-frames implicitly update all buffers. - frame_info->updated_buffers.set(); } else { // Non-keyframe. bool is_intra_only = false; @@ -657,49 +441,31 @@ bool Parse(const uint8_t* buf, if (frame_info->profile > 0) { if (!Vp9ReadColorConfig(&br, frame_info)) return false; - } else { - frame_info->color_space = ColorSpace::CS_BT_601; - frame_info->sub_sampling = YuvSubsampling::k420; - frame_info->bit_detph = BitDept::k8Bit; } - frame_info->reference_buffers.fill(-1); - RETURN_IF_FALSE(ReadRefreshFrameFlags(&br, frame_info)); - RETURN_IF_FALSE(Vp9ReadFrameSize(&br, frame_info)); - RETURN_IF_FALSE(Vp9ReadRenderSize(&br, frame_info)); + // Refresh frame flags. + RETURN_IF_FALSE(br.ConsumeBits(8)); + if (!Vp9ReadFrameSize(&br, frame_info)) + return false; + if (!Vp9ReadRenderSize(&br, frame_info)) + return false; } else { - RETURN_IF_FALSE(ReadRefreshFrameFlags(&br, frame_info)); + // Refresh frame flags. + RETURN_IF_FALSE(br.ConsumeBits(8)); - frame_info->reference_buffers_sign_bias[0] = false; for (size_t i = 0; i < kVp9NumRefsPerFrame; i++) { - READ_OR_RETURN(br.ReadUnsigned(3), [&](uint8_t idx) { - frame_info->reference_buffers[i] = idx; - }); - READ_OR_RETURN(br.ReadBoolean(), [&](bool sign_bias) { - frame_info->reference_buffers_sign_bias[ReferenceFrame::kLast + i] = - sign_bias; - }); + // 3 bits: Ref frame index. + // 1 bit: Ref frame sign biases. + RETURN_IF_FALSE(br.ConsumeBits(4)); } if (!Vp9ReadFrameSizeFromRefs(&br, frame_info)) return false; - READ_OR_RETURN(br.ReadBoolean(), [&](bool allow_high_precision_mv) { - frame_info->allow_high_precision_mv = allow_high_precision_mv; - }); - + // Allow high precision mv. + RETURN_IF_FALSE(br.ConsumeBits(1)); // Interpolation filter. - RETURN_IF_FALSE(br.IfNextBoolean( - [frame_info] { - frame_info->interpolation_filter = InterpolationFilter::kSwitchable; - return true; - }, - [&] { - READ_OR_RETURN( - br.ReadUnsigned(2), [frame_info](uint8_t filter) { - frame_info->interpolation_filter = kLiteralToType[filter]; - }); - return true; - })); + RETURN_IF_FALSE(br.IfNextBoolean([] { return true; }, + [&br] { return br.ConsumeBits(2); })); } } @@ -710,8 +476,7 @@ bool Parse(const uint8_t* buf, } // Frame context index. - READ_OR_RETURN(br.ReadUnsigned(2), - [&](uint8_t idx) { frame_info->frame_context_idx = idx; }); + RETURN_IF_FALSE(br.ConsumeBits(2)); if (!Vp9ReadLoopfilter(&br)) return false; @@ -719,39 +484,33 @@ bool Parse(const uint8_t* buf, // Read base QP. RETURN_IF_FALSE(Vp9ReadQp(&br, frame_info)); - if (qp_only) { - // Not interested in the rest of the header, return early. - return true; - } + const bool kParseFullHeader = false; + if (kParseFullHeader) { + // Currently not used, but will be needed when parsing beyond the + // uncompressed header. + RETURN_IF_FALSE(Vp9ReadSegmentationParams(&br)); - RETURN_IF_FALSE(Vp9ReadSegmentationParams(&br, frame_info)); - RETURN_IF_FALSE(Vp9ReadTileInfo(&br, frame_info)); - READ_OR_RETURN(br.ReadUnsigned(), [frame_info](uint16_t size) { - frame_info->compressed_header_size = size; - }); + RETURN_IF_FALSE(Vp9ReadTileInfo(&br, frame_info)); - // Trailing bits. - RETURN_IF_FALSE(br.ConsumeBits(bit_buffer.RemainingBitCount() % 8)); - frame_info->uncompressed_header_size = - length - (bit_buffer.RemainingBitCount() / 8); + RETURN_IF_FALSE(br.ConsumeBits(16)); // header_size_in_bytes + } return true; } bool GetQp(const uint8_t* buf, size_t length, int* qp) { - UncompressedHeader frame_info; - if (!Parse(buf, length, &frame_info, /*qp_only=*/true)) { + FrameInfo frame_info; + if (!Parse(buf, length, &frame_info)) { return false; } *qp = frame_info.base_qp; return true; } -absl::optional ParseUncompressedHeader(const uint8_t* buf, - size_t length) { - UncompressedHeader frame_info; - if (Parse(buf, length, &frame_info, /*qp_only=*/false) && - frame_info.frame_width > 0) { +absl::optional ParseIntraFrameInfo(const uint8_t* buf, + size_t length) { + FrameInfo frame_info; + if (Parse(buf, length, &frame_info) && frame_info.frame_width > 0) { return frame_info; } return absl::nullopt; diff --git a/modules/video_coding/utility/vp9_uncompressed_header_parser.h b/modules/video_coding/utility/vp9_uncompressed_header_parser.h index 67166e364b..7a5e2c058b 100644 --- a/modules/video_coding/utility/vp9_uncompressed_header_parser.h +++ b/modules/video_coding/utility/vp9_uncompressed_header_parser.h @@ -13,13 +13,7 @@ #include #include - -#include -#include -#include - #include "absl/types/optional.h" -#include "modules/video_coding/utility/vp9_constants.h" namespace webrtc { @@ -69,86 +63,27 @@ enum class YuvSubsampling { k420, }; -enum ReferenceFrame : int { - kNone = -1, - kIntra = 0, - kLast = 1, - kGolden = 2, - kAltref = 3, -}; - -enum class InterpolationFilter : uint8_t { - kEightTap = 0, - kEightTapSmooth = 1, - kEightTapSharp = 2, - kBilinear = 3, - kSwitchable = 4 -}; - -struct UncompressedHeader { - int profile = 0; // Profiles 0-3 are valid. +struct FrameInfo { + int profile = 0; // Profile 0-3 are valid. absl::optional show_existing_frame; bool is_keyframe = false; bool show_frame = false; bool error_resilient = false; BitDept bit_detph = BitDept::k8Bit; - absl::optional color_space; - absl::optional color_range; - absl::optional sub_sampling; + ColorSpace color_space = ColorSpace::CS_UNKNOWN; + ColorRange color_range; + YuvSubsampling sub_sampling; int frame_width = 0; int frame_height = 0; int render_width = 0; int render_height = 0; - // Width/height of the tiles used (in units of 8x8 blocks). - size_t tile_cols_log2 = 0; // tile_cols = 1 << tile_cols_log2 - size_t tile_rows_log2 = 0; // tile_rows = 1 << tile_rows_log2 - struct BitstreamPosition { - size_t byte_offset = 0; - size_t bit_offset = 0; - }; - absl::optional render_size_position; - InterpolationFilter interpolation_filter = InterpolationFilter::kEightTap; - bool allow_high_precision_mv = false; int base_qp = 0; - bool is_lossless = false; - uint8_t frame_context_idx = 0; - - bool segmentation_enabled = false; - absl::optional> segmentation_tree_probs; - absl::optional> segmentation_pred_prob; - bool segmentation_is_delta = false; - absl::optional segmentation_features[kMaxSegments][kSegLvlMax]; - - // Which of the 8 reference buffers may be used as references for this frame. - // -1 indicates not used (e.g. {-1, -1, -1} for intra-only frames). - std::array reference_buffers = {-1, -1, -1}; - // Sign bias corresponding to reference buffers, where the index is a - // ReferenceFrame. - // false/0 indidate backwards reference, true/1 indicate forwards reference). - std::array reference_buffers_sign_bias = {false, false, - false, false}; - - // Indicates which reference buffer [0,7] to infer the frame size from. - absl::optional infer_size_from_reference; - // Which of the 8 reference buffers are updated by this frame. - std::bitset updated_buffers = 0; - - // Header sizes, in bytes. - uint32_t uncompressed_header_size = 0; - uint32_t compressed_header_size = 0; - - bool is_intra_only() const { - return reference_buffers[0] == -1 && reference_buffers[1] == -1 && - reference_buffers[2] == -1; - } - - std::string ToString() const; }; -// Parses the uncompressed header and populates (most) values in a -// UncompressedHeader struct. Returns nullopt on failure. -absl::optional ParseUncompressedHeader(const uint8_t* buf, - size_t length); +// Parses frame information for a VP9 key-frame or all-intra frame from a +// bitstream. Returns nullopt on failure or if not a key-frame. +absl::optional ParseIntraFrameInfo(const uint8_t* buf, + size_t length); } // namespace vp9 diff --git a/modules/video_coding/utility/vp9_uncompressed_header_parser_unittest.cc b/modules/video_coding/utility/vp9_uncompressed_header_parser_unittest.cc index 672becc9e3..b69b45d5c4 100644 --- a/modules/video_coding/utility/vp9_uncompressed_header_parser_unittest.cc +++ b/modules/video_coding/utility/vp9_uncompressed_header_parser_unittest.cc @@ -15,11 +15,6 @@ namespace webrtc { namespace vp9 { -using ::testing::AllOf; -using ::testing::ElementsAreArray; -using ::testing::Eq; -using ::testing::Field; -using ::testing::Optional; TEST(Vp9UncompressedHeaderParserTest, FrameWithSegmentation) { // Uncompressed header from a frame generated with libvpx. @@ -31,46 +26,21 @@ TEST(Vp9UncompressedHeaderParserTest, FrameWithSegmentation) { 0x2e, 0x73, 0xb7, 0xee, 0x22, 0x06, 0x81, 0x82, 0xd4, 0xef, 0xc3, 0x58, 0x1f, 0x12, 0xd2, 0x7b, 0x28, 0x1f, 0x80, 0xfc, 0x07, 0xe0, 0x00, 0x00}; - absl::optional frame_info = - ParseUncompressedHeader(kHeader, sizeof(kHeader)); + absl::optional frame_info = + ParseIntraFrameInfo(kHeader, sizeof(kHeader)); + // Segmentation info is not actually populated in FrameInfo struct, but it + // needs to be parsed otherwise we end up on the wrong offset. The check for + // segmentation is thus that we have a valid return value. ASSERT_TRUE(frame_info.has_value()); - EXPECT_FALSE(frame_info->is_keyframe); - EXPECT_TRUE(frame_info->error_resilient); - EXPECT_TRUE(frame_info->show_frame); - EXPECT_FALSE(frame_info->show_existing_frame); + EXPECT_EQ(frame_info->is_keyframe, false); + EXPECT_EQ(frame_info->error_resilient, true); + EXPECT_EQ(frame_info->show_frame, true); EXPECT_EQ(frame_info->base_qp, 185); EXPECT_EQ(frame_info->frame_width, 320); EXPECT_EQ(frame_info->frame_height, 240); EXPECT_EQ(frame_info->render_width, 640); EXPECT_EQ(frame_info->render_height, 480); - EXPECT_TRUE(frame_info->allow_high_precision_mv); - EXPECT_EQ(frame_info->frame_context_idx, 0u); - EXPECT_EQ(frame_info->interpolation_filter, InterpolationFilter::kSwitchable); - EXPECT_EQ(frame_info->is_lossless, false); - EXPECT_EQ(frame_info->profile, 0); - EXPECT_THAT(frame_info->reference_buffers, ElementsAreArray({0, 0, 0})); - EXPECT_THAT(frame_info->reference_buffers_sign_bias, - ElementsAreArray({false, false, false, false})); - EXPECT_EQ(frame_info->updated_buffers, 0b10000000); - EXPECT_EQ(frame_info->tile_cols_log2, 0u); - EXPECT_EQ(frame_info->tile_rows_log2, 0u); - EXPECT_THAT( - frame_info->render_size_position, - ::testing::Optional(AllOf( - Field(&UncompressedHeader::BitstreamPosition::byte_offset, 8u), - Field(&UncompressedHeader::BitstreamPosition::bit_offset, 0u)))); - EXPECT_EQ(frame_info->compressed_header_size, 23u); - EXPECT_EQ(frame_info->uncompressed_header_size, 37u); - - EXPECT_TRUE(frame_info->segmentation_enabled); - EXPECT_FALSE(frame_info->segmentation_is_delta); - EXPECT_THAT(frame_info->segmentation_pred_prob, - Optional(ElementsAreArray({205, 1, 1}))); - EXPECT_THAT(frame_info->segmentation_tree_probs, - Optional(ElementsAreArray({255, 255, 128, 1, 128, 128, 128}))); - EXPECT_THAT(frame_info->segmentation_features[1][kSegLvlAlt_Q], Eq(-63)); - EXPECT_THAT(frame_info->segmentation_features[2][kSegLvlAlt_Q], Eq(-81)); } } // namespace vp9 From 0cc01d7d3dd747c482767cadc8e94d5c2187d505 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Sat, 17 Jul 2021 17:02:32 -0700 Subject: [PATCH 0034/1565] Roll chromium_revision f60544555b..505063c0cb (902743:902843) Change log: https://chromium.googlesource.com/chromium/src/+log/f60544555b..505063c0cb Full diff: https://chromium.googlesource.com/chromium/src/+/f60544555b..505063c0cb Changed dependencies * src/buildtools/linux64: git_revision:24e2f7df92641de0351a96096fb2c490b2436bb8..git_revision:b2d77ab1373192d1532af94b68fb8bab727b0e5b * src/buildtools/mac: git_revision:24e2f7df92641de0351a96096fb2c490b2436bb8..git_revision:b2d77ab1373192d1532af94b68fb8bab727b0e5b * src/buildtools/win: git_revision:24e2f7df92641de0351a96096fb2c490b2436bb8..git_revision:b2d77ab1373192d1532af94b68fb8bab727b0e5b * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/a543d33a9c..b210790ca4 * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/bb9c57349c..3631fcc251 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/3401b3a22f..02a1455fd1 * src/third_party/androidx: a_MqXpypcBgG1_VAVteEsFfnTeRzsXL9Y7tPf_0Aq0YC..YiuL0FMMTU_K_n0aBAT3GBA4dMfL8JHhn6dkcz5SFgAC * src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/1ef8e41f0e..5cb305306a * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/20bde85c52..10a53a91e8 DEPS diff: https://chromium.googlesource.com/chromium/src/+/f60544555b..505063c0cb/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: I3deccb45d1a9744eb391bb8d4631cbf7a6b8204c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226383 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34497} --- DEPS | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/DEPS b/DEPS index ea3bc767e1..ab80c60383 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': 'f60544555bae6ed83d17c2b169fbc3190c98af9a', + 'chromium_revision': '505063c0cb6ade31a4066eac03e00b6521e761fa', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -31,19 +31,19 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@a543d33a9c452924f0d42b40d405a9c75a6cad9e', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@b210790ca4b8869b652ff875c01e195d7bfd9bf3', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@bb9c57349c71bf1550a80afcf435343a10e25ee7', + 'https://chromium.googlesource.com/chromium/src/testing@3631fcc251283c14d6df12c84e4f6558176db609', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@3401b3a22f018229116f0be8a31beb8117e76181', + 'https://chromium.googlesource.com/chromium/src/third_party@02a1455fd10fe89e9b98d4549a5046897534df97', 'src/buildtools/linux64': { 'packages': [ { 'package': 'gn/gn/linux-amd64', - 'version': 'git_revision:24e2f7df92641de0351a96096fb2c490b2436bb8', + 'version': 'git_revision:b2d77ab1373192d1532af94b68fb8bab727b0e5b', } ], 'dep_type': 'cipd', @@ -53,7 +53,7 @@ deps = { 'packages': [ { 'package': 'gn/gn/mac-${{arch}}', - 'version': 'git_revision:24e2f7df92641de0351a96096fb2c490b2436bb8', + 'version': 'git_revision:b2d77ab1373192d1532af94b68fb8bab727b0e5b', } ], 'dep_type': 'cipd', @@ -63,7 +63,7 @@ deps = { 'packages': [ { 'package': 'gn/gn/windows-amd64', - 'version': 'git_revision:24e2f7df92641de0351a96096fb2c490b2436bb8', + 'version': 'git_revision:b2d77ab1373192d1532af94b68fb8bab727b0e5b', } ], 'dep_type': 'cipd', @@ -128,7 +128,7 @@ deps = { 'src/third_party/breakpad/breakpad': 'https://chromium.googlesource.com/breakpad/breakpad.git@b95c4868b10f69e642666742233aede1eb653012', 'src/third_party/catapult': - 'https://chromium.googlesource.com/catapult.git@1ef8e41f0e93096daf74803fdc794cacb016d8b2', + 'https://chromium.googlesource.com/catapult.git@5cb305306ad74c3b68e432ee221a1943dd79b64d', 'src/third_party/ced/src': { 'url': 'https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git@ba412eaaacd3186085babcd901679a48863c7dd5', }, @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@20bde85c52520d0ad3e2602b0ce99f1c0db876ea', + 'https://chromium.googlesource.com/chromium/src/tools@10a53a91e86a4dba1b7124c91a0b6f82722866d0', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'a_MqXpypcBgG1_VAVteEsFfnTeRzsXL9Y7tPf_0Aq0YC', + 'version': 'YiuL0FMMTU_K_n0aBAT3GBA4dMfL8JHhn6dkcz5SFgAC', }, ], 'condition': 'checkout_android', From 261af57d751d38be5cf234e4c146f8849d37e621 Mon Sep 17 00:00:00 2001 From: webrtc-version-updater Date: Sat, 17 Jul 2021 21:04:12 -0700 Subject: [PATCH 0035/1565] Update WebRTC code version (2021-07-18T04:04:10). TBR=webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com,mbonadei@webrtc.org Bug: None Change-Id: I9dcdeb89aef8c5f24efee7f3b876771bb70e11cd Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226319 Reviewed-by: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Commit-Queue: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Cr-Commit-Position: refs/heads/master@{#34498} --- call/version.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/call/version.cc b/call/version.cc index a19de55703..297d7efc7c 100644 --- a/call/version.cc +++ b/call/version.cc @@ -13,7 +13,7 @@ namespace webrtc { // The timestamp is always in UTC. -const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-17T04:04:21"; +const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-18T04:04:10"; void LoadWebRTCVersionInRegister() { // Using volatile to instruct the compiler to not optimize `p` away even From f39c1708a208a9dc6a9afb9f7b15f7e1f9311312 Mon Sep 17 00:00:00 2001 From: webrtc-version-updater Date: Sun, 18 Jul 2021 21:02:17 -0700 Subject: [PATCH 0036/1565] Update WebRTC code version (2021-07-19T04:02:14). TBR=webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com,mbonadei@webrtc.org Bug: None Change-Id: I3645897de837d83c97a2ce5cf92dbbcf9476cba3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226406 Reviewed-by: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Commit-Queue: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Cr-Commit-Position: refs/heads/master@{#34499} --- call/version.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/call/version.cc b/call/version.cc index 297d7efc7c..7ffcce6e17 100644 --- a/call/version.cc +++ b/call/version.cc @@ -13,7 +13,7 @@ namespace webrtc { // The timestamp is always in UTC. -const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-18T04:04:10"; +const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-19T04:02:14"; void LoadWebRTCVersionInRegister() { // Using volatile to instruct the compiler to not optimize `p` away even From 0786b52c2ea0d168fcc18a0a90db1273c4cfc711 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Mon, 19 Jul 2021 12:09:58 +0200 Subject: [PATCH 0037/1565] Stop parsing if current message length is bigger than buffer. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If allow_incomplete_logs_ is false and the current message length is bigger than the remaining buffer, this CL returns an error status to the client. Bug: None Change-Id: Idcacda9f42429416da3272651621b8d5936fc69e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225545 Reviewed-by: Björn Terelius Reviewed-by: Elad Alon Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34500} --- logging/rtc_event_log/rtc_event_log_parser.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/logging/rtc_event_log/rtc_event_log_parser.cc b/logging/rtc_event_log/rtc_event_log_parser.cc index 08fb9408c1..91df18b226 100644 --- a/logging/rtc_event_log/rtc_event_log_parser.cc +++ b/logging/rtc_event_log/rtc_event_log_parser.cc @@ -1311,12 +1311,17 @@ ParsedRtcEventLog::ParseStatus ParsedRtcEventLog::ParseStreamInternal( } if (message_length > s.size()) { - RTC_LOG(LS_WARNING) << "Protobuf message length is too large."; + RTC_LOG(LS_WARNING) << "Protobuf message length is larger than the " + "remaining bytes in the proto."; RTC_PARSE_WARN_AND_RETURN_SUCCESS_IF(allow_incomplete_logs_, kIncompleteLogError); - RTC_PARSE_CHECK_OR_RETURN_LE(message_length, kMaxEventSize); + return ParseStatus::Error( + "Incomplete message: the length of the next message is larger than " + "the remaining bytes in the proto", + __FILE__, __LINE__); } + RTC_PARSE_CHECK_OR_RETURN_LE(message_length, kMaxEventSize); // Skip forward to the start of the next event. s = s.substr(message_length); size_t total_event_size = event_start.size() - s.size(); From 3fea323170e4abe7c54e9847e41ac288a5072927 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Mon, 19 Jul 2021 05:03:48 -0700 Subject: [PATCH 0038/1565] Roll chromium_revision 505063c0cb..f151d17c93 (902843:902957) Change log: https://chromium.googlesource.com/chromium/src/+log/505063c0cb..f151d17c93 Full diff: https://chromium.googlesource.com/chromium/src/+/505063c0cb..f151d17c93 Changed dependencies * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/b210790ca4..d10287f0ec * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/3631fcc251..4bd36f4249 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/02a1455fd1..8f400a6394 * src/third_party/androidx: YiuL0FMMTU_K_n0aBAT3GBA4dMfL8JHhn6dkcz5SFgAC..S6dCY92KZR4uySXoIPzDOReE8nJYQNPXboKDPsSdhpYC * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/c647483ca5..b72f3ccca5 * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/10a53a91e8..0ee0101564 * src/tools/luci-go: git_revision:d10ff2af1182ccaad573bc5acb84a36f4c280876..git_revision:b36efc79b549f8aeb29ce40079891e1acb6c6bb2 * src/tools/luci-go: git_revision:d10ff2af1182ccaad573bc5acb84a36f4c280876..git_revision:b36efc79b549f8aeb29ce40079891e1acb6c6bb2 * src/tools/luci-go: git_revision:d10ff2af1182ccaad573bc5acb84a36f4c280876..git_revision:b36efc79b549f8aeb29ce40079891e1acb6c6bb2 DEPS diff: https://chromium.googlesource.com/chromium/src/+/505063c0cb..f151d17c93/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: Ic4c3ed7b49f3bd7b7bc9388a8bb86f1229b0c5e7 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226443 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34501} --- DEPS | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/DEPS b/DEPS index ab80c60383..67804bd591 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': '505063c0cb6ade31a4066eac03e00b6521e761fa', + 'chromium_revision': 'f151d17c9355ab0847c1f38ba198b4cf35000d5d', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -31,13 +31,13 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@b210790ca4b8869b652ff875c01e195d7bfd9bf3', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@d10287f0ec289a211be005eda584e1c8bff705aa', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@3631fcc251283c14d6df12c84e4f6558176db609', + 'https://chromium.googlesource.com/chromium/src/testing@4bd36f4249de782837b3463d3382f5dbe820e808', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@02a1455fd10fe89e9b98d4549a5046897534df97', + 'https://chromium.googlesource.com/chromium/src/third_party@8f400a639483c1e8ccc52464673d0ad44f72fbcd', 'src/buildtools/linux64': { 'packages': [ @@ -214,7 +214,7 @@ deps = { 'condition': 'checkout_android', }, 'src/third_party/perfetto': - 'https://android.googlesource.com/platform/external/perfetto.git@c647483ca5ff97691d327dc2224995e47d3dc899', + 'https://android.googlesource.com/platform/external/perfetto.git@b72f3ccca5e6ec7e47a05a947156e6378d08b2a7', 'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@eebc5cd487a89c51ba148f6d6ac45779970f72d7', 'src/third_party/libyuv': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@10a53a91e86a4dba1b7124c91a0b6f82722866d0', + 'https://chromium.googlesource.com/chromium/src/tools@0ee0101564d9dea696db84c0ac5adde42884c958', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'YiuL0FMMTU_K_n0aBAT3GBA4dMfL8JHhn6dkcz5SFgAC', + 'version': 'S6dCY92KZR4uySXoIPzDOReE8nJYQNPXboKDPsSdhpYC', }, ], 'condition': 'checkout_android', @@ -477,15 +477,15 @@ deps = { 'packages': [ { 'package': 'infra/tools/luci/isolate/${{platform}}', - 'version': 'git_revision:d10ff2af1182ccaad573bc5acb84a36f4c280876', + 'version': 'git_revision:b36efc79b549f8aeb29ce40079891e1acb6c6bb2', }, { 'package': 'infra/tools/luci/isolated/${{platform}}', - 'version': 'git_revision:d10ff2af1182ccaad573bc5acb84a36f4c280876', + 'version': 'git_revision:b36efc79b549f8aeb29ce40079891e1acb6c6bb2', }, { 'package': 'infra/tools/luci/swarming/${{platform}}', - 'version': 'git_revision:d10ff2af1182ccaad573bc5acb84a36f4c280876', + 'version': 'git_revision:b36efc79b549f8aeb29ce40079891e1acb6c6bb2', }, ], 'dep_type': 'cipd', From 4e0d46fde4adfcd4e922e2b38fb10bf5b3feaeaf Mon Sep 17 00:00:00 2001 From: Florent Castelli Date: Mon, 19 Jul 2021 13:43:10 +0200 Subject: [PATCH 0039/1565] api: Fix visibility of targets in api/ Bug: webrtc:9620 Change-Id: I13624c7e56406e663b86a47e194a6f1882734176 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226331 Reviewed-by: Mirko Bonadei Commit-Queue: Florent Castelli Cr-Commit-Position: refs/heads/master@{#34502} --- api/BUILD.gn | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/api/BUILD.gn b/api/BUILD.gn index 767056fb44..00ac4a1878 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -263,6 +263,7 @@ rtc_source_set("packet_socket_factory") { } rtc_source_set("async_dns_resolver") { + visibility = [ "*" ] sources = [ "async_dns_resolver.h" ] deps = [ "../rtc_base:socket_address", @@ -326,6 +327,7 @@ rtc_source_set("rtp_transceiver_direction") { } rtc_source_set("priority") { + visibility = [ "*" ] sources = [ "priority.h" ] } @@ -825,6 +827,7 @@ if (rtc_include_tests) { } rtc_source_set("mock_audio_mixer") { + visibility = [ "*" ] testonly = true sources = [ "test/mock_audio_mixer.h" ] @@ -858,6 +861,7 @@ if (rtc_include_tests) { } rtc_source_set("mock_fec_controller_override") { + visibility = [ "*" ] testonly = true sources = [ "test/mock_fec_controller_override.h" ] deps = [ @@ -867,6 +871,7 @@ if (rtc_include_tests) { } rtc_library("mock_frame_encryptor") { + visibility = [ "*" ] testonly = true sources = [ "test/mock_frame_encryptor.h" ] deps = [ @@ -878,6 +883,7 @@ if (rtc_include_tests) { } rtc_library("mock_frame_decryptor") { + visibility = [ "*" ] testonly = true sources = [ "test/mock_frame_decryptor.h" ] deps = [ @@ -888,6 +894,7 @@ if (rtc_include_tests) { } rtc_library("fake_frame_encryptor") { + visibility = [ "*" ] testonly = true sources = [ "test/fake_frame_encryptor.cc", @@ -904,6 +911,7 @@ if (rtc_include_tests) { } rtc_library("fake_frame_decryptor") { + visibility = [ "*" ] testonly = true sources = [ "test/fake_frame_decryptor.cc", @@ -968,6 +976,7 @@ if (rtc_include_tests) { } rtc_source_set("mock_async_dns_resolver") { + visibility = [ "*" ] testonly = true sources = [ "test/mock_async_dns_resolver.h" ] deps = [ @@ -992,6 +1001,7 @@ if (rtc_include_tests) { } rtc_source_set("mock_transformable_video_frame") { + visibility = [ "*" ] testonly = true sources = [ "test/mock_transformable_video_frame.h" ] @@ -1002,6 +1012,7 @@ if (rtc_include_tests) { } rtc_source_set("mock_video_bitrate_allocator") { + visibility = [ "*" ] testonly = true sources = [ "test/mock_video_bitrate_allocator.h" ] @@ -1012,6 +1023,7 @@ if (rtc_include_tests) { } rtc_source_set("mock_video_bitrate_allocator_factory") { + visibility = [ "*" ] testonly = true sources = [ "test/mock_video_bitrate_allocator_factory.h" ] @@ -1022,6 +1034,7 @@ if (rtc_include_tests) { } rtc_source_set("mock_video_codec_factory") { + visibility = [ "*" ] testonly = true sources = [ "test/mock_video_decoder_factory.h", @@ -1036,7 +1049,6 @@ if (rtc_include_tests) { rtc_library("mock_video_decoder") { visibility = [ "*" ] - testonly = true sources = [ "test/mock_video_decoder.h" ] @@ -1048,7 +1060,6 @@ if (rtc_include_tests) { rtc_library("mock_video_encoder") { visibility = [ "*" ] - testonly = true sources = [ "test/mock_video_encoder.h" ] @@ -1060,7 +1071,6 @@ if (rtc_include_tests) { rtc_library("mock_video_track") { visibility = [ "*" ] - testonly = true sources = [ "test/mock_video_track.h" ] From 4261a73b56ada3608e8bec550ee60697d34fd614 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Mon, 19 Jul 2021 14:28:48 +0200 Subject: [PATCH 0040/1565] Move SetVideoCodecs closer to AddVideoConfig. Bug: b/192821182 Change-Id: I8ab604abf780cd271d0890268da5ef5880677d55 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226460 Commit-Queue: Mirko Bonadei Reviewed-by: Artem Titov Cr-Commit-Position: refs/heads/master@{#34503} --- api/test/peerconnection_quality_test_fixture.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/api/test/peerconnection_quality_test_fixture.h b/api/test/peerconnection_quality_test_fixture.h index 1619bd7169..ea230f0ad0 100644 --- a/api/test/peerconnection_quality_test_fixture.h +++ b/api/test/peerconnection_quality_test_fixture.h @@ -349,6 +349,14 @@ class PeerConnectionE2EQualityTestFixture { virtual PeerConfigurer* AddVideoConfig( VideoConfig config, CapturingDeviceIndex capturing_device_index) = 0; + // Set the list of video codecs used by the peer during the test. These + // codecs will be negotiated in SDP during offer/answer exchange. The order + // of these codecs during negotiation will be the same as in |video_codecs|. + // Codecs have to be available in codecs list provided by peer connection to + // be negotiated. If some of specified codecs won't be found, the test will + // crash. + virtual PeerConfigurer* SetVideoCodecs( + std::vector video_codecs) = 0; // Set the audio stream for the call from this peer. If this method won't // be invoked, this peer will send no audio. virtual PeerConfigurer* SetAudioConfig(AudioConfig config) = 0; @@ -364,14 +372,6 @@ class PeerConnectionE2EQualityTestFixture { // applied to all summed RTP streams for this peer. virtual PeerConfigurer* SetBitrateSettings( BitrateSettings bitrate_settings) = 0; - // Set the list of video codecs used by the peer during the test. These - // codecs will be negotiated in SDP during offer/answer exchange. The order - // of these codecs during negotiation will be the same as in |video_codecs|. - // Codecs have to be available in codecs list provided by peer connection to - // be negotiated. If some of specified codecs won't be found, the test will - // crash. - virtual PeerConfigurer* SetVideoCodecs( - std::vector video_codecs) = 0; }; // Contains configuration for echo emulator. From 99a71f49c03a3148e29ba5e815ffd5a64afa6e90 Mon Sep 17 00:00:00 2001 From: Danil Chapovalov Date: Mon, 19 Jul 2021 13:20:46 +0000 Subject: [PATCH 0041/1565] Move helpers to parse base rtp packet fields to rtp_rtcp module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rtp_rtcp_format is lighter build target than rtc_media_base and a more natural place to keep rtp parsing functions. Bug: None Change-Id: Ibcb5661cc65edbdc89a63f3e411d7ad1218353cc Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226330 Commit-Queue: Danil Chapovalov Reviewed-by: Niels Moller Reviewed-by: Henrik Boström Cr-Commit-Position: refs/heads/master@{#34504} --- media/BUILD.gn | 1 + media/base/fake_network_interface.h | 17 +- media/base/rtp_utils.cc | 53 ----- media/base/rtp_utils.h | 5 - media/base/rtp_utils_unittest.cc | 28 --- media/engine/fake_webrtc_call.cc | 10 +- media/engine/webrtc_video_engine.cc | 14 +- media/engine/webrtc_video_engine_unittest.cc | 226 +++++++------------ media/engine/webrtc_voice_engine.cc | 8 +- modules/rtp_rtcp/source/rtp_util.cc | 17 ++ modules/rtp_rtcp/source/rtp_util.h | 6 + modules/rtp_rtcp/source/rtp_util_unittest.cc | 31 ++- pc/srtp_session.cc | 9 +- pc/srtp_transport.cc | 15 +- 14 files changed, 167 insertions(+), 273 deletions(-) diff --git a/media/BUILD.gn b/media/BUILD.gn index 5f0f527b8f..0e6b340d4c 100644 --- a/media/BUILD.gn +++ b/media/BUILD.gn @@ -292,6 +292,7 @@ rtc_library("rtc_audio_video") { "../modules/audio_processing:api", "../modules/audio_processing/aec_dump", "../modules/audio_processing/agc:gain_control_interface", + "../modules/rtp_rtcp:rtp_rtcp_format", "../modules/video_coding", "../modules/video_coding:video_codec_interface", "../modules/video_coding:video_coding_utility", diff --git a/media/base/fake_network_interface.h b/media/base/fake_network_interface.h index 45b7aa0fc0..043e559f28 100644 --- a/media/base/fake_network_interface.h +++ b/media/base/fake_network_interface.h @@ -17,6 +17,7 @@ #include "media/base/media_channel.h" #include "media/base/rtp_utils.h" +#include "modules/rtp_rtcp/source/rtp_util.h" #include "rtc_base/byte_order.h" #include "rtc_base/checks.h" #include "rtc_base/copy_on_write_buffer.h" @@ -116,13 +117,12 @@ class FakeNetworkInterface : public MediaChannel::NetworkInterface, virtual bool SendPacket(rtc::CopyOnWriteBuffer* packet, const rtc::PacketOptions& options) RTC_LOCKS_EXCLUDED(mutex_) { - webrtc::MutexLock lock(&mutex_); - - uint32_t cur_ssrc = 0; - if (!GetRtpSsrc(packet->data(), packet->size(), &cur_ssrc)) { + if (!webrtc::IsRtpPacket(*packet)) { return false; } - sent_ssrcs_[cur_ssrc]++; + + webrtc::MutexLock lock(&mutex_); + sent_ssrcs_[webrtc::ParseRtpSsrc(*packet)]++; options_ = options; rtp_packets_.push_back(*packet); @@ -192,13 +192,8 @@ class FakeNetworkInterface : public MediaChannel::NetworkInterface, if (packets) { *packets = 0; } - uint32_t cur_ssrc = 0; for (size_t i = 0; i < rtp_packets_.size(); ++i) { - if (!GetRtpSsrc(rtp_packets_[i].data(), rtp_packets_[i].size(), - &cur_ssrc)) { - return; - } - if (ssrc == cur_ssrc) { + if (ssrc == webrtc::ParseRtpSsrc(rtp_packets_[i])) { if (bytes) { *bytes += static_cast(rtp_packets_[i].size()); } diff --git a/media/base/rtp_utils.cc b/media/base/rtp_utils.cc index 9f90c468f7..e796482cbb 100644 --- a/media/base/rtp_utils.cc +++ b/media/base/rtp_utils.cc @@ -25,10 +25,6 @@ namespace cricket { -static const size_t kRtpPayloadTypeOffset = 1; -static const size_t kRtpSeqNumOffset = 2; -static const size_t kRtpTimestampOffset = 4; -static const size_t kRtpSsrcOffset = 8; static const size_t kRtcpPayloadTypeOffset = 1; static const size_t kRtpExtensionHeaderLen = 4; static const size_t kAbsSendTimeExtensionLen = 3; @@ -126,57 +122,8 @@ bool GetUint8(const void* data, size_t offset, int* value) { return true; } -bool GetUint16(const void* data, size_t offset, int* value) { - if (!data || !value) { - return false; - } - *value = static_cast( - rtc::GetBE16(static_cast(data) + offset)); - return true; -} - -bool GetUint32(const void* data, size_t offset, uint32_t* value) { - if (!data || !value) { - return false; - } - *value = rtc::GetBE32(static_cast(data) + offset); - return true; -} - } // namespace -bool GetRtpPayloadType(const void* data, size_t len, int* value) { - if (len < kMinRtpPacketLen) { - return false; - } - if (!GetUint8(data, kRtpPayloadTypeOffset, value)) { - return false; - } - *value &= 0x7F; - return true; -} - -bool GetRtpSeqNum(const void* data, size_t len, int* value) { - if (len < kMinRtpPacketLen) { - return false; - } - return GetUint16(data, kRtpSeqNumOffset, value); -} - -bool GetRtpTimestamp(const void* data, size_t len, uint32_t* value) { - if (len < kMinRtpPacketLen) { - return false; - } - return GetUint32(data, kRtpTimestampOffset, value); -} - -bool GetRtpSsrc(const void* data, size_t len, uint32_t* value) { - if (len < kMinRtpPacketLen) { - return false; - } - return GetUint32(data, kRtpSsrcOffset, value); -} - bool GetRtcpType(const void* data, size_t len, int* value) { if (len < kMinRtcpPacketLen) { return false; diff --git a/media/base/rtp_utils.h b/media/base/rtp_utils.h index f6b5dbc9f0..e10403c756 100644 --- a/media/base/rtp_utils.h +++ b/media/base/rtp_utils.h @@ -42,11 +42,6 @@ enum class RtpPacketType { kUnknown, }; -bool GetRtpPayloadType(const void* data, size_t len, int* value); -bool GetRtpSeqNum(const void* data, size_t len, int* value); -bool GetRtpTimestamp(const void* data, size_t len, uint32_t* value); -bool GetRtpSsrc(const void* data, size_t len, uint32_t* value); - bool GetRtcpType(const void* data, size_t len, int* value); bool GetRtcpSsrc(const void* data, size_t len, uint32_t* value); diff --git a/media/base/rtp_utils_unittest.cc b/media/base/rtp_utils_unittest.cc index 14599abca2..543babee35 100644 --- a/media/base/rtp_utils_unittest.cc +++ b/media/base/rtp_utils_unittest.cc @@ -21,8 +21,6 @@ namespace cricket { -static const uint8_t kRtpPacketWithMarker[] = { - 0x80, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01}; static const uint8_t kInvalidPacket[] = {0x80, 0x00}; // PT = 206, FMT = 1, Sender SSRC = 0x1111, Media SSRC = 0x1111 @@ -84,32 +82,6 @@ static const rtc::ArrayView kInvalidPacketArrayView = rtc::MakeArrayView(reinterpret_cast(kInvalidPacket), sizeof(kInvalidPacket)); -TEST(RtpUtilsTest, GetRtp) { - int pt; - EXPECT_TRUE(GetRtpPayloadType(kPcmuFrame, sizeof(kPcmuFrame), &pt)); - EXPECT_EQ(0, pt); - EXPECT_TRUE(GetRtpPayloadType(kRtpPacketWithMarker, - sizeof(kRtpPacketWithMarker), &pt)); - EXPECT_EQ(0, pt); - - int seq_num; - EXPECT_TRUE(GetRtpSeqNum(kPcmuFrame, sizeof(kPcmuFrame), &seq_num)); - EXPECT_EQ(1, seq_num); - - uint32_t ts; - EXPECT_TRUE(GetRtpTimestamp(kPcmuFrame, sizeof(kPcmuFrame), &ts)); - EXPECT_EQ(0u, ts); - - uint32_t ssrc; - EXPECT_TRUE(GetRtpSsrc(kPcmuFrame, sizeof(kPcmuFrame), &ssrc)); - EXPECT_EQ(1u, ssrc); - - EXPECT_FALSE(GetRtpPayloadType(kInvalidPacket, sizeof(kInvalidPacket), &pt)); - EXPECT_FALSE(GetRtpSeqNum(kInvalidPacket, sizeof(kInvalidPacket), &seq_num)); - EXPECT_FALSE(GetRtpTimestamp(kInvalidPacket, sizeof(kInvalidPacket), &ts)); - EXPECT_FALSE(GetRtpSsrc(kInvalidPacket, sizeof(kInvalidPacket), &ssrc)); -} - TEST(RtpUtilsTest, GetRtcp) { int pt; EXPECT_TRUE(GetRtcpType(kRtcpReport, sizeof(kRtcpReport), &pt)); diff --git a/media/engine/fake_webrtc_call.cc b/media/engine/fake_webrtc_call.cc index e8c7f6e0c9..13401514bd 100644 --- a/media/engine/fake_webrtc_call.cc +++ b/media/engine/fake_webrtc_call.cc @@ -14,12 +14,15 @@ #include "absl/algorithm/container.h" #include "api/call/audio_sink.h" -#include "media/base/rtp_utils.h" +#include "modules/rtp_rtcp/source/rtp_util.h" #include "rtc_base/checks.h" #include "rtc_base/gunit.h" #include "rtc_base/thread.h" namespace cricket { + +using ::webrtc::ParseRtpSsrc; + FakeAudioSendStream::FakeAudioSendStream( int id, const webrtc::AudioSendStream::Config& config) @@ -601,10 +604,11 @@ FakeCall::DeliveryStatus FakeCall::DeliverPacket(webrtc::MediaType media_type, RTC_DCHECK(media_type == webrtc::MediaType::AUDIO || media_type == webrtc::MediaType::VIDEO); - uint32_t ssrc; - if (!GetRtpSsrc(packet.cdata(), packet.size(), &ssrc)) + if (!webrtc::IsRtpPacket(packet)) { return DELIVERY_PACKET_ERROR; + } + uint32_t ssrc = ParseRtpSsrc(packet); if (media_type == webrtc::MediaType::VIDEO) { for (auto receiver : video_receive_streams_) { if (receiver->GetConfig().rtp.remote_ssrc == ssrc) { diff --git a/media/engine/webrtc_video_engine.cc b/media/engine/webrtc_video_engine.cc index 38a210ee7d..017ce53b52 100644 --- a/media/engine/webrtc_video_engine.cc +++ b/media/engine/webrtc_video_engine.cc @@ -31,6 +31,7 @@ #include "media/engine/simulcast.h" #include "media/engine/webrtc_media_engine.h" #include "media/engine/webrtc_voice_engine.h" +#include "modules/rtp_rtcp/source/rtp_util.h" #include "rtc_base/copy_on_write_buffer.h" #include "rtc_base/experiments/field_trial_parser.h" #include "rtc_base/experiments/field_trial_units.h" @@ -46,6 +47,9 @@ namespace cricket { namespace { +using ::webrtc::ParseRtpPayloadType; +using ::webrtc::ParseRtpSsrc; + const int kMinLayerSize = 16; constexpr int64_t kUnsignaledSsrcCooldownMs = rtc::kNumMillisecsPerSec / 2; @@ -1727,10 +1731,7 @@ void WebRtcVideoChannel::OnPacketReceived(rtc::CopyOnWriteBuffer packet, break; } - uint32_t ssrc = 0; - if (!GetRtpSsrc(packet.cdata(), packet.size(), &ssrc)) { - return; - } + uint32_t ssrc = ParseRtpSsrc(packet); if (unknown_ssrc_packet_buffer_) { unknown_ssrc_packet_buffer_->AddPacket(ssrc, packet_time_us, packet); @@ -1741,10 +1742,7 @@ void WebRtcVideoChannel::OnPacketReceived(rtc::CopyOnWriteBuffer packet, return; } - int payload_type = 0; - if (!GetRtpPayloadType(packet.cdata(), packet.size(), &payload_type)) { - return; - } + int payload_type = ParseRtpPayloadType(packet); // See if this payload_type is registered as one that usually gets its // own SSRC (RTX) or at least is safe to drop either way (FEC). If it diff --git a/media/engine/webrtc_video_engine_unittest.cc b/media/engine/webrtc_video_engine_unittest.cc index d0745e35f5..97764f8583 100644 --- a/media/engine/webrtc_video_engine_unittest.cc +++ b/media/engine/webrtc_video_engine_unittest.cc @@ -77,8 +77,9 @@ using ::testing::Return; using ::testing::SizeIs; using ::testing::StrNe; using ::testing::Values; -using webrtc::BitrateConstraints; -using webrtc::RtpExtension; +using ::webrtc::BitrateConstraints; +using ::webrtc::RtpExtension; +using ::webrtc::RtpPacket; namespace { static const int kDefaultQpMax = 56; @@ -1425,7 +1426,7 @@ class WebRtcVideoChannelEncodedFrameCallbackTest : public ::testing::Test { } void DeliverKeyFrame(uint32_t ssrc) { - webrtc::RtpPacket packet; + RtpPacket packet; packet.SetMarker(true); packet.SetPayloadType(96); // VP8 packet.SetSsrc(ssrc); @@ -1666,7 +1667,7 @@ class WebRtcVideoChannelBaseTest : public ::testing::Test { return network_interface_.GetRtpPacket(index); } static int GetPayloadType(rtc::CopyOnWriteBuffer p) { - webrtc::RtpPacket header; + RtpPacket header; EXPECT_TRUE(header.Parse(std::move(p))); return header.PayloadType(); } @@ -2060,7 +2061,7 @@ TEST_F(WebRtcVideoChannelBaseTest, SetSendSsrc) { EXPECT_TRUE(SetSend(true)); SendFrame(); EXPECT_TRUE_WAIT(NumRtpPackets() > 0, kTimeout); - webrtc::RtpPacket header; + RtpPacket header; EXPECT_TRUE(header.Parse(GetRtpPacket(0))); EXPECT_EQ(kSsrc, header.Ssrc()); @@ -2084,7 +2085,7 @@ TEST_F(WebRtcVideoChannelBaseTest, SetSendSsrcAfterSetCodecs) { EXPECT_TRUE(SetSend(true)); EXPECT_TRUE(WaitAndSendFrame(0)); EXPECT_TRUE_WAIT(NumRtpPackets() > 0, kTimeout); - webrtc::RtpPacket header; + RtpPacket header; EXPECT_TRUE(header.Parse(GetRtpPacket(0))); EXPECT_EQ(999u, header.Ssrc()); // Packets are being paced out, so these can mismatch between the first and @@ -2099,16 +2100,13 @@ TEST_F(WebRtcVideoChannelBaseTest, SetSendSsrcAfterSetCodecs) { // Test that we can set the default video renderer before and after // media is received. TEST_F(WebRtcVideoChannelBaseTest, SetSink) { - uint8_t data1[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - - rtc::CopyOnWriteBuffer packet1(data1, sizeof(data1)); - rtc::SetBE32(packet1.MutableData() + 8, kSsrc); + RtpPacket packet; + packet.SetSsrc(kSsrc); channel_->SetDefaultSink(NULL); EXPECT_TRUE(SetDefaultCodec()); EXPECT_TRUE(SetSend(true)); EXPECT_EQ(0, renderer_.num_rendered_frames()); - channel_->OnPacketReceived(packet1, /* packet_time_us */ -1); + channel_->OnPacketReceived(packet.Buffer(), /* packet_time_us */ -1); channel_->SetDefaultSink(&renderer_); SendFrame(); EXPECT_FRAME_WAIT(1, kVideoWidth, kVideoHeight, kTimeout); @@ -2122,7 +2120,7 @@ TEST_F(WebRtcVideoChannelBaseTest, AddRemoveSendStreams) { SendFrame(); EXPECT_FRAME_WAIT(1, kVideoWidth, kVideoHeight, kTimeout); EXPECT_GT(NumRtpPackets(), 0); - webrtc::RtpPacket header; + RtpPacket header; size_t last_packet = NumRtpPackets() - 1; EXPECT_TRUE(header.Parse(GetRtpPacket(static_cast(last_packet)))); EXPECT_EQ(kSsrc, header.Ssrc()); @@ -6301,12 +6299,9 @@ TEST_F(WebRtcVideoChannelTest, DefaultReceiveStreamReconfiguresToUseRtx) { const std::vector rtx_ssrcs = MAKE_VECTOR(kRtxSsrcs1); ASSERT_EQ(0u, fake_call_->GetVideoReceiveStreams().size()); - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], ssrcs[0]); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(ssrcs[0]); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); ASSERT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()) << "No default receive stream created."; @@ -6462,12 +6457,9 @@ TEST_F(WebRtcVideoChannelTest, RecvUnsignaledSsrcWithSignaledStreamId) { EXPECT_EQ(0u, fake_call_->GetVideoReceiveStreams().size()); // Create and deliver packet. - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kIncomingUnsignalledSsrc); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kIncomingUnsignalledSsrc); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); // The stream should now be created with the appropriate sync label. EXPECT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()); @@ -6482,14 +6474,14 @@ TEST_F(WebRtcVideoChannelTest, RecvUnsignaledSsrcWithSignaledStreamId) { // Until the demuxer criteria has been updated, we ignore in-flight ssrcs of // the recently removed unsignaled receive stream. - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); EXPECT_EQ(0u, fake_call_->GetVideoReceiveStreams().size()); // After the demuxer criteria has been updated, we should proceed to create // unsignalled receive streams. This time when a default video receive stream // is created it won't have a sync_group. channel_->OnDemuxerCriteriaUpdateComplete(); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); EXPECT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()); EXPECT_TRUE( fake_call_->GetVideoReceiveStreams()[0]->GetConfig().sync_group.empty()); @@ -6501,12 +6493,9 @@ TEST_F(WebRtcVideoChannelTest, EXPECT_TRUE(fake_call_->GetVideoReceiveStreams().empty()); // Packet with unsignaled SSRC is received. - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kIncomingUnsignalledSsrc); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kIncomingUnsignalledSsrc); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); // Default receive stream created. const auto& receivers1 = fake_call_->GetVideoReceiveStreams(); @@ -6551,21 +6540,15 @@ TEST_F(WebRtcVideoChannelTest, // the demuxer is updated. { // Receive a packet for kSsrc1. - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kSsrc1); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kSsrc1); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); } { // Receive a packet for kSsrc2. - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kSsrc2); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kSsrc2); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); } // No unsignaled ssrc for kSsrc2 should have been created, but kSsrc1 should @@ -6583,21 +6566,15 @@ TEST_F(WebRtcVideoChannelTest, // Receive packets for kSsrc1 and kSsrc2 again. { // Receive a packet for kSsrc1. - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kSsrc1); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kSsrc1); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); } { // Receive a packet for kSsrc2. - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kSsrc2); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kSsrc2); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); } // An unsignalled ssrc for kSsrc2 should be created and the packet counter @@ -6634,21 +6611,15 @@ TEST_F(WebRtcVideoChannelTest, // the demuxer is updated. { // Receive a packet for kSsrc1. - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kSsrc1); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kSsrc1); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); } { // Receive a packet for kSsrc2. - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kSsrc2); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kSsrc2); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); } // No unsignaled ssrc for kSsrc1 should have been created, but the packet @@ -6665,21 +6636,15 @@ TEST_F(WebRtcVideoChannelTest, // Receive packets for kSsrc1 and kSsrc2 again. { // Receive a packet for kSsrc1. - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kSsrc1); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kSsrc1); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); } { // Receive a packet for kSsrc2. - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kSsrc2); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kSsrc2); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); } // An unsignalled ssrc for kSsrc1 should be created and the packet counter @@ -6712,12 +6677,9 @@ TEST_F(WebRtcVideoChannelTest, MultiplePendingDemuxerCriteriaUpdates) { // In-flight packets should arrive because the stream was recreated, even // though demuxer criteria updates are pending... { - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kSsrc); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kSsrc); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); } EXPECT_EQ(fake_call_->GetDeliveredPacketsForSsrc(kSsrc), 1u); @@ -6728,12 +6690,9 @@ TEST_F(WebRtcVideoChannelTest, MultiplePendingDemuxerCriteriaUpdates) { // This still should not prevent in-flight packets from arriving because we // have a receive stream for it. { - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kSsrc); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kSsrc); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); } EXPECT_EQ(fake_call_->GetDeliveredPacketsForSsrc(kSsrc), 2u); @@ -6745,12 +6704,9 @@ TEST_F(WebRtcVideoChannelTest, MultiplePendingDemuxerCriteriaUpdates) { // Now the packet should be dropped and not create an unsignalled receive // stream. { - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kSsrc); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kSsrc); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); } EXPECT_EQ(fake_call_->GetVideoReceiveStreams().size(), 0u); EXPECT_EQ(fake_call_->GetDeliveredPacketsForSsrc(kSsrc), 2u); @@ -6762,12 +6718,9 @@ TEST_F(WebRtcVideoChannelTest, MultiplePendingDemuxerCriteriaUpdates) { // The packets should continue to be dropped because removal happened after // the most recently completed demuxer update. { - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kSsrc); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kSsrc); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); } EXPECT_EQ(fake_call_->GetVideoReceiveStreams().size(), 0u); EXPECT_EQ(fake_call_->GetDeliveredPacketsForSsrc(kSsrc), 2u); @@ -6779,12 +6732,9 @@ TEST_F(WebRtcVideoChannelTest, MultiplePendingDemuxerCriteriaUpdates) { // If packets still arrive after the demuxer knows about the latest removal we // should finally create an unsignalled receive stream. { - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kSsrc); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kSsrc); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); } EXPECT_EQ(fake_call_->GetVideoReceiveStreams().size(), 1u); EXPECT_EQ(fake_call_->GetDeliveredPacketsForSsrc(kSsrc), 3u); @@ -6797,12 +6747,9 @@ TEST_F(WebRtcVideoChannelTest, UnsignalledSsrcHasACooldown) { // Send packets for kSsrc1, creating an unsignalled receive stream. { // Receive a packet for kSsrc1. - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kSsrc1); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - channel_->OnPacketReceived(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kSsrc1); + channel_->OnPacketReceived(packet.Buffer(), /* packet_time_us */ -1); } rtc::Thread::Current()->ProcessMessages(0); fake_clock_.AdvanceTime( @@ -6815,12 +6762,9 @@ TEST_F(WebRtcVideoChannelTest, UnsignalledSsrcHasACooldown) { { // Receive a packet for kSsrc2. - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kSsrc2); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - channel_->OnPacketReceived(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kSsrc2); + channel_->OnPacketReceived(packet.Buffer(), /* packet_time_us */ -1); } rtc::Thread::Current()->ProcessMessages(0); @@ -6835,12 +6779,9 @@ TEST_F(WebRtcVideoChannelTest, UnsignalledSsrcHasACooldown) { fake_clock_.AdvanceTime(webrtc::TimeDelta::Millis(1)); { // Receive a packet for kSsrc2. - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kSsrc2); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - channel_->OnPacketReceived(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kSsrc2); + channel_->OnPacketReceived(packet.Buffer(), /* packet_time_us */ -1); } rtc::Thread::Current()->ProcessMessages(0); @@ -6880,12 +6821,9 @@ TEST_F(WebRtcVideoChannelTest, BaseMinimumPlayoutDelayMsUnsignaledRecvStream) { // Spawn an unsignaled stream by sending a packet, it should inherit // default delay 200. - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - rtc::SetBE32(&data[8], kIncomingUnsignalledSsrc); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetSsrc(kIncomingUnsignalledSsrc); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); recv_stream = fake_call_->GetVideoReceiveStream(kIncomingUnsignalledSsrc); EXPECT_EQ(recv_stream->base_mininum_playout_delay_ms(), 200); @@ -6915,14 +6853,10 @@ void WebRtcVideoChannelTest::TestReceiveUnsignaledSsrcPacket( EXPECT_TRUE(channel_->SetRecvParameters(recv_parameters_)); ASSERT_EQ(0u, fake_call_->GetVideoReceiveStreams().size()); - const size_t kDataLength = 12; - uint8_t data[kDataLength]; - memset(data, 0, sizeof(data)); - - rtc::Set8(data, 1, payload_type); - rtc::SetBE32(&data[8], kIncomingUnsignalledSsrc); - rtc::CopyOnWriteBuffer packet(data, kDataLength); - ReceivePacketAndAdvanceTime(packet, /* packet_time_us */ -1); + RtpPacket packet; + packet.SetPayloadType(payload_type); + packet.SetSsrc(kIncomingUnsignalledSsrc); + ReceivePacketAndAdvanceTime(packet.Buffer(), /* packet_time_us */ -1); if (expect_created_receive_stream) { EXPECT_EQ(1u, fake_call_->GetVideoReceiveStreams().size()) @@ -7002,7 +6936,7 @@ TEST_F(WebRtcVideoChannelTest, ReceiveDifferentUnsignaledSsrc) { channel_->SetDefaultSink(&renderer); // Receive VP8 packet on first SSRC. - webrtc::RtpPacket rtp_packet; + RtpPacket rtp_packet; rtp_packet.SetPayloadType(GetEngineCodec("VP8").id); rtp_packet.SetSsrc(kIncomingUnsignalledSsrc + 1); ReceivePacketAndAdvanceTime(rtp_packet.Buffer(), /* packet_time_us */ -1); @@ -7076,7 +7010,7 @@ TEST_F(WebRtcVideoChannelTest, EXPECT_EQ(0u, fake_call_->GetVideoReceiveStreams().size()); // Receive packet on an unsignaled SSRC. - webrtc::RtpPacket rtp_packet; + RtpPacket rtp_packet; rtp_packet.SetPayloadType(GetEngineCodec("VP8").id); rtp_packet.SetSsrc(kSsrcs3[0]); ReceivePacketAndAdvanceTime(rtp_packet.Buffer(), /* packet_time_us */ -1); @@ -8701,7 +8635,7 @@ TEST_F(WebRtcVideoChannelTest, EXPECT_FALSE(rtp_parameters.encodings[0].ssrc); // Receive VP8 packet. - webrtc::RtpPacket rtp_packet; + RtpPacket rtp_packet; rtp_packet.SetPayloadType(GetEngineCodec("VP8").id); rtp_packet.SetSsrc(kIncomingUnsignalledSsrc); ReceivePacketAndAdvanceTime(rtp_packet.Buffer(), /* packet_time_us */ -1); diff --git a/media/engine/webrtc_voice_engine.cc b/media/engine/webrtc_voice_engine.cc index 7ce61b01f9..a2741f7a7b 100644 --- a/media/engine/webrtc_voice_engine.cc +++ b/media/engine/webrtc_voice_engine.cc @@ -35,6 +35,7 @@ #include "modules/audio_mixer/audio_mixer_impl.h" #include "modules/audio_processing/aec_dump/aec_dump_factory.h" #include "modules/audio_processing/include/audio_processing.h" +#include "modules/rtp_rtcp/source/rtp_util.h" #include "rtc_base/arraysize.h" #include "rtc_base/byte_order.h" #include "rtc_base/experiments/field_trial_parser.h" @@ -66,6 +67,8 @@ RTC_POP_IGNORING_WUNDEF() namespace cricket { namespace { +using ::webrtc::ParseRtpSsrc; + constexpr size_t kMaxUnsignaledRecvStreams = 4; constexpr int kNackRtpHistoryMs = 5000; @@ -2179,10 +2182,7 @@ void WebRtcVoiceMediaChannel::OnPacketReceived(rtc::CopyOnWriteBuffer packet, // Create an unsignaled receive stream for this previously not received // ssrc. If there already is N unsignaled receive streams, delete the // oldest. See: https://bugs.chromium.org/p/webrtc/issues/detail?id=5208 - uint32_t ssrc = 0; - if (!GetRtpSsrc(packet.cdata(), packet.size(), &ssrc)) { - return; - } + uint32_t ssrc = ParseRtpSsrc(packet); RTC_DCHECK(!absl::c_linear_search(unsignaled_recv_ssrcs_, ssrc)); // Add new stream. diff --git a/modules/rtp_rtcp/source/rtp_util.cc b/modules/rtp_rtcp/source/rtp_util.cc index 46c641ea2f..cf1e54254a 100644 --- a/modules/rtp_rtcp/source/rtp_util.cc +++ b/modules/rtp_rtcp/source/rtp_util.cc @@ -14,6 +14,8 @@ #include #include "api/array_view.h" +#include "modules/rtp_rtcp/source/byte_io.h" +#include "rtc_base/checks.h" namespace webrtc { namespace { @@ -43,4 +45,19 @@ bool IsRtcpPacket(rtc::ArrayView packet) { PayloadTypeIsReservedForRtcp(packet[1] & 0x7F); } +int ParseRtpPayloadType(rtc::ArrayView rtp_packet) { + RTC_DCHECK(IsRtpPacket(rtp_packet)); + return rtp_packet[1] & 0x7F; +} + +uint16_t ParseRtpSequenceNumber(rtc::ArrayView rtp_packet) { + RTC_DCHECK(IsRtpPacket(rtp_packet)); + return ByteReader::ReadBigEndian(rtp_packet.data() + 2); +} + +uint32_t ParseRtpSsrc(rtc::ArrayView rtp_packet) { + RTC_DCHECK(IsRtpPacket(rtp_packet)); + return ByteReader::ReadBigEndian(rtp_packet.data() + 8); +} + } // namespace webrtc diff --git a/modules/rtp_rtcp/source/rtp_util.h b/modules/rtp_rtcp/source/rtp_util.h index b85727bf47..835cfcd6c8 100644 --- a/modules/rtp_rtcp/source/rtp_util.h +++ b/modules/rtp_rtcp/source/rtp_util.h @@ -20,6 +20,12 @@ namespace webrtc { bool IsRtcpPacket(rtc::ArrayView packet); bool IsRtpPacket(rtc::ArrayView packet); +// Returns base rtp header fields of the rtp packet. +// Behaviour is undefined when `!IsRtpPacket(rtp_packet)`. +int ParseRtpPayloadType(rtc::ArrayView rtp_packet); +uint16_t ParseRtpSequenceNumber(rtc::ArrayView rtp_packet); +uint32_t ParseRtpSsrc(rtc::ArrayView rtp_packet); + } // namespace webrtc #endif // MODULES_RTP_RTCP_SOURCE_RTP_UTIL_H_ diff --git a/modules/rtp_rtcp/source/rtp_util_unittest.cc b/modules/rtp_rtcp/source/rtp_util_unittest.cc index 8f980ecff1..3e23416ff4 100644 --- a/modules/rtp_rtcp/source/rtp_util_unittest.cc +++ b/modules/rtp_rtcp/source/rtp_util_unittest.cc @@ -15,7 +15,7 @@ namespace webrtc { namespace { -TEST(RtpUtil, IsRtpPacket) { +TEST(RtpUtilTest, IsRtpPacket) { constexpr uint8_t kMinimalisticRtpPacket[] = {0x80, 97, 0, 0, // 0, 0, 0, 0, // 0, 0, 0, 0}; @@ -39,7 +39,7 @@ TEST(RtpUtil, IsRtpPacket) { EXPECT_FALSE(IsRtpPacket({})); } -TEST(RtpUtil, IsRtcpPacket) { +TEST(RtpUtilTest, IsRtcpPacket) { constexpr uint8_t kMinimalisticRtcpPacket[] = {0x80, 202, 0, 0}; EXPECT_TRUE(IsRtcpPacket(kMinimalisticRtcpPacket)); @@ -55,5 +55,32 @@ TEST(RtpUtil, IsRtcpPacket) { EXPECT_FALSE(IsRtcpPacket({})); } +TEST(RtpUtilTest, ParseRtpPayloadType) { + constexpr uint8_t kMinimalisticRtpPacket[] = {0x80, 97, 0, 0, // + 0, 0, 0, 0, // + 0x12, 0x34, 0x56, 0x78}; + EXPECT_EQ(ParseRtpPayloadType(kMinimalisticRtpPacket), 97); + + constexpr uint8_t kMinimalisticRtpPacketWithMarker[] = { + 0x80, 0x80 | 97, 0, 0, // + 0, 0, 0, 0, // + 0x12, 0x34, 0x56, 0x78}; + EXPECT_EQ(ParseRtpPayloadType(kMinimalisticRtpPacketWithMarker), 97); +} + +TEST(RtpUtilTest, ParseRtpSequenceNumber) { + constexpr uint8_t kMinimalisticRtpPacket[] = {0x80, 97, 0x12, 0x34, // + 0, 0, 0, 0, // + 0, 0, 0, 0}; + EXPECT_EQ(ParseRtpSequenceNumber(kMinimalisticRtpPacket), 0x1234); +} + +TEST(RtpUtilTest, ParseRtpSsrc) { + constexpr uint8_t kMinimalisticRtpPacket[] = {0x80, 97, 0, 0, // + 0, 0, 0, 0, // + 0x12, 0x34, 0x56, 0x78}; + EXPECT_EQ(ParseRtpSsrc(kMinimalisticRtpPacket), 0x12345678u); +} + } // namespace } // namespace webrtc diff --git a/pc/srtp_session.cc b/pc/srtp_session.cc index 45f6b67d12..76ab3a8fe8 100644 --- a/pc/srtp_session.cc +++ b/pc/srtp_session.cc @@ -13,7 +13,8 @@ #include #include "absl/base/attributes.h" -#include "media/base/rtp_utils.h" +#include "api/array_view.h" +#include "modules/rtp_rtcp/source/rtp_util.h" #include "pc/external_hmac.h" #include "rtc_base/logging.h" #include "rtc_base/ssl_stream_adapter.h" @@ -26,6 +27,8 @@ namespace cricket { +using ::webrtc::ParseRtpSequenceNumber; + // One more than the maximum libsrtp error code. Required by // RTC_HISTOGRAM_ENUMERATION. Keep this in sync with srtp_error_status_t defined // in srtp.h. @@ -96,8 +99,8 @@ bool SrtpSession::ProtectRtp(void* p, int in_len, int max_len, int* out_len) { *out_len = in_len; int err = srtp_protect(session_, p, out_len); - int seq_num; - GetRtpSeqNum(p, in_len, &seq_num); + int seq_num = ParseRtpSequenceNumber( + rtc::MakeArrayView(reinterpret_cast(p), in_len)); if (err != srtp_err_status_ok) { RTC_LOG(LS_WARNING) << "Failed to protect SRTP packet, seqnum=" << seq_num << ", err=" << err diff --git a/pc/srtp_transport.cc b/pc/srtp_transport.cc index c90b3fa227..47ba6d673f 100644 --- a/pc/srtp_transport.cc +++ b/pc/srtp_transport.cc @@ -18,6 +18,7 @@ #include "absl/strings/match.h" #include "media/base/rtp_utils.h" +#include "modules/rtp_rtcp/source/rtp_util.h" #include "pc/rtp_transport.h" #include "pc/srtp_session.h" #include "rtc_base/async_packet_socket.h" @@ -160,10 +161,8 @@ bool SrtpTransport::SendRtpPacket(rtc::CopyOnWriteBuffer* packet, } #endif if (!res) { - int seq_num = -1; - uint32_t ssrc = 0; - cricket::GetRtpSeqNum(data, len, &seq_num); - cricket::GetRtpSsrc(data, len, &ssrc); + uint16_t seq_num = ParseRtpSequenceNumber(*packet); + uint32_t ssrc = ParseRtpSsrc(*packet); RTC_LOG(LS_ERROR) << "Failed to protect RTP packet: size=" << len << ", seqnum=" << seq_num << ", SSRC=" << ssrc; return false; @@ -210,17 +209,13 @@ void SrtpTransport::OnRtpPacketReceived(rtc::CopyOnWriteBuffer packet, char* data = packet.MutableData(); int len = rtc::checked_cast(packet.size()); if (!UnprotectRtp(data, len, &len)) { - int seq_num = -1; - uint32_t ssrc = 0; - cricket::GetRtpSeqNum(data, len, &seq_num); - cricket::GetRtpSsrc(data, len, &ssrc); - // Limit the error logging to avoid excessive logs when there are lots of // bad packets. const int kFailureLogThrottleCount = 100; if (decryption_failure_count_ % kFailureLogThrottleCount == 0) { RTC_LOG(LS_ERROR) << "Failed to unprotect RTP packet: size=" << len - << ", seqnum=" << seq_num << ", SSRC=" << ssrc + << ", seqnum=" << ParseRtpSequenceNumber(packet) + << ", SSRC=" << ParseRtpSsrc(packet) << ", previous failure count: " << decryption_failure_count_; } From 8ab87e41a19c4bf9ccb8300a29f707ee07c9ad33 Mon Sep 17 00:00:00 2001 From: philipel Date: Mon, 19 Jul 2021 15:40:17 +0200 Subject: [PATCH 0042/1565] Add UnwrapForward and UnwrapBackwards to SeqNumUnwrapper. Bug: webrtc:12979 Change-Id: I4c3b3f5e1ff70ae528cfd73a34baafc75cccf481 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226462 Reviewed-by: Mirko Bonadei Commit-Queue: Philip Eliasson Cr-Commit-Position: refs/heads/master@{#34505} --- rtc_base/numerics/sequence_number_util.h | 22 +++++++++++++++ .../numerics/sequence_number_util_unittest.cc | 28 +++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/rtc_base/numerics/sequence_number_util.h b/rtc_base/numerics/sequence_number_util.h index 96a4974ec5..5b4ad10e94 100644 --- a/rtc_base/numerics/sequence_number_util.h +++ b/rtc_base/numerics/sequence_number_util.h @@ -109,6 +109,28 @@ class SeqNumUnwrapper { return last_unwrapped_; } + int64_t UnwrapForward(T value) { + if (!last_value_) { + last_unwrapped_ = {value}; + } else { + last_unwrapped_ += ForwardDiff(*last_value_, value); + } + + last_value_ = value; + return last_unwrapped_; + } + + int64_t UnwrapBackwards(T value) { + if (!last_value_) { + last_unwrapped_ = {value}; + } else { + last_unwrapped_ -= ReverseDiff(*last_value_, value); + } + + last_value_ = value; + return last_unwrapped_; + } + private: int64_t last_unwrapped_ = 0; absl::optional last_value_; diff --git a/rtc_base/numerics/sequence_number_util_unittest.cc b/rtc_base/numerics/sequence_number_util_unittest.cc index d7fa0b1467..c353c921fa 100644 --- a/rtc_base/numerics/sequence_number_util_unittest.cc +++ b/rtc_base/numerics/sequence_number_util_unittest.cc @@ -303,4 +303,32 @@ TEST(SeqNumUnwrapper, ManyBackwardWraps) { } } +TEST(SeqNumUnwrapper, UnwrapForward) { + SeqNumUnwrapper unwrapper; + EXPECT_EQ(255, unwrapper.Unwrap(255)); + EXPECT_EQ(256, unwrapper.UnwrapForward(0)); + EXPECT_EQ(511, unwrapper.UnwrapForward(255)); +} + +TEST(SeqNumUnwrapper, UnwrapForwardWithDivisor) { + SeqNumUnwrapper unwrapper; + EXPECT_EQ(30, unwrapper.UnwrapForward(30)); + EXPECT_EQ(36, unwrapper.UnwrapForward(3)); + EXPECT_EQ(63, unwrapper.UnwrapForward(30)); +} + +TEST(SeqNumUnwrapper, UnwrapBackwards) { + SeqNumUnwrapper unwrapper; + EXPECT_EQ(0, unwrapper.UnwrapBackwards(0)); + EXPECT_EQ(-2, unwrapper.UnwrapBackwards(254)); + EXPECT_EQ(-256, unwrapper.UnwrapBackwards(0)); +} + +TEST(SeqNumUnwrapper, UnwrapBackwardsWithDivisor) { + SeqNumUnwrapper unwrapper; + EXPECT_EQ(0, unwrapper.Unwrap(0)); + EXPECT_EQ(-2, unwrapper.UnwrapBackwards(31)); + EXPECT_EQ(-33, unwrapper.UnwrapBackwards(0)); +} + } // namespace webrtc From 8c67df3f8d0d7b275809269b93fee7ce1a7961e7 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Mon, 19 Jul 2021 11:04:42 -0700 Subject: [PATCH 0043/1565] Roll chromium_revision f151d17c93..5530932e8c (902957:903092) Change log: https://chromium.googlesource.com/chromium/src/+log/f151d17c93..5530932e8c Full diff: https://chromium.googlesource.com/chromium/src/+/f151d17c93..5530932e8c Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/4045370905..5b902c303a * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/d10287f0ec..82cbfe3e26 * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/4bd36f4249..5f3a241182 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/8f400a6394..5475b6843a * src/third_party/androidx: S6dCY92KZR4uySXoIPzDOReE8nJYQNPXboKDPsSdhpYC..zlAhnfTSwBjk1AdlgJt15ddN7j2UFayDE0Jj_xHCigAC * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/b72f3ccca5..cb9aee60bd * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/0ee0101564..36423b3763 DEPS diff: https://chromium.googlesource.com/chromium/src/+/f151d17c93..5530932e8c/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: I8aaa7e972a4662aa3d257284f07586b263135788 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226481 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34506} --- DEPS | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/DEPS b/DEPS index 67804bd591..37c9143941 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': 'f151d17c9355ab0847c1f38ba198b4cf35000d5d', + 'chromium_revision': '5530932e8cb4279aa6161fc7a8bb3169cc37bb2e', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,7 +20,7 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@4045370905def8e415021737f13e02ed6444a45c', + 'https://chromium.googlesource.com/chromium/src/base@5b902c303ae678cac11d5f0f6023e44fad3f576e', 'src/build': 'https://chromium.googlesource.com/chromium/src/build@fd86d60f33cbc794537c4da2ef7e298d7f81138e', 'src/buildtools': @@ -31,13 +31,13 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@d10287f0ec289a211be005eda584e1c8bff705aa', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@82cbfe3e262e45e3d323a81ae5038b1efe1569d4', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@4bd36f4249de782837b3463d3382f5dbe820e808', + 'https://chromium.googlesource.com/chromium/src/testing@5f3a241182e096aa5d23609a4e8aa6ae2857c827', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@8f400a639483c1e8ccc52464673d0ad44f72fbcd', + 'https://chromium.googlesource.com/chromium/src/third_party@5475b6843a3b11c91ac3e65fe79cdaa83d8c1aa8', 'src/buildtools/linux64': { 'packages': [ @@ -214,7 +214,7 @@ deps = { 'condition': 'checkout_android', }, 'src/third_party/perfetto': - 'https://android.googlesource.com/platform/external/perfetto.git@b72f3ccca5e6ec7e47a05a947156e6378d08b2a7', + 'https://android.googlesource.com/platform/external/perfetto.git@cb9aee60bd100feb1079c736444a3b72c410730d', 'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@eebc5cd487a89c51ba148f6d6ac45779970f72d7', 'src/third_party/libyuv': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@0ee0101564d9dea696db84c0ac5adde42884c958', + 'https://chromium.googlesource.com/chromium/src/tools@36423b3763ddb6a156cbc90a2cbe7a43134cef52', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'S6dCY92KZR4uySXoIPzDOReE8nJYQNPXboKDPsSdhpYC', + 'version': 'zlAhnfTSwBjk1AdlgJt15ddN7j2UFayDE0Jj_xHCigAC', }, ], 'condition': 'checkout_android', From b9657f196a4636b4e73886b50a7976aed7aa530b Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Mon, 19 Jul 2021 19:02:35 -0700 Subject: [PATCH 0044/1565] Roll chromium_revision 5530932e8c..f7fba14af8 (903092:903299) Change log: https://chromium.googlesource.com/chromium/src/+log/5530932e8c..f7fba14af8 Full diff: https://chromium.googlesource.com/chromium/src/+/5530932e8c..f7fba14af8 Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/5b902c303a..e475053b99 * src/build: https://chromium.googlesource.com/chromium/src/build/+log/fd86d60f33..33763d1a46 * src/buildtools/linux64: git_revision:b2d77ab1373192d1532af94b68fb8bab727b0e5b..git_revision:61a0153b5e60f11100a04e51393cae15268d1ee3 * src/buildtools/mac: git_revision:b2d77ab1373192d1532af94b68fb8bab727b0e5b..git_revision:61a0153b5e60f11100a04e51393cae15268d1ee3 * src/buildtools/third_party/libc++abi/trunk: https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git/+log/7d5c92f6cf..e8bf577fbf * src/buildtools/win: git_revision:b2d77ab1373192d1532af94b68fb8bab727b0e5b..git_revision:61a0153b5e60f11100a04e51393cae15268d1ee3 * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/82cbfe3e26..63cecdf569 * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/5f3a241182..adffc9a6da * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/5475b6843a..4e907ad782 * src/third_party/androidx: zlAhnfTSwBjk1AdlgJt15ddN7j2UFayDE0Jj_xHCigAC..Nvti3EVxTPLVgkynuADZvQydGWRCTGbp5aQHA3qLMP4C * src/third_party/ffmpeg: https://chromium.googlesource.com/chromium/third_party/ffmpeg.git/+log/05c195662f..14e1145ddd * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/cb9aee60bd..56537d0732 * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/36423b3763..cb13df76ea * src/tools/luci-go: git_revision:b36efc79b549f8aeb29ce40079891e1acb6c6bb2..git_revision:6387586e5b3279aebdf22bdab7ae619dbc156b66 * src/tools/luci-go: git_revision:b36efc79b549f8aeb29ce40079891e1acb6c6bb2..git_revision:6387586e5b3279aebdf22bdab7ae619dbc156b66 * src/tools/luci-go: git_revision:b36efc79b549f8aeb29ce40079891e1acb6c6bb2..git_revision:6387586e5b3279aebdf22bdab7ae619dbc156b66 DEPS diff: https://chromium.googlesource.com/chromium/src/+/5530932e8c..f7fba14af8/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: I0cf902ca234189d1291f03fa468c6b78c29b7f7b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226522 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34507} --- DEPS | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/DEPS b/DEPS index 37c9143941..d0c4e93184 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': '5530932e8cb4279aa6161fc7a8bb3169cc37bb2e', + 'chromium_revision': 'f7fba14af81d88a1879dc9d8dcc93e45a6b0a6ae', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,9 +20,9 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@5b902c303ae678cac11d5f0f6023e44fad3f576e', + 'https://chromium.googlesource.com/chromium/src/base@e475053b99ff6cd3b7c19d4cbade4b629734ec60', 'src/build': - 'https://chromium.googlesource.com/chromium/src/build@fd86d60f33cbc794537c4da2ef7e298d7f81138e', + 'https://chromium.googlesource.com/chromium/src/build@33763d1a462119b06cd66cd833ca2286cc692603', 'src/buildtools': 'https://chromium.googlesource.com/chromium/src/buildtools@37dc929ecb351687006a61744b116cda601753d7', # Gradle 6.6.1. Used for testing Android Studio project generation for WebRTC. @@ -31,19 +31,19 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@82cbfe3e262e45e3d323a81ae5038b1efe1569d4', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@63cecdf5698df4876b8b63d390e9b09f51a394d8', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@5f3a241182e096aa5d23609a4e8aa6ae2857c827', + 'https://chromium.googlesource.com/chromium/src/testing@adffc9a6daa679c41681682920830d41734da2c9', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@5475b6843a3b11c91ac3e65fe79cdaa83d8c1aa8', + 'https://chromium.googlesource.com/chromium/src/third_party@4e907ad78200a7bbb980dfb3ecc413ad3896b7b8', 'src/buildtools/linux64': { 'packages': [ { 'package': 'gn/gn/linux-amd64', - 'version': 'git_revision:b2d77ab1373192d1532af94b68fb8bab727b0e5b', + 'version': 'git_revision:61a0153b5e60f11100a04e51393cae15268d1ee3', } ], 'dep_type': 'cipd', @@ -53,7 +53,7 @@ deps = { 'packages': [ { 'package': 'gn/gn/mac-${{arch}}', - 'version': 'git_revision:b2d77ab1373192d1532af94b68fb8bab727b0e5b', + 'version': 'git_revision:61a0153b5e60f11100a04e51393cae15268d1ee3', } ], 'dep_type': 'cipd', @@ -63,7 +63,7 @@ deps = { 'packages': [ { 'package': 'gn/gn/windows-amd64', - 'version': 'git_revision:b2d77ab1373192d1532af94b68fb8bab727b0e5b', + 'version': 'git_revision:61a0153b5e60f11100a04e51393cae15268d1ee3', } ], 'dep_type': 'cipd', @@ -75,7 +75,7 @@ deps = { 'src/buildtools/third_party/libc++/trunk': 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxx.git@79a2e924d96e2fc1e4b937c42efd08898fa472d7', 'src/buildtools/third_party/libc++abi/trunk': - 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git@7d5c92f6cfb1ddb73158233a194bb568c5b13554', + 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libcxxabi.git@e8bf577fbfe1b1ce53fcade2a5f3f0fe02fa1a2e', 'src/buildtools/third_party/libunwind/trunk': 'https://chromium.googlesource.com/external/github.com/llvm/llvm-project/libunwind.git@d7b11d7989774617bd7df93af95734faac8c0b2c', @@ -139,7 +139,7 @@ deps = { 'src/third_party/depot_tools': 'https://chromium.googlesource.com/chromium/tools/depot_tools.git@a806594b95a39141fdbf1f359087a44ffb2deaaf', 'src/third_party/ffmpeg': - 'https://chromium.googlesource.com/chromium/third_party/ffmpeg.git@05c195662f0527913811827ba253cb93758ea4c0', + 'https://chromium.googlesource.com/chromium/third_party/ffmpeg.git@14e1145ddd3d5f3ba478a19b4ae8822679d83a6c', 'src/third_party/findbugs': { 'url': 'https://chromium.googlesource.com/chromium/deps/findbugs.git@4275d9ac8610db6b1bc9a5e887f97e41b33fac67', 'condition': 'checkout_android', @@ -214,7 +214,7 @@ deps = { 'condition': 'checkout_android', }, 'src/third_party/perfetto': - 'https://android.googlesource.com/platform/external/perfetto.git@cb9aee60bd100feb1079c736444a3b72c410730d', + 'https://android.googlesource.com/platform/external/perfetto.git@56537d0732d7cda6c26453cc60eee9e63a7f106a', 'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@eebc5cd487a89c51ba148f6d6ac45779970f72d7', 'src/third_party/libyuv': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@36423b3763ddb6a156cbc90a2cbe7a43134cef52', + 'https://chromium.googlesource.com/chromium/src/tools@cb13df76ea835f3b7d611d423dd797507028fec5', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'zlAhnfTSwBjk1AdlgJt15ddN7j2UFayDE0Jj_xHCigAC', + 'version': 'Nvti3EVxTPLVgkynuADZvQydGWRCTGbp5aQHA3qLMP4C', }, ], 'condition': 'checkout_android', @@ -477,15 +477,15 @@ deps = { 'packages': [ { 'package': 'infra/tools/luci/isolate/${{platform}}', - 'version': 'git_revision:b36efc79b549f8aeb29ce40079891e1acb6c6bb2', + 'version': 'git_revision:6387586e5b3279aebdf22bdab7ae619dbc156b66', }, { 'package': 'infra/tools/luci/isolated/${{platform}}', - 'version': 'git_revision:b36efc79b549f8aeb29ce40079891e1acb6c6bb2', + 'version': 'git_revision:6387586e5b3279aebdf22bdab7ae619dbc156b66', }, { 'package': 'infra/tools/luci/swarming/${{platform}}', - 'version': 'git_revision:b36efc79b549f8aeb29ce40079891e1acb6c6bb2', + 'version': 'git_revision:6387586e5b3279aebdf22bdab7ae619dbc156b66', }, ], 'dep_type': 'cipd', From c1eaaeceb650f51644046dc6e3a286601ea74979 Mon Sep 17 00:00:00 2001 From: webrtc-version-updater Date: Mon, 19 Jul 2021 21:04:58 -0700 Subject: [PATCH 0045/1565] Update WebRTC code version (2021-07-20T04:04:55). TBR=webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com,mbonadei@webrtc.org Bug: None Change-Id: I957a9d050558fc141b476e3c484b161685727796 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226524 Reviewed-by: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Commit-Queue: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Cr-Commit-Position: refs/heads/master@{#34508} --- call/version.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/call/version.cc b/call/version.cc index 7ffcce6e17..d1d638835e 100644 --- a/call/version.cc +++ b/call/version.cc @@ -13,7 +13,7 @@ namespace webrtc { // The timestamp is always in UTC. -const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-19T04:02:14"; +const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-20T04:04:55"; void LoadWebRTCVersionInRegister() { // Using volatile to instruct the compiler to not optimize `p` away even From 9e09831767995531ae1c2804e1c15fa2be4053f2 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Tue, 20 Jul 2021 09:43:24 +0200 Subject: [PATCH 0046/1565] Make webrtc_fuzzer_test use //:common_config. Before this CL, the GN template webrtc_fuzzer_test was using a build config that was different from the one used by other WebRTC's targets. We discovered this in [1] where we detected that RTC_DCHECK_IS_ON had different values across translation units (1 everywhere and 0 in the one of the .cc file owned by the webrtc_fuzzer_test). This was because webrtc_fuzzer_test was not including the default config //:common_config in its "configs". [1] - https://webrtc-review.googlesource.com/c/src/+/226465 Bug: None Change-Id: I5635d90281769c23c5d86ebc8cb494da029c2e85 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226540 Reviewed-by: Andrey Logvin Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34509} --- test/fuzzers/BUILD.gn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/fuzzers/BUILD.gn b/test/fuzzers/BUILD.gn index 9824bebb5f..4afab1d8af 100644 --- a/test/fuzzers/BUILD.gn +++ b/test/fuzzers/BUILD.gn @@ -42,6 +42,7 @@ rtc_library("fuzz_data_helper") { } set_defaults("webrtc_fuzzer_test") { + configs = rtc_add_configs absl_deps = [] } @@ -52,6 +53,7 @@ template("webrtc_fuzzer_test") { ":fuzz_data_helper", ":webrtc_fuzzer_main", ] + configs += invoker.configs # If absl_deps is [], no action is needed. If not [], then it needs to be # converted to //third_party/abseil-cpp:absl when build_with_chromium=true From 022567dc9c184fb44d44473e47e2570d890eaf86 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Tue, 20 Jul 2021 08:33:08 +0000 Subject: [PATCH 0047/1565] Revert "Make webrtc_fuzzer_test use //:common_config." This reverts commit 9e09831767995531ae1c2804e1c15fa2be4053f2. Reason for revert: The "fuzzer_test" GN template expanded by "webrtc_fuzzer_test" still ignores the "configs" and another field needs to be used. Original change's description: > Make webrtc_fuzzer_test use //:common_config. > > Before this CL, the GN template webrtc_fuzzer_test was using a build > config that was different from the one used by other WebRTC's targets. > > We discovered this in [1] where we detected that RTC_DCHECK_IS_ON had > different values across translation units (1 everywhere and 0 in the > one of the .cc file owned by the webrtc_fuzzer_test). > > This was because webrtc_fuzzer_test was not including the default > config //:common_config in its "configs". > > [1] - https://webrtc-review.googlesource.com/c/src/+/226465 > > Bug: None > Change-Id: I5635d90281769c23c5d86ebc8cb494da029c2e85 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226540 > Reviewed-by: Andrey Logvin > Commit-Queue: Mirko Bonadei > Cr-Commit-Position: refs/heads/master@{#34509} TBR=mbonadei@webrtc.org,landrey@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com Change-Id: Iec13b411e7f027e78e731e3242e0557b6de38a2b No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: None Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226541 Reviewed-by: Mirko Bonadei Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34510} --- test/fuzzers/BUILD.gn | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/fuzzers/BUILD.gn b/test/fuzzers/BUILD.gn index 4afab1d8af..9824bebb5f 100644 --- a/test/fuzzers/BUILD.gn +++ b/test/fuzzers/BUILD.gn @@ -42,7 +42,6 @@ rtc_library("fuzz_data_helper") { } set_defaults("webrtc_fuzzer_test") { - configs = rtc_add_configs absl_deps = [] } @@ -53,7 +52,6 @@ template("webrtc_fuzzer_test") { ":fuzz_data_helper", ":webrtc_fuzzer_main", ] - configs += invoker.configs # If absl_deps is [], no action is needed. If not [], then it needs to be # converted to //third_party/abseil-cpp:absl when build_with_chromium=true From 3b35fbcb66fee8af58b0c0990527833f1dcbcd7b Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Tue, 20 Jul 2021 10:37:07 +0200 Subject: [PATCH 0048/1565] Reland "Make webrtc_fuzzer_test use //:common_config." This is a reland of 9e09831767995531ae1c2804e1c15fa2be4053f2 The field "additional_configs" needs to be used to set "configs" for the "fuzzer_test" GN template. See https://source.chromium.org/chromium/chromium/src/+/main:testing/libfuzzer/fuzzer_test.gni;l=18;drc=825f86aa594207bfc50f87495544b48014814c9d. Original change's description: > Make webrtc_fuzzer_test use //:common_config. > > Before this CL, the GN template webrtc_fuzzer_test was using a build > config that was different from the one used by other WebRTC's targets. > > We discovered this in [1] where we detected that RTC_DCHECK_IS_ON had > different values across translation units (1 everywhere and 0 in the > one of the .cc file owned by the webrtc_fuzzer_test). > > This was because webrtc_fuzzer_test was not including the default > config //:common_config in its "configs". > > [1] - https://webrtc-review.googlesource.com/c/src/+/226465 > > Bug: None > Change-Id: I5635d90281769c23c5d86ebc8cb494da029c2e85 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226540 > Reviewed-by: Andrey Logvin > Commit-Queue: Mirko Bonadei > Cr-Commit-Position: refs/heads/master@{#34509} Bug: None Change-Id: I56e2a7ea811a94762e09953acf3d33d3f46b1d24 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226542 Reviewed-by: Andrey Logvin Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34511} --- test/fuzzers/BUILD.gn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/fuzzers/BUILD.gn b/test/fuzzers/BUILD.gn index 9824bebb5f..201cb49192 100644 --- a/test/fuzzers/BUILD.gn +++ b/test/fuzzers/BUILD.gn @@ -42,6 +42,7 @@ rtc_library("fuzz_data_helper") { } set_defaults("webrtc_fuzzer_test") { + configs = rtc_add_configs absl_deps = [] } @@ -52,6 +53,7 @@ template("webrtc_fuzzer_test") { ":fuzz_data_helper", ":webrtc_fuzzer_main", ] + additional_configs = configs # If absl_deps is [], no action is needed. If not [], then it needs to be # converted to //third_party/abseil-cpp:absl when build_with_chromium=true From 9f2a20f4342a3e86e1f9fdfe6f3d76fb539d41c2 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Tue, 20 Jul 2021 10:08:06 +0200 Subject: [PATCH 0049/1565] Add WebRTC specific dcheck_always_on. Inspired by V8 CL: crrev.com/c/3038528. This makes the WebRTC's dcheck control independent of Chromium's and prepares switching Chromium's default behavior without affecting WebRTC developers or builders. Preparation for: https://crrev.com/c/2893204 Bug: chromium:1225701, webrtc:12988 Change-Id: Ia0d21f9fb8e9d7704fd1beca16504c301a263b3b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226465 Commit-Queue: Mirko Bonadei Reviewed-by: Markus Handell Reviewed-by: Dirk Pranke Cr-Commit-Position: refs/heads/master@{#34512} --- BUILD.gn | 4 ++++ rtc_base/checks.h | 2 +- rtc_base/thread.cc | 6 +++--- rtc_base/thread.h | 8 +++++--- rtc_base/thread_unittest.cc | 4 ++-- tools_webrtc/coverage/generate_ios_coverage_command.py | 4 ++-- tools_webrtc/mb/docs/user_guide.md | 10 +++++----- tools_webrtc/mb/mb_config.pyl | 8 ++++---- webrtc.gni | 6 ++++++ 9 files changed, 32 insertions(+), 20 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index bc51df7c07..e82f0fc80c 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -252,6 +252,10 @@ config("common_config") { cflags_objc = [] defines = [] + if (rtc_dcheck_always_on) { + defines += [ "RTC_DCHECK_ALWAYS_ON" ] + } + if (rtc_enable_protobuf) { defines += [ "WEBRTC_ENABLE_PROTOBUF=1" ] } else { diff --git a/rtc_base/checks.h b/rtc_base/checks.h index 21fca7e40f..e7584fb11c 100644 --- a/rtc_base/checks.h +++ b/rtc_base/checks.h @@ -14,7 +14,7 @@ // If you for some reson need to know if DCHECKs are on, test the value of // RTC_DCHECK_IS_ON. (Test its value, not if it's defined; it'll always be // defined, to either a true or a false value.) -#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) +#if !defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON) #define RTC_DCHECK_IS_ON 1 #else #define RTC_DCHECK_IS_ON 0 diff --git a/rtc_base/thread.cc b/rtc_base/thread.cc index 8ca9ce76a8..b54cdedf50 100644 --- a/rtc_base/thread.cc +++ b/rtc_base/thread.cc @@ -1044,7 +1044,7 @@ void Thread::QueuedTaskHandler::OnMessage(Message* msg) { } void Thread::AllowInvokesToThread(Thread* thread) { -#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) +#if (!defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON)) if (!IsCurrent()) { PostTask(webrtc::ToQueuedTask( [thread, this]() { AllowInvokesToThread(thread); })); @@ -1057,7 +1057,7 @@ void Thread::AllowInvokesToThread(Thread* thread) { } void Thread::DisallowAllInvokes() { -#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) +#if (!defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON)) if (!IsCurrent()) { PostTask(webrtc::ToQueuedTask([this]() { DisallowAllInvokes(); })); return; @@ -1082,7 +1082,7 @@ uint32_t Thread::GetCouldBeBlockingCallCount() const { // Returns true if no policies added or if there is at least one policy // that permits invocation to |target| thread. bool Thread::IsInvokeToThreadAllowed(rtc::Thread* target) { -#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) +#if (!defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON)) RTC_DCHECK_RUN_ON(this); if (!invoke_policy_enabled_) { return true; diff --git a/rtc_base/thread.h b/rtc_base/thread.h index 6e68f1a679..cb5a0e9cd0 100644 --- a/rtc_base/thread.h +++ b/rtc_base/thread.h @@ -400,15 +400,17 @@ class RTC_LOCKABLE RTC_EXPORT Thread : public webrtc::TaskQueueBase { // Allows invoke to specified |thread|. Thread never will be dereferenced and // will be used only for reference-based comparison, so instance can be safely - // deleted. If NDEBUG is defined and DCHECK_ALWAYS_ON is undefined do nothing. + // deleted. If NDEBUG is defined and RTC_DCHECK_ALWAYS_ON is undefined do + // nothing. void AllowInvokesToThread(Thread* thread); - // If NDEBUG is defined and DCHECK_ALWAYS_ON is undefined do nothing. + // If NDEBUG is defined and RTC_DCHECK_ALWAYS_ON is undefined do nothing. void DisallowAllInvokes(); // Returns true if |target| was allowed by AllowInvokesToThread() or if no // calls were made to AllowInvokesToThread and DisallowAllInvokes. Otherwise // returns false. - // If NDEBUG is defined and DCHECK_ALWAYS_ON is undefined always returns true. + // If NDEBUG is defined and RTC_DCHECK_ALWAYS_ON is undefined always returns + // true. bool IsInvokeToThreadAllowed(rtc::Thread* target); // Posts a task to invoke the functor on |this| thread asynchronously, i.e. diff --git a/rtc_base/thread_unittest.cc b/rtc_base/thread_unittest.cc index 789bdd943e..e603930564 100644 --- a/rtc_base/thread_unittest.cc +++ b/rtc_base/thread_unittest.cc @@ -366,7 +366,7 @@ TEST(ThreadTest, Wrap) { ThreadManager::Instance()->SetCurrentThread(current_thread); } -#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) +#if (!defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON)) TEST(ThreadTest, InvokeToThreadAllowedReturnsTrueWithoutPolicies) { // Create and start the thread. auto thread1 = Thread::CreateWithSocketServer(); @@ -410,7 +410,7 @@ TEST(ThreadTest, InvokesDisallowedWhenDisallowAllInvokes) { Thread* th_main = Thread::Current(); th_main->ProcessMessages(100); } -#endif // (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) +#endif // (!defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON)) TEST(ThreadTest, InvokesAllowedByDefault) { // Create and start the thread. diff --git a/tools_webrtc/coverage/generate_ios_coverage_command.py b/tools_webrtc/coverage/generate_ios_coverage_command.py index e01a75c049..ff17c58863 100644 --- a/tools_webrtc/coverage/generate_ios_coverage_command.py +++ b/tools_webrtc/coverage/generate_ios_coverage_command.py @@ -89,7 +89,7 @@ def GetGNArgs(is_simulator): target_cpu = 'x64' if is_simulator else 'arm64' return ([] + ['target_os="ios"'] + ['target_cpu="%s"' % target_cpu] + ['use_clang_coverage=true'] + ['is_component_build=false'] + - ['dcheck_always_on=true']) + ['rtc_dcheck_always_on=true']) def GenerateIOSSimulatorCommand(): @@ -103,7 +103,7 @@ def GenerateIOSSimulatorCommand(): [FormatIossimTest(t, is_xctest=True) for t in XC_TESTS] + [FormatIossimTest(t, is_xctest=False) for t in TESTS]) - print 'To get code coverage using iOS simulator just run following commands:' + print 'To get code coverage using iOS sim just run following commands:' print '' print ' '.join(gn_cmd) print '' diff --git a/tools_webrtc/mb/docs/user_guide.md b/tools_webrtc/mb/docs/user_guide.md index 8c66cd328c..a8857d2087 100644 --- a/tools_webrtc/mb/docs/user_guide.md +++ b/tools_webrtc/mb/docs/user_guide.md @@ -248,8 +248,8 @@ For example, if you had: } 'mixins': { 'bot': { - 'gyp_defines': 'use_goma=1 dcheck_always_on=0', - 'gn_args': 'use_goma=true dcheck_always_on=false', + 'gyp_defines': 'use_goma=1 rtc_dcheck_always_on=0', + 'gn_args': 'use_goma=true rtc_dcheck_always_on=false', }, 'debug': { 'gn_args': 'is_debug=true', @@ -267,8 +267,8 @@ For example, if you had: 'gyp_defines': 'component=shared_library', }, 'trybot': { - 'gyp_defines': 'dcheck_always_on=1', - 'gn_args': 'dcheck_always_on=true', + 'gyp_defines': 'rtc_dcheck_always_on=1', + 'gn_args': 'rtc_dcheck_always_on=true', } } } @@ -276,7 +276,7 @@ For example, if you had: and you ran `mb gen -c linux_release_trybot //out/Release`, it would translate into a call to `gyp_chromium -G Release` with `GYP_DEFINES` set to -`"use_goma=true dcheck_always_on=false dcheck_always_on=true"`. +`"use_goma=true rtc_dcheck_always_on=false rtc_dcheck_always_on=true"`. (From that you can see that mb is intentionally dumb and does not attempt to de-dup the flags, it lets gyp do that). diff --git a/tools_webrtc/mb/mb_config.pyl b/tools_webrtc/mb/mb_config.pyl index 253a57acc5..74678f875e 100644 --- a/tools_webrtc/mb/mb_config.pyl +++ b/tools_webrtc/mb/mb_config.pyl @@ -459,8 +459,8 @@ 'gn_args': 'is_clang=true', }, - 'dcheck_always_on': { - 'gn_args': 'dcheck_always_on=true', + 'rtc_dcheck_always_on': { + 'gn_args': 'rtc_dcheck_always_on=true', }, 'debug': { @@ -548,11 +548,11 @@ }, 'release_bot': { - 'mixins': ['pure_release_bot', 'dcheck_always_on'], + 'mixins': ['pure_release_bot', 'rtc_dcheck_always_on'], }, 'release_bot_no_goma': { - 'mixins': ['release', 'no_goma', 'dcheck_always_on'], + 'mixins': ['release', 'no_goma', 'rtc_dcheck_always_on'], }, 'tsan': { diff --git a/webrtc.gni b/webrtc.gni index a338d723ed..c1fd479832 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -6,6 +6,7 @@ # in the file PATENTS. All contributing project authors may # be found in the AUTHORS file in the root of the source tree. import("//build/config/arm.gni") +import("//build/config/dcheck_always_on.gni") import("//build/config/features.gni") import("//build/config/mips.gni") import("//build/config/sanitizers/sanitizers.gni") @@ -36,6 +37,11 @@ if (is_mac) { } declare_args() { + # Separate control for dchecks in V8. Defaults to Chromium's behavior if + # built with Chromium. + # When set to true, it will enable RTC_DCHECK() also in Release builds. + rtc_dcheck_always_on = build_with_chromium && dcheck_always_on + # Setting this to true will make RTC_EXPORT (see rtc_base/system/rtc_export.h) # expand to code that will manage symbols visibility. rtc_enable_symbol_export = false From dbab1be1d13060666b303209eded45c55cb46856 Mon Sep 17 00:00:00 2001 From: philipel Date: Mon, 19 Jul 2021 18:43:34 +0200 Subject: [PATCH 0050/1565] Always unwrap VP9 TL0PicIdx forward if the frame is newer. Bug: webrtc:12979 Change-Id: Idcc14f8f61b04f9eb194b55ffa40fb95319a881c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226463 Reviewed-by: Danil Chapovalov Reviewed-by: Ilya Nikolaevskiy Reviewed-by: Mirko Bonadei Commit-Queue: Philip Eliasson Cr-Commit-Position: refs/heads/master@{#34513} --- modules/video_coding/rtp_vp9_ref_finder.cc | 26 ++++++++++++++----- modules/video_coding/rtp_vp9_ref_finder.h | 7 +++-- .../rtp_vp9_ref_finder_unittest.cc | 19 ++++++++++++++ 3 files changed, 44 insertions(+), 8 deletions(-) diff --git a/modules/video_coding/rtp_vp9_ref_finder.cc b/modules/video_coding/rtp_vp9_ref_finder.cc index b44bb2500d..d823871865 100644 --- a/modules/video_coding/rtp_vp9_ref_finder.cc +++ b/modules/video_coding/rtp_vp9_ref_finder.cc @@ -77,8 +77,21 @@ RtpVp9RefFinder::FrameDecision RtpVp9RefFinder::ManageFrameInternal( } GofInfo* info; - int64_t unwrapped_tl0 = - tl0_unwrapper_.Unwrap(codec_header.tl0_pic_idx & 0xFF); + + // The VP9 `tl0_pic_idx` is 8 bits and therefor wraps often. In the case of + // packet loss the next received frame could have a `tl0_pic_idx` that looks + // older than the previously received frame. Always wrap forward if |frame| is + // newer in RTP packet sequence number order. + int64_t unwrapped_tl0; + auto tl0_it = gof_info_.rbegin(); + if (tl0_it != gof_info_.rend() && + AheadOf(frame->last_seq_num(), tl0_it->second.last_seq_num)) { + unwrapped_tl0 = + tl0_unwrapper_.UnwrapForward(codec_header.tl0_pic_idx & 0xFF); + } else { + unwrapped_tl0 = tl0_unwrapper_.Unwrap(codec_header.tl0_pic_idx & 0xFF); + } + if (codec_header.ss_data_available) { if (codec_header.temporal_idx != 0) { RTC_LOG(LS_WARNING) << "Received scalability structure on a non base " @@ -104,9 +117,9 @@ RtpVp9RefFinder::FrameDecision RtpVp9RefFinder::ManageFrameInternal( current_ss_idx_ = Add(current_ss_idx_, 1); scalability_structures_[current_ss_idx_] = gof; scalability_structures_[current_ss_idx_].pid_start = frame->Id(); - gof_info_.emplace( - unwrapped_tl0, - GofInfo(&scalability_structures_[current_ss_idx_], frame->Id())); + gof_info_.emplace(unwrapped_tl0, + GofInfo(&scalability_structures_[current_ss_idx_], + frame->Id(), frame->last_seq_num())); } const auto gof_info_it = gof_info_.find(unwrapped_tl0); @@ -147,7 +160,8 @@ RtpVp9RefFinder::FrameDecision RtpVp9RefFinder::ManageFrameInternal( if (codec_header.temporal_idx == 0) { gof_info_it = gof_info_ .emplace(unwrapped_tl0, - GofInfo(gof_info_it->second.gof, frame->Id())) + GofInfo(gof_info_it->second.gof, frame->Id(), + frame->last_seq_num())) .first; } diff --git a/modules/video_coding/rtp_vp9_ref_finder.h b/modules/video_coding/rtp_vp9_ref_finder.h index 81008fea88..dc912b6f42 100644 --- a/modules/video_coding/rtp_vp9_ref_finder.h +++ b/modules/video_coding/rtp_vp9_ref_finder.h @@ -42,10 +42,13 @@ class RtpVp9RefFinder { enum FrameDecision { kStash, kHandOff, kDrop }; struct GofInfo { - GofInfo(GofInfoVP9* gof, uint16_t last_picture_id) - : gof(gof), last_picture_id(last_picture_id) {} + GofInfo(GofInfoVP9* gof, uint16_t last_picture_id, uint16_t last_seq_num) + : gof(gof), + last_picture_id(last_picture_id), + last_seq_num(last_seq_num) {} GofInfoVP9* gof; uint16_t last_picture_id; + uint16_t last_seq_num; }; FrameDecision ManageFrameInternal(RtpFrameObject* frame); diff --git a/modules/video_coding/rtp_vp9_ref_finder_unittest.cc b/modules/video_coding/rtp_vp9_ref_finder_unittest.cc index 6de7ce106f..9fe24c404b 100644 --- a/modules/video_coding/rtp_vp9_ref_finder_unittest.cc +++ b/modules/video_coding/rtp_vp9_ref_finder_unittest.cc @@ -23,6 +23,7 @@ using ::testing::Matches; using ::testing::MatchResultListener; using ::testing::Pointee; using ::testing::Property; +using ::testing::SizeIs; using ::testing::UnorderedElementsAreArray; namespace webrtc { @@ -661,6 +662,24 @@ TEST_F(RtpVp9RefFinderTest, GofTl0Jump) { Insert(Frame().Pid(1).SidAndTid(0, 0).Tl0(0).Gof(&ss)); } +TEST_F(RtpVp9RefFinderTest, DontDiscardNewerFramesWithWrappedTl0) { + GofInfoVP9 ss; + ss.SetGofInfoVP9(kTemporalStructureMode1); + + Insert( + Frame().Pid(0).SidAndTid(0, 0).Tl0(0).SeqNum(0, 0).AsKeyFrame().Gof(&ss)); + // ... 254 frames are lost ... + Insert(Frame() + .Pid(255) + .SidAndTid(0, 0) + .Tl0(255) + .SeqNum(255, 255) + .AsKeyFrame() + .Gof(&ss)); + + EXPECT_THAT(frames_, SizeIs(2)); +} + TEST_F(RtpVp9RefFinderTest, GofTidTooHigh) { const int kMaxTemporalLayers = 5; GofInfoVP9 ss; From 5b088a0949f13f59a415d49cee1d124a1c233d98 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Tue, 20 Jul 2021 03:02:36 -0700 Subject: [PATCH 0051/1565] Roll chromium_revision f7fba14af8..d65a57d6ca (903299:903399) Change log: https://chromium.googlesource.com/chromium/src/+log/f7fba14af8..d65a57d6ca Full diff: https://chromium.googlesource.com/chromium/src/+/f7fba14af8..d65a57d6ca Changed dependencies * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/63cecdf569..f157952d74 * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/adffc9a6da..c4fd353bed * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/4e907ad782..a5a334ae22 * src/third_party/androidx: Nvti3EVxTPLVgkynuADZvQydGWRCTGbp5aQHA3qLMP4C..3LEkAxvMyv3fgl0tjQXjlDeT_bwP9wCnOly8fNQlZQkC * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/cb13df76ea..ed069b3b3f DEPS diff: https://chromium.googlesource.com/chromium/src/+/f7fba14af8..d65a57d6ca/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: I6d6a0b26e70df81b709a70cc71f5745cf0fcd1e9 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226526 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34514} --- DEPS | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/DEPS b/DEPS index d0c4e93184..9ca89872f1 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': 'f7fba14af81d88a1879dc9d8dcc93e45a6b0a6ae', + 'chromium_revision': 'd65a57d6cafcca09f72823b4ac6cff49f74b9d95', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -31,13 +31,13 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@63cecdf5698df4876b8b63d390e9b09f51a394d8', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@f157952d746f4e8fdef387b8d0d2cbe3140aa89d', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@adffc9a6daa679c41681682920830d41734da2c9', + 'https://chromium.googlesource.com/chromium/src/testing@c4fd353bed5807850d77098a9c76c758ecd66078', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@4e907ad78200a7bbb980dfb3ecc413ad3896b7b8', + 'https://chromium.googlesource.com/chromium/src/third_party@a5a334ae22d9bf4441119a1351edf73e9e9b1c34', 'src/buildtools/linux64': { 'packages': [ @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@cb13df76ea835f3b7d611d423dd797507028fec5', + 'https://chromium.googlesource.com/chromium/src/tools@ed069b3b3f0c88e9135e0ef4cffb8037be5d0ff0', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'Nvti3EVxTPLVgkynuADZvQydGWRCTGbp5aQHA3qLMP4C', + 'version': '3LEkAxvMyv3fgl0tjQXjlDeT_bwP9wCnOly8fNQlZQkC', }, ], 'condition': 'checkout_android', From 1ccc5a55e1df129d4335e7bc5cdaa57b1ab9883c Mon Sep 17 00:00:00 2001 From: Danil Chapovalov Date: Tue, 20 Jul 2021 10:00:47 +0000 Subject: [PATCH 0052/1565] Delete helper to parse rtcp packet into rtp header The only user of that function is only interested in the type of the first rtcp message in the packet, which can be extracted in a simpler way Bug: None Change-Id: I96aeb8ed66099f94d506aa7d8d0d07378f6c952e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226543 Commit-Queue: Danil Chapovalov Reviewed-by: Niels Moller Cr-Commit-Position: refs/heads/master@{#34515} --- modules/rtp_rtcp/source/rtp_utility.cc | 27 -------------------------- modules/rtp_rtcp/source/rtp_utility.h | 1 - test/rtp_file_reader.cc | 26 ++++++++++++------------- 3 files changed, 13 insertions(+), 41 deletions(-) diff --git a/modules/rtp_rtcp/source/rtp_utility.cc b/modules/rtp_rtcp/source/rtp_utility.cc index 9b68f0dead..d76e1981f6 100644 --- a/modules/rtp_rtcp/source/rtp_utility.cc +++ b/modules/rtp_rtcp/source/rtp_utility.cc @@ -130,33 +130,6 @@ bool RtpHeaderParser::RTCP() const { } } -bool RtpHeaderParser::ParseRtcp(RTPHeader* header) const { - RTC_DCHECK(header); - - const ptrdiff_t length = _ptrRTPDataEnd - _ptrRTPDataBegin; - if (length < kRtcpMinParseLength) { - return false; - } - - const uint8_t V = _ptrRTPDataBegin[0] >> 6; - if (V != kRtcpExpectedVersion) { - return false; - } - - const uint8_t PT = _ptrRTPDataBegin[1]; - const size_t len = (_ptrRTPDataBegin[2] << 8) + _ptrRTPDataBegin[3]; - const uint8_t* ptr = &_ptrRTPDataBegin[4]; - - uint32_t SSRC = ByteReader::ReadBigEndian(ptr); - ptr += 4; - - header->payloadType = PT; - header->ssrc = SSRC; - header->headerLength = 4 + (len << 2); - - return true; -} - bool RtpHeaderParser::Parse(RTPHeader* header, const RtpHeaderExtensionMap* ptrExtensionMap, bool header_only) const { diff --git a/modules/rtp_rtcp/source/rtp_utility.h b/modules/rtp_rtcp/source/rtp_utility.h index cdfff4072f..20aac54855 100644 --- a/modules/rtp_rtcp/source/rtp_utility.h +++ b/modules/rtp_rtcp/source/rtp_utility.h @@ -37,7 +37,6 @@ class RtpHeaderParser { ABSL_DEPRECATED("Use IsRtpPacket or IsRtcpPacket") bool RTCP() const; - bool ParseRtcp(RTPHeader* header) const; bool Parse(RTPHeader* parsedPacket, const RtpHeaderExtensionMap* ptrExtensionMap = nullptr, bool header_only = false) const; diff --git a/test/rtp_file_reader.cc b/test/rtp_file_reader.cc index a09d5a66e4..203cbdfeed 100644 --- a/test/rtp_file_reader.cc +++ b/test/rtp_file_reader.cc @@ -18,7 +18,6 @@ #include #include "modules/rtp_rtcp/source/rtp_util.h" -#include "modules/rtp_rtcp/source/rtp_utility.h" #include "rtc_base/checks.h" #include "rtc_base/constructor_magic.h" #include "rtc_base/format_macros.h" @@ -295,7 +294,7 @@ class PcapReader : public RtpFileReaderImpl { mit != packets_by_ssrc_.end(); ++mit) { uint32_t ssrc = mit->first; const std::vector& packet_indices = mit->second; - uint8_t pt = packets_[packet_indices[0]].rtp_header.payloadType; + int pt = packets_[packet_indices[0]].payload_type; printf("SSRC: %08x, %" RTC_PRIuS " packets, pt=%d\n", ssrc, packet_indices.size(), pt); } @@ -358,7 +357,9 @@ class PcapReader : public RtpFileReaderImpl { uint32_t dest_ip; uint16_t source_port; uint16_t dest_port; - RTPHeader rtp_header; + // Payload type of the RTP packet, + // or RTCP packet type of the first RTCP packet in a compound RTCP packet. + int payload_type; int32_t pos_in_file; // Byte offset of payload from start of file. uint32_t payload_length; }; @@ -434,17 +435,13 @@ class PcapReader : public RtpFileReaderImpl { } TRY_PCAP(Read(read_buffer_, marker.payload_length)); - RtpUtility::RtpHeaderParser rtp_parser(read_buffer_, marker.payload_length); - if (IsRtcpPacket(rtc::MakeArrayView(read_buffer_, marker.payload_length))) { - rtp_parser.ParseRtcp(&marker.rtp_header); + rtc::ArrayView packet(read_buffer_, marker.payload_length); + if (IsRtcpPacket(packet)) { + marker.payload_type = packet[1]; packets_.push_back(marker); - } else { - if (!rtp_parser.Parse(&marker.rtp_header, nullptr)) { - RTC_LOG(LS_INFO) << "Not recognized as RTP/RTCP"; - return kResultSkip; - } - - uint32_t ssrc = marker.rtp_header.ssrc; + } else if (IsRtpPacket(packet)) { + uint32_t ssrc = ParseRtpSsrc(packet); + marker.payload_type = ParseRtpPayloadType(packet); if (ssrc_filter.empty() || ssrc_filter.find(ssrc) != ssrc_filter.end()) { packets_by_ssrc_[ssrc].push_back( static_cast(packets_.size())); @@ -452,6 +449,9 @@ class PcapReader : public RtpFileReaderImpl { } else { return kResultSkip; } + } else { + RTC_LOG(LS_INFO) << "Not recognized as RTP/RTCP"; + return kResultSkip; } return kResultSuccess; From ff9e967b6f0b646cf8159f7040cdd7b6a48293f6 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Tue, 20 Jul 2021 11:06:17 -0700 Subject: [PATCH 0053/1565] Roll chromium_revision d65a57d6ca..28dd35b270 (903399:903575) Change log: https://chromium.googlesource.com/chromium/src/+log/d65a57d6ca..28dd35b270 Full diff: https://chromium.googlesource.com/chromium/src/+/d65a57d6ca..28dd35b270 Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/e475053b99..c147c2b700 * src/build: https://chromium.googlesource.com/chromium/src/build/+log/33763d1a46..7b9d584a16 * src/buildtools/linux64: git_revision:61a0153b5e60f11100a04e51393cae15268d1ee3..git_revision:d565aa3e72dd9e81da9595ee8c9d7b24cb45c48b * src/buildtools/mac: git_revision:61a0153b5e60f11100a04e51393cae15268d1ee3..git_revision:d565aa3e72dd9e81da9595ee8c9d7b24cb45c48b * src/buildtools/win: git_revision:61a0153b5e60f11100a04e51393cae15268d1ee3..git_revision:d565aa3e72dd9e81da9595ee8c9d7b24cb45c48b * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/f157952d74..f7979bc111 * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/c4fd353bed..1119ed7eb2 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/a5a334ae22..4a534c5726 * src/third_party/androidx: 3LEkAxvMyv3fgl0tjQXjlDeT_bwP9wCnOly8fNQlZQkC..ak5sLJWTzTXot5KoqTvJsoSbbL-L5TYYMVsXEzVZDVsC * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/56537d0732..99063db35d * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/ed069b3b3f..50359373bc DEPS diff: https://chromium.googlesource.com/chromium/src/+/d65a57d6ca..28dd35b270/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: I9cff9d7df2e6f73bd30175ef19076c3481ec9477 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226600 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34516} --- DEPS | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/DEPS b/DEPS index 9ca89872f1..451cc41048 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': 'd65a57d6cafcca09f72823b4ac6cff49f74b9d95', + 'chromium_revision': '28dd35b270280f03cf3945653a8fd0f5ddbce88c', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,9 +20,9 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@e475053b99ff6cd3b7c19d4cbade4b629734ec60', + 'https://chromium.googlesource.com/chromium/src/base@c147c2b700ab8321d72ec115b1dfc9909909c179', 'src/build': - 'https://chromium.googlesource.com/chromium/src/build@33763d1a462119b06cd66cd833ca2286cc692603', + 'https://chromium.googlesource.com/chromium/src/build@7b9d584a16a7ab65e7bce6b9168e655f59c6a05e', 'src/buildtools': 'https://chromium.googlesource.com/chromium/src/buildtools@37dc929ecb351687006a61744b116cda601753d7', # Gradle 6.6.1. Used for testing Android Studio project generation for WebRTC. @@ -31,19 +31,19 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@f157952d746f4e8fdef387b8d0d2cbe3140aa89d', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@f7979bc111b59d1d1912f00dcf3d1f672d28ed58', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@c4fd353bed5807850d77098a9c76c758ecd66078', + 'https://chromium.googlesource.com/chromium/src/testing@1119ed7eb2f4143c2f2c14a4976f309ca62641db', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@a5a334ae22d9bf4441119a1351edf73e9e9b1c34', + 'https://chromium.googlesource.com/chromium/src/third_party@4a534c5726d18908566c155424e699f3a5d6796f', 'src/buildtools/linux64': { 'packages': [ { 'package': 'gn/gn/linux-amd64', - 'version': 'git_revision:61a0153b5e60f11100a04e51393cae15268d1ee3', + 'version': 'git_revision:d565aa3e72dd9e81da9595ee8c9d7b24cb45c48b', } ], 'dep_type': 'cipd', @@ -53,7 +53,7 @@ deps = { 'packages': [ { 'package': 'gn/gn/mac-${{arch}}', - 'version': 'git_revision:61a0153b5e60f11100a04e51393cae15268d1ee3', + 'version': 'git_revision:d565aa3e72dd9e81da9595ee8c9d7b24cb45c48b', } ], 'dep_type': 'cipd', @@ -63,7 +63,7 @@ deps = { 'packages': [ { 'package': 'gn/gn/windows-amd64', - 'version': 'git_revision:61a0153b5e60f11100a04e51393cae15268d1ee3', + 'version': 'git_revision:d565aa3e72dd9e81da9595ee8c9d7b24cb45c48b', } ], 'dep_type': 'cipd', @@ -214,7 +214,7 @@ deps = { 'condition': 'checkout_android', }, 'src/third_party/perfetto': - 'https://android.googlesource.com/platform/external/perfetto.git@56537d0732d7cda6c26453cc60eee9e63a7f106a', + 'https://android.googlesource.com/platform/external/perfetto.git@99063db35d93f47568a608d87e3f3912db59d3dd', 'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@eebc5cd487a89c51ba148f6d6ac45779970f72d7', 'src/third_party/libyuv': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@ed069b3b3f0c88e9135e0ef4cffb8037be5d0ff0', + 'https://chromium.googlesource.com/chromium/src/tools@50359373bc28a927bab5fea3dbeaaaa3695d7973', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': '3LEkAxvMyv3fgl0tjQXjlDeT_bwP9wCnOly8fNQlZQkC', + 'version': 'ak5sLJWTzTXot5KoqTvJsoSbbL-L5TYYMVsXEzVZDVsC', }, ], 'condition': 'checkout_android', From ad32a2c047c960f64c2c4dccfec77b5f8dd51609 Mon Sep 17 00:00:00 2001 From: webrtc-version-updater Date: Tue, 20 Jul 2021 21:03:23 -0700 Subject: [PATCH 0054/1565] Update WebRTC code version (2021-07-21T04:03:21). TBR=webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com,mbonadei@webrtc.org Bug: None Change-Id: I4d4ff1228232440554304606db2089e53e85b3be Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226642 Reviewed-by: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Commit-Queue: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Cr-Commit-Position: refs/heads/master@{#34517} --- call/version.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/call/version.cc b/call/version.cc index d1d638835e..084e1e54a4 100644 --- a/call/version.cc +++ b/call/version.cc @@ -13,7 +13,7 @@ namespace webrtc { // The timestamp is always in UTC. -const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-20T04:04:55"; +const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-21T04:03:21"; void LoadWebRTCVersionInRegister() { // Using volatile to instruct the compiler to not optimize `p` away even From 145f289552e1d08b1a597af0c228758a5ce2ed77 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Wed, 21 Jul 2021 07:53:44 +0000 Subject: [PATCH 0055/1565] Revert "Add WebRTC specific dcheck_always_on." This reverts commit 9f2a20f4342a3e86e1f9fdfe6f3d76fb539d41c2. Reason for revert: see explanation on https://bugs.chromium.org/p/webrtc/issues/detail?id=12988#c4. Original change's description: > Add WebRTC specific dcheck_always_on. > > Inspired by V8 CL: crrev.com/c/3038528. > > This makes the WebRTC's dcheck control independent of Chromium's and > prepares switching Chromium's default behavior without affecting > WebRTC developers or builders. > > Preparation for: https://crrev.com/c/2893204 > > Bug: chromium:1225701, webrtc:12988 > Change-Id: Ia0d21f9fb8e9d7704fd1beca16504c301a263b3b > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226465 > Commit-Queue: Mirko Bonadei > Reviewed-by: Markus Handell > Reviewed-by: Dirk Pranke > Cr-Commit-Position: refs/heads/master@{#34512} TBR=mbonadei@webrtc.org,dpranke@google.com,orphis@webrtc.org,handellm@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com Change-Id: I408ca6222e0d16e3d521708dfe5322236cf280d4 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: chromium:1225701, webrtc:12988 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226562 Reviewed-by: Mirko Bonadei Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34518} --- BUILD.gn | 4 ---- rtc_base/checks.h | 2 +- rtc_base/thread.cc | 6 +++--- rtc_base/thread.h | 8 +++----- rtc_base/thread_unittest.cc | 4 ++-- tools_webrtc/coverage/generate_ios_coverage_command.py | 4 ++-- tools_webrtc/mb/docs/user_guide.md | 10 +++++----- tools_webrtc/mb/mb_config.pyl | 8 ++++---- webrtc.gni | 6 ------ 9 files changed, 20 insertions(+), 32 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index e82f0fc80c..bc51df7c07 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -252,10 +252,6 @@ config("common_config") { cflags_objc = [] defines = [] - if (rtc_dcheck_always_on) { - defines += [ "RTC_DCHECK_ALWAYS_ON" ] - } - if (rtc_enable_protobuf) { defines += [ "WEBRTC_ENABLE_PROTOBUF=1" ] } else { diff --git a/rtc_base/checks.h b/rtc_base/checks.h index e7584fb11c..21fca7e40f 100644 --- a/rtc_base/checks.h +++ b/rtc_base/checks.h @@ -14,7 +14,7 @@ // If you for some reson need to know if DCHECKs are on, test the value of // RTC_DCHECK_IS_ON. (Test its value, not if it's defined; it'll always be // defined, to either a true or a false value.) -#if !defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON) +#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) #define RTC_DCHECK_IS_ON 1 #else #define RTC_DCHECK_IS_ON 0 diff --git a/rtc_base/thread.cc b/rtc_base/thread.cc index b54cdedf50..8ca9ce76a8 100644 --- a/rtc_base/thread.cc +++ b/rtc_base/thread.cc @@ -1044,7 +1044,7 @@ void Thread::QueuedTaskHandler::OnMessage(Message* msg) { } void Thread::AllowInvokesToThread(Thread* thread) { -#if (!defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON)) +#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) if (!IsCurrent()) { PostTask(webrtc::ToQueuedTask( [thread, this]() { AllowInvokesToThread(thread); })); @@ -1057,7 +1057,7 @@ void Thread::AllowInvokesToThread(Thread* thread) { } void Thread::DisallowAllInvokes() { -#if (!defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON)) +#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) if (!IsCurrent()) { PostTask(webrtc::ToQueuedTask([this]() { DisallowAllInvokes(); })); return; @@ -1082,7 +1082,7 @@ uint32_t Thread::GetCouldBeBlockingCallCount() const { // Returns true if no policies added or if there is at least one policy // that permits invocation to |target| thread. bool Thread::IsInvokeToThreadAllowed(rtc::Thread* target) { -#if (!defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON)) +#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) RTC_DCHECK_RUN_ON(this); if (!invoke_policy_enabled_) { return true; diff --git a/rtc_base/thread.h b/rtc_base/thread.h index cb5a0e9cd0..6e68f1a679 100644 --- a/rtc_base/thread.h +++ b/rtc_base/thread.h @@ -400,17 +400,15 @@ class RTC_LOCKABLE RTC_EXPORT Thread : public webrtc::TaskQueueBase { // Allows invoke to specified |thread|. Thread never will be dereferenced and // will be used only for reference-based comparison, so instance can be safely - // deleted. If NDEBUG is defined and RTC_DCHECK_ALWAYS_ON is undefined do - // nothing. + // deleted. If NDEBUG is defined and DCHECK_ALWAYS_ON is undefined do nothing. void AllowInvokesToThread(Thread* thread); - // If NDEBUG is defined and RTC_DCHECK_ALWAYS_ON is undefined do nothing. + // If NDEBUG is defined and DCHECK_ALWAYS_ON is undefined do nothing. void DisallowAllInvokes(); // Returns true if |target| was allowed by AllowInvokesToThread() or if no // calls were made to AllowInvokesToThread and DisallowAllInvokes. Otherwise // returns false. - // If NDEBUG is defined and RTC_DCHECK_ALWAYS_ON is undefined always returns - // true. + // If NDEBUG is defined and DCHECK_ALWAYS_ON is undefined always returns true. bool IsInvokeToThreadAllowed(rtc::Thread* target); // Posts a task to invoke the functor on |this| thread asynchronously, i.e. diff --git a/rtc_base/thread_unittest.cc b/rtc_base/thread_unittest.cc index e603930564..789bdd943e 100644 --- a/rtc_base/thread_unittest.cc +++ b/rtc_base/thread_unittest.cc @@ -366,7 +366,7 @@ TEST(ThreadTest, Wrap) { ThreadManager::Instance()->SetCurrentThread(current_thread); } -#if (!defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON)) +#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) TEST(ThreadTest, InvokeToThreadAllowedReturnsTrueWithoutPolicies) { // Create and start the thread. auto thread1 = Thread::CreateWithSocketServer(); @@ -410,7 +410,7 @@ TEST(ThreadTest, InvokesDisallowedWhenDisallowAllInvokes) { Thread* th_main = Thread::Current(); th_main->ProcessMessages(100); } -#endif // (!defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON)) +#endif // (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) TEST(ThreadTest, InvokesAllowedByDefault) { // Create and start the thread. diff --git a/tools_webrtc/coverage/generate_ios_coverage_command.py b/tools_webrtc/coverage/generate_ios_coverage_command.py index ff17c58863..e01a75c049 100644 --- a/tools_webrtc/coverage/generate_ios_coverage_command.py +++ b/tools_webrtc/coverage/generate_ios_coverage_command.py @@ -89,7 +89,7 @@ def GetGNArgs(is_simulator): target_cpu = 'x64' if is_simulator else 'arm64' return ([] + ['target_os="ios"'] + ['target_cpu="%s"' % target_cpu] + ['use_clang_coverage=true'] + ['is_component_build=false'] + - ['rtc_dcheck_always_on=true']) + ['dcheck_always_on=true']) def GenerateIOSSimulatorCommand(): @@ -103,7 +103,7 @@ def GenerateIOSSimulatorCommand(): [FormatIossimTest(t, is_xctest=True) for t in XC_TESTS] + [FormatIossimTest(t, is_xctest=False) for t in TESTS]) - print 'To get code coverage using iOS sim just run following commands:' + print 'To get code coverage using iOS simulator just run following commands:' print '' print ' '.join(gn_cmd) print '' diff --git a/tools_webrtc/mb/docs/user_guide.md b/tools_webrtc/mb/docs/user_guide.md index a8857d2087..8c66cd328c 100644 --- a/tools_webrtc/mb/docs/user_guide.md +++ b/tools_webrtc/mb/docs/user_guide.md @@ -248,8 +248,8 @@ For example, if you had: } 'mixins': { 'bot': { - 'gyp_defines': 'use_goma=1 rtc_dcheck_always_on=0', - 'gn_args': 'use_goma=true rtc_dcheck_always_on=false', + 'gyp_defines': 'use_goma=1 dcheck_always_on=0', + 'gn_args': 'use_goma=true dcheck_always_on=false', }, 'debug': { 'gn_args': 'is_debug=true', @@ -267,8 +267,8 @@ For example, if you had: 'gyp_defines': 'component=shared_library', }, 'trybot': { - 'gyp_defines': 'rtc_dcheck_always_on=1', - 'gn_args': 'rtc_dcheck_always_on=true', + 'gyp_defines': 'dcheck_always_on=1', + 'gn_args': 'dcheck_always_on=true', } } } @@ -276,7 +276,7 @@ For example, if you had: and you ran `mb gen -c linux_release_trybot //out/Release`, it would translate into a call to `gyp_chromium -G Release` with `GYP_DEFINES` set to -`"use_goma=true rtc_dcheck_always_on=false rtc_dcheck_always_on=true"`. +`"use_goma=true dcheck_always_on=false dcheck_always_on=true"`. (From that you can see that mb is intentionally dumb and does not attempt to de-dup the flags, it lets gyp do that). diff --git a/tools_webrtc/mb/mb_config.pyl b/tools_webrtc/mb/mb_config.pyl index 74678f875e..253a57acc5 100644 --- a/tools_webrtc/mb/mb_config.pyl +++ b/tools_webrtc/mb/mb_config.pyl @@ -459,8 +459,8 @@ 'gn_args': 'is_clang=true', }, - 'rtc_dcheck_always_on': { - 'gn_args': 'rtc_dcheck_always_on=true', + 'dcheck_always_on': { + 'gn_args': 'dcheck_always_on=true', }, 'debug': { @@ -548,11 +548,11 @@ }, 'release_bot': { - 'mixins': ['pure_release_bot', 'rtc_dcheck_always_on'], + 'mixins': ['pure_release_bot', 'dcheck_always_on'], }, 'release_bot_no_goma': { - 'mixins': ['release', 'no_goma', 'rtc_dcheck_always_on'], + 'mixins': ['release', 'no_goma', 'dcheck_always_on'], }, 'tsan': { diff --git a/webrtc.gni b/webrtc.gni index c1fd479832..a338d723ed 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -6,7 +6,6 @@ # in the file PATENTS. All contributing project authors may # be found in the AUTHORS file in the root of the source tree. import("//build/config/arm.gni") -import("//build/config/dcheck_always_on.gni") import("//build/config/features.gni") import("//build/config/mips.gni") import("//build/config/sanitizers/sanitizers.gni") @@ -37,11 +36,6 @@ if (is_mac) { } declare_args() { - # Separate control for dchecks in V8. Defaults to Chromium's behavior if - # built with Chromium. - # When set to true, it will enable RTC_DCHECK() also in Release builds. - rtc_dcheck_always_on = build_with_chromium && dcheck_always_on - # Setting this to true will make RTC_EXPORT (see rtc_base/system/rtc_export.h) # expand to code that will manage symbols visibility. rtc_enable_symbol_export = false From 8c185fcabeb74b454eddc16fc90fa413bffcd70e Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Wed, 21 Jul 2021 13:12:38 +0200 Subject: [PATCH 0056/1565] Reland "Add WebRTC specific dcheck_always_on." This is a reland of 9f2a20f4342a3e86e1f9fdfe6f3d76fb539d41c2 See https://webrtc-review.googlesource.com/c/src/+/226563/1..2 for the fix. RTC_DCHECK_ALWAYS_ON needs to be in public_configs in order to be propagated together with header #includes and avoid ODR violations. Original change's description: > Add WebRTC specific dcheck_always_on. > > Inspired by V8 CL: crrev.com/c/3038528. > > This makes the WebRTC's dcheck control independent of Chromium's and > prepares switching Chromium's default behavior without affecting > WebRTC developers or builders. > > Preparation for: https://crrev.com/c/2893204 > > Bug: chromium:1225701, webrtc:12988 > Change-Id: Ia0d21f9fb8e9d7704fd1beca16504c301a263b3b > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226465 > Commit-Queue: Mirko Bonadei > Reviewed-by: Markus Handell > Reviewed-by: Dirk Pranke > Cr-Commit-Position: refs/heads/master@{#34512} Bug: chromium:1225701, webrtc:12988 Change-Id: I1f78587487ee7b1a4a07b8c91b737a9e797b2323 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226563 Reviewed-by: Florent Castelli Reviewed-by: Markus Handell Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34519} --- BUILD.gn | 4 ++++ rtc_base/checks.h | 2 +- rtc_base/thread.cc | 6 +++--- rtc_base/thread.h | 8 +++++--- rtc_base/thread_unittest.cc | 4 ++-- tools_webrtc/coverage/generate_ios_coverage_command.py | 4 ++-- tools_webrtc/mb/docs/user_guide.md | 10 +++++----- tools_webrtc/mb/mb_config.pyl | 8 ++++---- webrtc.gni | 6 ++++++ 9 files changed, 32 insertions(+), 20 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index bc51df7c07..f2713f62d2 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -122,6 +122,10 @@ config("common_inherited_config") { defines = [ "WEBRTC_ENABLE_SYMBOL_EXPORT" ] } + if (rtc_dcheck_always_on) { + defines += [ "RTC_DCHECK_ALWAYS_ON" ] + } + if (build_with_mozilla) { defines += [ "WEBRTC_MOZILLA_BUILD" ] } diff --git a/rtc_base/checks.h b/rtc_base/checks.h index 21fca7e40f..e7584fb11c 100644 --- a/rtc_base/checks.h +++ b/rtc_base/checks.h @@ -14,7 +14,7 @@ // If you for some reson need to know if DCHECKs are on, test the value of // RTC_DCHECK_IS_ON. (Test its value, not if it's defined; it'll always be // defined, to either a true or a false value.) -#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON) +#if !defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON) #define RTC_DCHECK_IS_ON 1 #else #define RTC_DCHECK_IS_ON 0 diff --git a/rtc_base/thread.cc b/rtc_base/thread.cc index 8ca9ce76a8..b54cdedf50 100644 --- a/rtc_base/thread.cc +++ b/rtc_base/thread.cc @@ -1044,7 +1044,7 @@ void Thread::QueuedTaskHandler::OnMessage(Message* msg) { } void Thread::AllowInvokesToThread(Thread* thread) { -#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) +#if (!defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON)) if (!IsCurrent()) { PostTask(webrtc::ToQueuedTask( [thread, this]() { AllowInvokesToThread(thread); })); @@ -1057,7 +1057,7 @@ void Thread::AllowInvokesToThread(Thread* thread) { } void Thread::DisallowAllInvokes() { -#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) +#if (!defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON)) if (!IsCurrent()) { PostTask(webrtc::ToQueuedTask([this]() { DisallowAllInvokes(); })); return; @@ -1082,7 +1082,7 @@ uint32_t Thread::GetCouldBeBlockingCallCount() const { // Returns true if no policies added or if there is at least one policy // that permits invocation to |target| thread. bool Thread::IsInvokeToThreadAllowed(rtc::Thread* target) { -#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) +#if (!defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON)) RTC_DCHECK_RUN_ON(this); if (!invoke_policy_enabled_) { return true; diff --git a/rtc_base/thread.h b/rtc_base/thread.h index 6e68f1a679..cb5a0e9cd0 100644 --- a/rtc_base/thread.h +++ b/rtc_base/thread.h @@ -400,15 +400,17 @@ class RTC_LOCKABLE RTC_EXPORT Thread : public webrtc::TaskQueueBase { // Allows invoke to specified |thread|. Thread never will be dereferenced and // will be used only for reference-based comparison, so instance can be safely - // deleted. If NDEBUG is defined and DCHECK_ALWAYS_ON is undefined do nothing. + // deleted. If NDEBUG is defined and RTC_DCHECK_ALWAYS_ON is undefined do + // nothing. void AllowInvokesToThread(Thread* thread); - // If NDEBUG is defined and DCHECK_ALWAYS_ON is undefined do nothing. + // If NDEBUG is defined and RTC_DCHECK_ALWAYS_ON is undefined do nothing. void DisallowAllInvokes(); // Returns true if |target| was allowed by AllowInvokesToThread() or if no // calls were made to AllowInvokesToThread and DisallowAllInvokes. Otherwise // returns false. - // If NDEBUG is defined and DCHECK_ALWAYS_ON is undefined always returns true. + // If NDEBUG is defined and RTC_DCHECK_ALWAYS_ON is undefined always returns + // true. bool IsInvokeToThreadAllowed(rtc::Thread* target); // Posts a task to invoke the functor on |this| thread asynchronously, i.e. diff --git a/rtc_base/thread_unittest.cc b/rtc_base/thread_unittest.cc index 789bdd943e..e603930564 100644 --- a/rtc_base/thread_unittest.cc +++ b/rtc_base/thread_unittest.cc @@ -366,7 +366,7 @@ TEST(ThreadTest, Wrap) { ThreadManager::Instance()->SetCurrentThread(current_thread); } -#if (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) +#if (!defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON)) TEST(ThreadTest, InvokeToThreadAllowedReturnsTrueWithoutPolicies) { // Create and start the thread. auto thread1 = Thread::CreateWithSocketServer(); @@ -410,7 +410,7 @@ TEST(ThreadTest, InvokesDisallowedWhenDisallowAllInvokes) { Thread* th_main = Thread::Current(); th_main->ProcessMessages(100); } -#endif // (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)) +#endif // (!defined(NDEBUG) || defined(RTC_DCHECK_ALWAYS_ON)) TEST(ThreadTest, InvokesAllowedByDefault) { // Create and start the thread. diff --git a/tools_webrtc/coverage/generate_ios_coverage_command.py b/tools_webrtc/coverage/generate_ios_coverage_command.py index e01a75c049..ff17c58863 100644 --- a/tools_webrtc/coverage/generate_ios_coverage_command.py +++ b/tools_webrtc/coverage/generate_ios_coverage_command.py @@ -89,7 +89,7 @@ def GetGNArgs(is_simulator): target_cpu = 'x64' if is_simulator else 'arm64' return ([] + ['target_os="ios"'] + ['target_cpu="%s"' % target_cpu] + ['use_clang_coverage=true'] + ['is_component_build=false'] + - ['dcheck_always_on=true']) + ['rtc_dcheck_always_on=true']) def GenerateIOSSimulatorCommand(): @@ -103,7 +103,7 @@ def GenerateIOSSimulatorCommand(): [FormatIossimTest(t, is_xctest=True) for t in XC_TESTS] + [FormatIossimTest(t, is_xctest=False) for t in TESTS]) - print 'To get code coverage using iOS simulator just run following commands:' + print 'To get code coverage using iOS sim just run following commands:' print '' print ' '.join(gn_cmd) print '' diff --git a/tools_webrtc/mb/docs/user_guide.md b/tools_webrtc/mb/docs/user_guide.md index 8c66cd328c..a8857d2087 100644 --- a/tools_webrtc/mb/docs/user_guide.md +++ b/tools_webrtc/mb/docs/user_guide.md @@ -248,8 +248,8 @@ For example, if you had: } 'mixins': { 'bot': { - 'gyp_defines': 'use_goma=1 dcheck_always_on=0', - 'gn_args': 'use_goma=true dcheck_always_on=false', + 'gyp_defines': 'use_goma=1 rtc_dcheck_always_on=0', + 'gn_args': 'use_goma=true rtc_dcheck_always_on=false', }, 'debug': { 'gn_args': 'is_debug=true', @@ -267,8 +267,8 @@ For example, if you had: 'gyp_defines': 'component=shared_library', }, 'trybot': { - 'gyp_defines': 'dcheck_always_on=1', - 'gn_args': 'dcheck_always_on=true', + 'gyp_defines': 'rtc_dcheck_always_on=1', + 'gn_args': 'rtc_dcheck_always_on=true', } } } @@ -276,7 +276,7 @@ For example, if you had: and you ran `mb gen -c linux_release_trybot //out/Release`, it would translate into a call to `gyp_chromium -G Release` with `GYP_DEFINES` set to -`"use_goma=true dcheck_always_on=false dcheck_always_on=true"`. +`"use_goma=true rtc_dcheck_always_on=false rtc_dcheck_always_on=true"`. (From that you can see that mb is intentionally dumb and does not attempt to de-dup the flags, it lets gyp do that). diff --git a/tools_webrtc/mb/mb_config.pyl b/tools_webrtc/mb/mb_config.pyl index 253a57acc5..74678f875e 100644 --- a/tools_webrtc/mb/mb_config.pyl +++ b/tools_webrtc/mb/mb_config.pyl @@ -459,8 +459,8 @@ 'gn_args': 'is_clang=true', }, - 'dcheck_always_on': { - 'gn_args': 'dcheck_always_on=true', + 'rtc_dcheck_always_on': { + 'gn_args': 'rtc_dcheck_always_on=true', }, 'debug': { @@ -548,11 +548,11 @@ }, 'release_bot': { - 'mixins': ['pure_release_bot', 'dcheck_always_on'], + 'mixins': ['pure_release_bot', 'rtc_dcheck_always_on'], }, 'release_bot_no_goma': { - 'mixins': ['release', 'no_goma', 'dcheck_always_on'], + 'mixins': ['release', 'no_goma', 'rtc_dcheck_always_on'], }, 'tsan': { diff --git a/webrtc.gni b/webrtc.gni index a338d723ed..99d4488e3c 100644 --- a/webrtc.gni +++ b/webrtc.gni @@ -6,6 +6,7 @@ # in the file PATENTS. All contributing project authors may # be found in the AUTHORS file in the root of the source tree. import("//build/config/arm.gni") +import("//build/config/dcheck_always_on.gni") import("//build/config/features.gni") import("//build/config/mips.gni") import("//build/config/sanitizers/sanitizers.gni") @@ -36,6 +37,11 @@ if (is_mac) { } declare_args() { + # Separate control for dchecks in WebRTC. Defaults to Chromium's behavior if + # built with Chromium. + # When set to true, it will enable RTC_DCHECK() also in Release builds. + rtc_dcheck_always_on = build_with_chromium && dcheck_always_on + # Setting this to true will make RTC_EXPORT (see rtc_base/system/rtc_export.h) # expand to code that will manage symbols visibility. rtc_enable_symbol_export = false From 6882a3f7d04865975f4c5eeee76fe324f3141521 Mon Sep 17 00:00:00 2001 From: Danil Chapovalov Date: Tue, 20 Jul 2021 15:02:55 +0000 Subject: [PATCH 0057/1565] Discard over large DataRates in VideoLayersAllocation rtp header extension Bug: b/193170077 Change-Id: I427718daa70910dbaf7f2e1f3d88d3dce4f27c7a Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226561 Reviewed-by: Emil Lundmark Commit-Queue: Danil Chapovalov Cr-Commit-Position: refs/heads/master@{#34520} --- .../source/rtp_video_layers_allocation_extension.cc | 7 +++++-- .../rtp_video_layers_allocation_extension_unittest.cc | 7 +++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/rtp_rtcp/source/rtp_video_layers_allocation_extension.cc b/modules/rtp_rtcp/source/rtp_video_layers_allocation_extension.cc index 93fb235dcd..234ac31b8b 100644 --- a/modules/rtp_rtcp/source/rtp_video_layers_allocation_extension.cc +++ b/modules/rtp_rtcp/source/rtp_video_layers_allocation_extension.cc @@ -354,10 +354,13 @@ bool RtpVideoLayersAllocationExtension::Parse( // Target bitrates. for (auto& layer : allocation->active_spatial_layers) { for (DataRate& rate : layer.target_bitrate_per_temporal_layer) { - rate = DataRate::KilobitsPerSec(ReadLeb128(read_at, end)); - if (read_at == nullptr) { + uint64_t bitrate_kbps = ReadLeb128(read_at, end); + // bitrate_kbps might represent larger values than DataRate type, + // discard unreasonably large values. + if (read_at == nullptr || bitrate_kbps > 1'000'000) { return false; } + rate = DataRate::KilobitsPerSec(bitrate_kbps); } } diff --git a/modules/rtp_rtcp/source/rtp_video_layers_allocation_extension_unittest.cc b/modules/rtp_rtcp/source/rtp_video_layers_allocation_extension_unittest.cc index 92e5673441..17b4c4cfa6 100644 --- a/modules/rtp_rtcp/source/rtp_video_layers_allocation_extension_unittest.cc +++ b/modules/rtp_rtcp/source/rtp_video_layers_allocation_extension_unittest.cc @@ -249,5 +249,12 @@ TEST(RtpVideoLayersAllocationExtension, RtpVideoLayersAllocationExtension::Write(buffer, written_allocation)); } +TEST(RtpVideoLayersAllocationExtension, DiscardsOverLargeDataRate) { + constexpr uint8_t buffer[] = {0x4b, 0xf6, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xcb, 0x78, 0xeb, 0x8d, 0xb5, 0x31}; + VideoLayersAllocation allocation; + EXPECT_FALSE(RtpVideoLayersAllocationExtension::Parse(buffer, &allocation)); +} + } // namespace } // namespace webrtc From 45b0781a4bd04d182a9ac8b121b911410db6f06d Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Wed, 21 Jul 2021 17:01:52 -0700 Subject: [PATCH 0058/1565] Roll chromium_revision 28dd35b270..9b243167aa (903575:904119) Change log: https://chromium.googlesource.com/chromium/src/+log/28dd35b270..9b243167aa Full diff: https://chromium.googlesource.com/chromium/src/+/28dd35b270..9b243167aa Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/c147c2b700..fa07be9c3c * src/build: https://chromium.googlesource.com/chromium/src/build/+log/7b9d584a16..66e6c2e275 * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/f7979bc111..c1da2dc834 * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/1119ed7eb2..0b41bd3fd2 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/4a534c5726..9965543f35 * src/third_party/androidx: ak5sLJWTzTXot5KoqTvJsoSbbL-L5TYYMVsXEzVZDVsC..K8c7JN0QlH9y-iVNRC74RIWTTwcUwtM9CIwQ8vPQyFkC * src/third_party/breakpad/breakpad: https://chromium.googlesource.com/breakpad/breakpad.git/+log/b95c4868b1..32096a2dc8 * src/third_party/catapult: https://chromium.googlesource.com/catapult.git/+log/5cb305306a..9ac1fdf373 * src/third_party/freetype/src: https://chromium.googlesource.com/chromium/src/third_party/freetype2.git/+log/86b9c9347f..801cd842e2 * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/99063db35d..f7ba153308 * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/50359373bc..a0a9a4bd0c * src/tools/luci-go: git_revision:6387586e5b3279aebdf22bdab7ae619dbc156b66..git_revision:9ee8b1d719c0d3c268e0e19282351ca78024af2d * src/tools/luci-go: git_revision:6387586e5b3279aebdf22bdab7ae619dbc156b66..git_revision:9ee8b1d719c0d3c268e0e19282351ca78024af2d * src/tools/luci-go: git_revision:6387586e5b3279aebdf22bdab7ae619dbc156b66..git_revision:9ee8b1d719c0d3c268e0e19282351ca78024af2d DEPS diff: https://chromium.googlesource.com/chromium/src/+/28dd35b270..9b243167aa/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: I9c4ea50590b4f8a43f72e32666ea734cdcb3d31b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226682 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34521} --- DEPS | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/DEPS b/DEPS index 451cc41048..1e530dfddd 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': '28dd35b270280f03cf3945653a8fd0f5ddbce88c', + 'chromium_revision': '9b243167aa7326b6bbf97b1334d7c0fd5f155f01', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,9 +20,9 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@c147c2b700ab8321d72ec115b1dfc9909909c179', + 'https://chromium.googlesource.com/chromium/src/base@fa07be9c3cd66cbde4396625431f261311f15578', 'src/build': - 'https://chromium.googlesource.com/chromium/src/build@7b9d584a16a7ab65e7bce6b9168e655f59c6a05e', + 'https://chromium.googlesource.com/chromium/src/build@66e6c2e275b89c951a6cdbce8b5ab54e20585703', 'src/buildtools': 'https://chromium.googlesource.com/chromium/src/buildtools@37dc929ecb351687006a61744b116cda601753d7', # Gradle 6.6.1. Used for testing Android Studio project generation for WebRTC. @@ -31,13 +31,13 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@f7979bc111b59d1d1912f00dcf3d1f672d28ed58', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@c1da2dc8344d379dc6d9a6dfe55f5b9f31560095', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@1119ed7eb2f4143c2f2c14a4976f309ca62641db', + 'https://chromium.googlesource.com/chromium/src/testing@0b41bd3fd2691a54e2c7bdef7c3650dfa8263ea7', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@4a534c5726d18908566c155424e699f3a5d6796f', + 'https://chromium.googlesource.com/chromium/src/third_party@9965543f354e3e2788f3da29698e20278c8a8a14', 'src/buildtools/linux64': { 'packages': [ @@ -126,9 +126,9 @@ deps = { 'src/third_party/boringssl/src': 'https://boringssl.googlesource.com/boringssl.git@a10017c548b0805eb98e7847c37370dbd37cd8d6', 'src/third_party/breakpad/breakpad': - 'https://chromium.googlesource.com/breakpad/breakpad.git@b95c4868b10f69e642666742233aede1eb653012', + 'https://chromium.googlesource.com/breakpad/breakpad.git@32096a2dc8f8a7d5aac4097e34912bb7e06a5277', 'src/third_party/catapult': - 'https://chromium.googlesource.com/catapult.git@5cb305306ad74c3b68e432ee221a1943dd79b64d', + 'https://chromium.googlesource.com/catapult.git@9ac1fdf373609aac2e866e298067d78e053b6527', 'src/third_party/ced/src': { 'url': 'https://chromium.googlesource.com/external/github.com/google/compact_enc_det.git@ba412eaaacd3186085babcd901679a48863c7dd5', }, @@ -150,7 +150,7 @@ deps = { 'condition': 'checkout_linux', }, 'src/third_party/freetype/src': - 'https://chromium.googlesource.com/chromium/src/third_party/freetype2.git@86b9c9347f99174f4fea3e9deca5800e57a987f2', + 'https://chromium.googlesource.com/chromium/src/third_party/freetype2.git@801cd842e27c85cb1d5000f6397f382ffe295daa', 'src/third_party/harfbuzz-ng/src': 'https://chromium.googlesource.com/external/github.com/harfbuzz/harfbuzz.git@cc9bb294919e846ef8a0731b5e9f304f95ef3bb8', 'src/third_party/google_benchmark/src': { @@ -214,7 +214,7 @@ deps = { 'condition': 'checkout_android', }, 'src/third_party/perfetto': - 'https://android.googlesource.com/platform/external/perfetto.git@99063db35d93f47568a608d87e3f3912db59d3dd', + 'https://android.googlesource.com/platform/external/perfetto.git@f7ba153308a223418921dff22a61527a00aea264', 'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@eebc5cd487a89c51ba148f6d6ac45779970f72d7', 'src/third_party/libyuv': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@50359373bc28a927bab5fea3dbeaaaa3695d7973', + 'https://chromium.googlesource.com/chromium/src/tools@a0a9a4bd0ce6dd68b1ef9c9dc8a64564c307abb2', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'ak5sLJWTzTXot5KoqTvJsoSbbL-L5TYYMVsXEzVZDVsC', + 'version': 'K8c7JN0QlH9y-iVNRC74RIWTTwcUwtM9CIwQ8vPQyFkC', }, ], 'condition': 'checkout_android', @@ -477,15 +477,15 @@ deps = { 'packages': [ { 'package': 'infra/tools/luci/isolate/${{platform}}', - 'version': 'git_revision:6387586e5b3279aebdf22bdab7ae619dbc156b66', + 'version': 'git_revision:9ee8b1d719c0d3c268e0e19282351ca78024af2d', }, { 'package': 'infra/tools/luci/isolated/${{platform}}', - 'version': 'git_revision:6387586e5b3279aebdf22bdab7ae619dbc156b66', + 'version': 'git_revision:9ee8b1d719c0d3c268e0e19282351ca78024af2d', }, { 'package': 'infra/tools/luci/swarming/${{platform}}', - 'version': 'git_revision:6387586e5b3279aebdf22bdab7ae619dbc156b66', + 'version': 'git_revision:9ee8b1d719c0d3c268e0e19282351ca78024af2d', }, ], 'dep_type': 'cipd', From c51efc425dc5b3977633c4bd3866cf8d8d83dd06 Mon Sep 17 00:00:00 2001 From: webrtc-version-updater Date: Wed, 21 Jul 2021 21:03:25 -0700 Subject: [PATCH 0059/1565] Update WebRTC code version (2021-07-22T04:03:23). TBR=webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com,mbonadei@webrtc.org Bug: None Change-Id: Id0de096d61cd61b8083bd739ab134be536ad648a Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226721 Reviewed-by: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Commit-Queue: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Cr-Commit-Position: refs/heads/master@{#34522} --- call/version.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/call/version.cc b/call/version.cc index 084e1e54a4..ec37f5068d 100644 --- a/call/version.cc +++ b/call/version.cc @@ -13,7 +13,7 @@ namespace webrtc { // The timestamp is always in UTC. -const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-21T04:03:21"; +const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-22T04:03:23"; void LoadWebRTCVersionInRegister() { // Using volatile to instruct the compiler to not optimize `p` away even From 67468c5b926b39cf1962395bc990101ce3e2ea2f Mon Sep 17 00:00:00 2001 From: Qiu Jianlin Date: Tue, 20 Jul 2021 12:09:15 +0800 Subject: [PATCH 0060/1565] Ignore prefix NAL unit for slice parsing. For temporal scalability, prefix NALU contains layer information, but should not be parsed as a slice. Bug: webrtc:12991 Change-Id: Ic1e7d41f568310390a743d4ace016aa7d57a4864 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226501 Reviewed-by: Sergey Silkin Commit-Queue: Sergey Silkin Cr-Commit-Position: refs/heads/master@{#34523} --- common_video/h264/h264_bitstream_parser.cc | 1 + common_video/h264/h264_common.h | 1 + 2 files changed, 2 insertions(+) diff --git a/common_video/h264/h264_bitstream_parser.cc b/common_video/h264/h264_bitstream_parser.cc index 3b41599fa0..6eee02ed24 100644 --- a/common_video/h264/h264_bitstream_parser.cc +++ b/common_video/h264/h264_bitstream_parser.cc @@ -288,6 +288,7 @@ void H264BitstreamParser::ParseSlice(const uint8_t* slice, size_t length) { } case H264::NaluType::kAud: case H264::NaluType::kSei: + case H264::NaluType::kPrefix: break; // Ignore these nalus, as we don't care about their contents. default: Result res = ParseNonParameterSetNalu(slice, length, nalu_type); diff --git a/common_video/h264/h264_common.h b/common_video/h264/h264_common.h index 2beef16ac5..0b1843ee38 100644 --- a/common_video/h264/h264_common.h +++ b/common_video/h264/h264_common.h @@ -42,6 +42,7 @@ enum NaluType : uint8_t { kEndOfSequence = 10, kEndOfStream = 11, kFiller = 12, + kPrefix = 14, kStapA = 24, kFuA = 28 }; From 59e3ec2da0d8848335c3da7e12ea00ada26147f9 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Thu, 22 Jul 2021 01:02:42 -0700 Subject: [PATCH 0061/1565] Roll chromium_revision 9b243167aa..89e5d40511 (904119:904223) Change log: https://chromium.googlesource.com/chromium/src/+log/9b243167aa..89e5d40511 Full diff: https://chromium.googlesource.com/chromium/src/+/9b243167aa..89e5d40511 Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/fa07be9c3c..c3be4f97ad * src/build: https://chromium.googlesource.com/chromium/src/build/+log/66e6c2e275..488aac0b88 * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/0b41bd3fd2..8c3404999d * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/9965543f35..ed132557b6 * src/third_party/androidx: K8c7JN0QlH9y-iVNRC74RIWTTwcUwtM9CIwQ8vPQyFkC..R0benUT8A1oqvs7L0N-hfCvDpMzfzemd6fXXr4tBOrEC * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/f7ba153308..cb07e44638 * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/a0a9a4bd0c..5ddfcadec9 DEPS diff: https://chromium.googlesource.com/chromium/src/+/9b243167aa..89e5d40511/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: I46ff2b5aab4311d8b00d2fd8e1a2371d11ae6c47 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226683 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34524} --- DEPS | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/DEPS b/DEPS index 1e530dfddd..153312fb4c 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': '9b243167aa7326b6bbf97b1334d7c0fd5f155f01', + 'chromium_revision': '89e5d4051156295bbb37c307f29e5482bae670e6', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,9 +20,9 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@fa07be9c3cd66cbde4396625431f261311f15578', + 'https://chromium.googlesource.com/chromium/src/base@c3be4f97adc91439690e0534c2e11143afc5b114', 'src/build': - 'https://chromium.googlesource.com/chromium/src/build@66e6c2e275b89c951a6cdbce8b5ab54e20585703', + 'https://chromium.googlesource.com/chromium/src/build@488aac0b886533f5c5baf8214098a6afd1d46f00', 'src/buildtools': 'https://chromium.googlesource.com/chromium/src/buildtools@37dc929ecb351687006a61744b116cda601753d7', # Gradle 6.6.1. Used for testing Android Studio project generation for WebRTC. @@ -35,9 +35,9 @@ deps = { 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@0b41bd3fd2691a54e2c7bdef7c3650dfa8263ea7', + 'https://chromium.googlesource.com/chromium/src/testing@8c3404999d90f3192a776dab50d26401fd676492', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@9965543f354e3e2788f3da29698e20278c8a8a14', + 'https://chromium.googlesource.com/chromium/src/third_party@ed132557b60ca3f46d2fe05fab9317985c0a778e', 'src/buildtools/linux64': { 'packages': [ @@ -214,7 +214,7 @@ deps = { 'condition': 'checkout_android', }, 'src/third_party/perfetto': - 'https://android.googlesource.com/platform/external/perfetto.git@f7ba153308a223418921dff22a61527a00aea264', + 'https://android.googlesource.com/platform/external/perfetto.git@cb07e44638b99718b8c54bc19f8dbd84a3743dc6', 'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@eebc5cd487a89c51ba148f6d6ac45779970f72d7', 'src/third_party/libyuv': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@a0a9a4bd0ce6dd68b1ef9c9dc8a64564c307abb2', + 'https://chromium.googlesource.com/chromium/src/tools@5ddfcadec98e2c11158fde35550f019fadf2a437', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'K8c7JN0QlH9y-iVNRC74RIWTTwcUwtM9CIwQ8vPQyFkC', + 'version': 'R0benUT8A1oqvs7L0N-hfCvDpMzfzemd6fXXr4tBOrEC', }, ], 'condition': 'checkout_android', From 623146cfe1a06d7f7f62db612dfbf625638f916e Mon Sep 17 00:00:00 2001 From: Danil Chapovalov Date: Mon, 19 Jul 2021 15:43:18 +0000 Subject: [PATCH 0062/1565] Delete remaining usage of RtpHeaderParser test helper. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: None Change-Id: Ia4f8c5dc212f25b1a507e13955973ce4aa6a7ddc Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225550 Reviewed-by: Niels Moller Reviewed-by: Björn Terelius Commit-Queue: Danil Chapovalov Cr-Commit-Position: refs/heads/master@{#34525} --- call/BUILD.gn | 1 - call/call_perf_tests.cc | 1 - .../source/rtp_rtcp_impl2_unittest.cc | 1 - .../rtp_rtcp/source/rtp_rtcp_impl_unittest.cc | 1 - .../rtp_rtcp/source/rtp_sender_unittest.cc | 1 - test/BUILD.gn | 3 --- test/fuzzers/BUILD.gn | 5 ---- test/fuzzers/rtp_header_parser_fuzzer.cc | 26 ------------------- test/peer_scenario/tests/BUILD.gn | 1 - .../tests/unsignaled_stream_test.cc | 1 - test/rtp_header_parser.cc | 26 ------------------- test/rtp_header_parser.h | 25 ------------------ test/scenario/BUILD.gn | 1 - test/scenario/call_client.cc | 5 +--- 14 files changed, 1 insertion(+), 97 deletions(-) delete mode 100644 test/fuzzers/rtp_header_parser_fuzzer.cc delete mode 100644 test/rtp_header_parser.cc delete mode 100644 test/rtp_header_parser.h diff --git a/call/BUILD.gn b/call/BUILD.gn index 638eb0b910..04b5e50588 100644 --- a/call/BUILD.gn +++ b/call/BUILD.gn @@ -548,7 +548,6 @@ if (rtc_include_tests) { "../test:fileutils", "../test:null_transport", "../test:perf_test", - "../test:rtp_test_utils", "../test:test_common", "../test:test_support", "../test:video_test_common", diff --git a/call/call_perf_tests.cc b/call/call_perf_tests.cc index c163ab2fe7..701dda7e62 100644 --- a/call/call_perf_tests.cc +++ b/call/call_perf_tests.cc @@ -43,7 +43,6 @@ #include "test/frame_generator_capturer.h" #include "test/gtest.h" #include "test/null_transport.h" -#include "test/rtp_header_parser.h" #include "test/rtp_rtcp_observer.h" #include "test/testsupport/file_utils.h" #include "test/testsupport/perf_test.h" diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl2_unittest.cc b/modules/rtp_rtcp/source/rtp_rtcp_impl2_unittest.cc index c8ab15de78..123b68a10d 100644 --- a/modules/rtp_rtcp/source/rtp_rtcp_impl2_unittest.cc +++ b/modules/rtp_rtcp/source/rtp_rtcp_impl2_unittest.cc @@ -31,7 +31,6 @@ #include "test/gmock.h" #include "test/gtest.h" #include "test/rtcp_packet_parser.h" -#include "test/rtp_header_parser.h" #include "test/run_loop.h" #include "test/time_controller/simulated_time_controller.h" diff --git a/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc b/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc index ac05584e18..0902e90d51 100644 --- a/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc +++ b/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc @@ -24,7 +24,6 @@ #include "test/gmock.h" #include "test/gtest.h" #include "test/rtcp_packet_parser.h" -#include "test/rtp_header_parser.h" using ::testing::ElementsAre; using ::testing::Eq; diff --git a/modules/rtp_rtcp/source/rtp_sender_unittest.cc b/modules/rtp_rtcp/source/rtp_sender_unittest.cc index e9be016143..7237bee648 100644 --- a/modules/rtp_rtcp/source/rtp_sender_unittest.cc +++ b/modules/rtp_rtcp/source/rtp_sender_unittest.cc @@ -40,7 +40,6 @@ #include "test/gmock.h" #include "test/gtest.h" #include "test/mock_transport.h" -#include "test/rtp_header_parser.h" #include "test/time_controller/simulated_time_controller.h" namespace webrtc { diff --git a/test/BUILD.gn b/test/BUILD.gn index 82d0b9ea28..9172eb3227 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -196,8 +196,6 @@ rtc_library("rtp_test_utils") { "rtp_file_reader.h", "rtp_file_writer.cc", "rtp_file_writer.h", - "rtp_header_parser.cc", - "rtp_header_parser.h", ] deps = [ @@ -212,7 +210,6 @@ rtc_library("rtp_test_utils") { "../rtc_base/synchronization:mutex", "../rtc_base/system:arch", ] - absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] } rtc_library("field_trial") { diff --git a/test/fuzzers/BUILD.gn b/test/fuzzers/BUILD.gn index 201cb49192..1561e8b845 100644 --- a/test/fuzzers/BUILD.gn +++ b/test/fuzzers/BUILD.gn @@ -618,11 +618,6 @@ webrtc_fuzzer_test("dcsctp_socket_fuzzer") { ] } -webrtc_fuzzer_test("rtp_header_parser_fuzzer") { - sources = [ "rtp_header_parser_fuzzer.cc" ] - deps = [ "../:rtp_test_utils" ] -} - webrtc_fuzzer_test("ssl_certificate_fuzzer") { sources = [ "ssl_certificate_fuzzer.cc" ] deps = [ diff --git a/test/fuzzers/rtp_header_parser_fuzzer.cc b/test/fuzzers/rtp_header_parser_fuzzer.cc deleted file mode 100644 index 435c64bbb4..0000000000 --- a/test/fuzzers/rtp_header_parser_fuzzer.cc +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#include -#include - -#include -#include -#include - -#include "test/rtp_header_parser.h" - -namespace webrtc { - -void FuzzOneInput(const uint8_t* data, size_t size) { - RtpHeaderParser::GetSsrc(data, size); -} - -} // namespace webrtc diff --git a/test/peer_scenario/tests/BUILD.gn b/test/peer_scenario/tests/BUILD.gn index a8b9c2563e..042b636690 100644 --- a/test/peer_scenario/tests/BUILD.gn +++ b/test/peer_scenario/tests/BUILD.gn @@ -19,7 +19,6 @@ if (rtc_include_tests) { deps = [ "..:peer_scenario", "../../:field_trial", - "../../:rtp_test_utils", "../../:test_support", "../../../media:rtc_media_base", "../../../modules/rtp_rtcp:rtp_rtcp", diff --git a/test/peer_scenario/tests/unsignaled_stream_test.cc b/test/peer_scenario/tests/unsignaled_stream_test.cc index e0fe02edcf..3fd3c7d288 100644 --- a/test/peer_scenario/tests/unsignaled_stream_test.cc +++ b/test/peer_scenario/tests/unsignaled_stream_test.cc @@ -17,7 +17,6 @@ #include "test/gmock.h" #include "test/gtest.h" #include "test/peer_scenario/peer_scenario.h" -#include "test/rtp_header_parser.h" namespace webrtc { namespace test { diff --git a/test/rtp_header_parser.cc b/test/rtp_header_parser.cc deleted file mode 100644 index 48e493ddeb..0000000000 --- a/test/rtp_header_parser.cc +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#include "test/rtp_header_parser.h" - -#include "modules/rtp_rtcp/source/rtp_utility.h" - -namespace webrtc { - -absl::optional RtpHeaderParser::GetSsrc(const uint8_t* packet, - size_t length) { - RtpUtility::RtpHeaderParser rtp_parser(packet, length); - RTPHeader header; - if (rtp_parser.Parse(&header, nullptr)) { - return header.ssrc; - } - return absl::nullopt; -} - -} // namespace webrtc diff --git a/test/rtp_header_parser.h b/test/rtp_header_parser.h deleted file mode 100644 index f6ed74c043..0000000000 --- a/test/rtp_header_parser.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ -#ifndef TEST_RTP_HEADER_PARSER_H_ -#define TEST_RTP_HEADER_PARSER_H_ - -#include -#include - -#include "absl/types/optional.h" - -namespace webrtc { - -class RtpHeaderParser { - public: - static absl::optional GetSsrc(const uint8_t* packet, size_t length); -}; -} // namespace webrtc -#endif // TEST_RTP_HEADER_PARSER_H_ diff --git a/test/scenario/BUILD.gn b/test/scenario/BUILD.gn index a64f8317a0..561cd7b1ea 100644 --- a/test/scenario/BUILD.gn +++ b/test/scenario/BUILD.gn @@ -71,7 +71,6 @@ if (rtc_include_tests && !build_with_chromium) { ":column_printer", "../:fake_video_codecs", "../:fileutils", - "../:rtp_test_utils", "../:test_common", "../:test_support", "../:video_test_common", diff --git a/test/scenario/call_client.cc b/test/scenario/call_client.cc index be8d39f2a5..d45909c053 100644 --- a/test/scenario/call_client.cc +++ b/test/scenario/call_client.cc @@ -18,7 +18,6 @@ #include "api/transport/network_types.h" #include "modules/audio_mixer/audio_mixer_impl.h" #include "modules/rtp_rtcp/source/rtp_util.h" -#include "test/rtp_header_parser.h" namespace webrtc { namespace test { @@ -295,9 +294,7 @@ void CallClient::UpdateBitrateConstraints( void CallClient::OnPacketReceived(EmulatedIpPacket packet) { MediaType media_type = MediaType::ANY; if (IsRtpPacket(packet.data)) { - auto ssrc = RtpHeaderParser::GetSsrc(packet.cdata(), packet.data.size()); - RTC_CHECK(ssrc.has_value()); - media_type = ssrc_media_types_[*ssrc]; + media_type = ssrc_media_types_[ParseRtpSsrc(packet.data)]; } task_queue_.PostTask( [call = call_.get(), media_type, packet = std::move(packet)]() mutable { From 41e98bab1e587071383a3a521162fe473851b7a1 Mon Sep 17 00:00:00 2001 From: Artem Titov Date: Wed, 21 Jul 2021 14:33:13 +0200 Subject: [PATCH 0063/1565] Add a documentation on how to become WebRTC committer Bug: webrtc:12298 Change-Id: Ia9d760b1c2ecea9c8b056971fe64c099c9bb5058 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225023 Reviewed-by: Harald Alvestrand Reviewed-by: Tommi Reviewed-by: Mirko Bonadei Commit-Queue: Artem Titov Cr-Commit-Position: refs/heads/master@{#34526} --- docs/faq.md | 14 +++----- g3doc/become_a_committer.md | 64 +++++++++++++++++++++++++++++++++++++ g3doc/sitemap.md | 1 + 3 files changed, 70 insertions(+), 9 deletions(-) create mode 100644 g3doc/become_a_committer.md diff --git a/docs/faq.md b/docs/faq.md index 7511c8c95d..439e9b3e1b 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -142,18 +142,14 @@ Please see [Getting Started][getting-started-link] and Yes, each Contributor must sign and return the [Contributor License Agreement][cla-link] -### How can I become a WebRTC committer? +[cla-link]: https://developers.google.com/open-source/cla/individual?hl=en -After 10-20 non-trivial patches you can apply for commit rights. If you are -writing a lot of patches you can also apply for try job access before then. -To apply, open a bug on https://bugs.chromium.org/p/webrtc/ specifying the -e-mail you will use to commit code to WebRTC and list all the relevant CLs to -show your previous contributions (even in case you are only requiring try job -access since it is still required a certain number of contributions for that -as well). +### How can I become a WebRTC committer? -[cla-link]: https://developers.google.com/open-source/cla/individual?hl=en +The process of becoming a committer is documented in a +[separate page][become-a-committer]. +[become-a-committer]: https://webrtc.googlesource.com/src/+/refs/heads/main/g3doc/become_a_committer.md ### Do I have to be a programmer to use WebRTC? diff --git a/g3doc/become_a_committer.md b/g3doc/become_a_committer.md new file mode 100644 index 0000000000..8781b7aef8 --- /dev/null +++ b/g3doc/become_a_committer.md @@ -0,0 +1,64 @@ +# How to become WebRTC committer + + + + +## WebRTC committer duties + +WebRTC committers are responsible for keeping WebRTC codebase in a good shape +including, but not limited to the following aspects: + +* Code complexity and correctness +* C++ best practices +* Code formatting +* Test coverage +* Class/function level and conceptual documentation + +Whenever a committer sets `Code Review +1` label on the CL, they approve that +the CL fulfills WebRTC style guides, language mastery, testability and +documentation. Being a committer means being responsible for the WebRTC codebase +health and code quality. + +## Becoming a WebRTC committer + +To write code in WebRTC you don't need to be a committer (also see [FAQ][1]), +but to submit code to WebRTC you do. So if you don't plan to work on the WebRTC +codebase regularly, you can ask other committers through code review to submit +your patches, but if you are going to work in the WebRTC codebase, then it's +recommended to apply for WebRTC committer rights obtaining process. + +1. If you are going to write in C++ make yourself familiar with with C++ style + guides: + + * [Google style guide][5] + * [Chromium style guide][2] + * [WebRTC style guide][3] + +2. Create a ticket to obtain WebRTC committers rights in Monorail. + + TODO: add link to the template. + +3. Pick a mentor among WebRTC committers, who will review your CLs. For C++ + authors, the mentor will also look for C++ readability skills. It's + recommended to ask someone who is familiar with the code base which you will + be working on (you can check OWNERS files to find such person). Otherwise + you can reach out to committers mailing list \. + +4. Send CLs to the mentor for review and attach them to the created ticket. + +5. When the mentor decides that you are ready (for C++ authors their C++ + readability skills are good enough), they will send a proposal for granting + WebRTC committer rights to the reviewing committee mailing list to review. + If the proposal will be approved, then committer rights will be granted. + Committee members will have up to 5 business days to answer. In case of + rejection detailed feedback on what aspects should be improved will be + provided. + +6. Also as any contributor you must sign and return the + [Contributor License Agreement][4] + +[1]: https://webrtc.googlesource.com/src/+/refs/heads/main/docs/faq.md#to-be-a-contributor_do-i-need-to-sign-any-agreements +[2]: https://chromium.googlesource.com/chromium/src/+/refs/heads/main/styleguide/c++/c++.md +[3]: https://webrtc.googlesource.com/src/+/refs/heads/main/g3doc/style-guide.md +[4]: https://developers.google.com/open-source/cla/individual?hl=en +[5]: https://google.github.io/styleguide/cppguide.html diff --git a/g3doc/sitemap.md b/g3doc/sitemap.md index c893d6ce3a..4a705c4da0 100644 --- a/g3doc/sitemap.md +++ b/g3doc/sitemap.md @@ -3,6 +3,7 @@ * Code * [Style guide](/g3doc/style-guide.md) * [Documentation](/g3doc/how_to_write_documentation.md) + * [Become a committer](/g3doc/become_a_committer.md) * [Public C++ API](/api/g3doc/index.md) * [Threading](/api/g3doc/threading_design.md) * Implementation From 0e62f7aa98c2668fd19175bbbb1009e4a5c1e8e5 Mon Sep 17 00:00:00 2001 From: Markus Handell Date: Tue, 20 Jul 2021 13:32:02 +0200 Subject: [PATCH 0064/1565] NackModule2: coalesce repeating tasks. NackModule2 creates repeating tasks, but as there are many modules (one per receiver) these tasks execute out of phase with each other, multipliying the amount of wakeups caused. Fix this by creating a single wakeup source that serves all NackModule2 instances in a call. Bug: webrtc:12989 Change-Id: Ia9c84307eb57349679e42b673474feb2cb43f08e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226464 Reviewed-by: Ilya Nikolaevskiy Reviewed-by: Harald Alvestrand Commit-Queue: Markus Handell Cr-Commit-Position: refs/heads/master@{#34527} --- call/call.cc | 6 +- modules/video_coding/BUILD.gn | 1 + modules/video_coding/nack_module2.cc | 83 ++++++++++++++----- modules/video_coding/nack_module2.h | 51 +++++++++--- modules/video_coding/nack_module2_unittest.cc | 17 +++- video/rtp_video_stream_receiver2.cc | 6 +- video/rtp_video_stream_receiver2.h | 2 + video/rtp_video_stream_receiver2_unittest.cc | 10 ++- video/video_receive_stream2.cc | 19 +++-- video/video_receive_stream2.h | 4 +- video/video_receive_stream2_unittest.cc | 16 +++- 11 files changed, 161 insertions(+), 54 deletions(-) diff --git a/call/call.cc b/call/call.cc index fb1d7cd3bc..a0c33ff756 100644 --- a/call/call.cc +++ b/call/call.cc @@ -376,6 +376,9 @@ class Call final : public webrtc::Call, // network thread. bool aggregate_network_up_ RTC_GUARDED_BY(worker_thread_); + // Schedules nack periodic processing on behalf of all streams. + NackPeriodicProcessor nack_periodic_processor_; + // Audio, Video, and FlexFEC receive streams are owned by the client that // creates them. // TODO(bugs.webrtc.org/11993): Move audio_receive_streams_, @@ -1124,7 +1127,8 @@ webrtc::VideoReceiveStream* Call::CreateVideoReceiveStream( VideoReceiveStream2* receive_stream = new VideoReceiveStream2( task_queue_factory_, this, num_cpu_cores_, transport_send_->packet_router(), std::move(configuration), - call_stats_.get(), clock_, new VCMTiming(clock_)); + call_stats_.get(), clock_, new VCMTiming(clock_), + &nack_periodic_processor_); // TODO(bugs.webrtc.org/11993): Set this up asynchronously on the network // thread. receive_stream->RegisterWithTransport(&video_receiver_controller_); diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index 50f2e8d836..d88ce4221a 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -82,6 +82,7 @@ rtc_library("nack_module") { deps = [ "..:module_api", "../../api:sequence_checker", + "../../api/task_queue", "../../api/units:time_delta", "../../api/units:timestamp", "../../rtc_base:checks", diff --git a/modules/video_coding/nack_module2.cc b/modules/video_coding/nack_module2.cc index 8a3a731ed0..41a5b31cd2 100644 --- a/modules/video_coding/nack_module2.cc +++ b/modules/video_coding/nack_module2.cc @@ -13,6 +13,8 @@ #include #include +#include "api/sequence_checker.h" +#include "api/task_queue/task_queue_base.h" #include "api/units/timestamp.h" #include "rtc_base/checks.h" #include "rtc_base/experiments/field_trial_parser.h" @@ -43,7 +45,52 @@ int64_t GetSendNackDelay() { } } // namespace -constexpr TimeDelta NackModule2::kUpdateInterval; +constexpr TimeDelta NackPeriodicProcessor::kUpdateInterval; + +NackPeriodicProcessor::NackPeriodicProcessor(TimeDelta update_interval) + : update_interval_(update_interval) {} + +NackPeriodicProcessor::~NackPeriodicProcessor() {} + +void NackPeriodicProcessor::RegisterNackModule(NackModuleBase* module) { + RTC_DCHECK_RUN_ON(&sequence_); + modules_.push_back(module); + if (modules_.size() != 1) + return; + repeating_task_ = RepeatingTaskHandle::DelayedStart( + TaskQueueBase::Current(), update_interval_, [this] { + RTC_DCHECK_RUN_ON(&sequence_); + ProcessNackModules(); + return update_interval_; + }); +} + +void NackPeriodicProcessor::UnregisterNackModule(NackModuleBase* module) { + RTC_DCHECK_RUN_ON(&sequence_); + auto it = std::find(modules_.begin(), modules_.end(), module); + RTC_DCHECK(it != modules_.end()); + modules_.erase(it); + if (modules_.empty()) + repeating_task_.Stop(); +} + +// RTC_RUN_ON(sequence_) +void NackPeriodicProcessor::ProcessNackModules() { + for (NackModuleBase* module : modules_) + module->ProcessNacks(); +} + +ScopedNackPeriodicProcessorRegistration:: + ScopedNackPeriodicProcessorRegistration(NackModuleBase* module, + NackPeriodicProcessor* processor) + : module_(module), processor_(processor) { + processor_->RegisterNackModule(module_); +} + +ScopedNackPeriodicProcessorRegistration:: + ~ScopedNackPeriodicProcessorRegistration() { + processor_->UnregisterNackModule(module_); +} NackModule2::NackInfo::NackInfo() : seq_num(0), send_at_seq_num(0), sent_at_time(-1), retries(0) {} @@ -89,12 +136,11 @@ NackModule2::BackoffSettings::ParseFromFieldTrials() { } NackModule2::NackModule2(TaskQueueBase* current_queue, + NackPeriodicProcessor* periodic_processor, Clock* clock, NackSender* nack_sender, - KeyFrameRequestSender* keyframe_request_sender, - TimeDelta update_interval /*= kUpdateInterval*/) + KeyFrameRequestSender* keyframe_request_sender) : worker_thread_(current_queue), - update_interval_(update_interval), clock_(clock), nack_sender_(nack_sender), keyframe_request_sender_(keyframe_request_sender), @@ -103,32 +149,27 @@ NackModule2::NackModule2(TaskQueueBase* current_queue, rtt_ms_(kDefaultRttMs), newest_seq_num_(0), send_nack_delay_ms_(GetSendNackDelay()), - backoff_settings_(BackoffSettings::ParseFromFieldTrials()) { + backoff_settings_(BackoffSettings::ParseFromFieldTrials()), + processor_registration_(this, periodic_processor) { RTC_DCHECK(clock_); RTC_DCHECK(nack_sender_); RTC_DCHECK(keyframe_request_sender_); - RTC_DCHECK_GT(update_interval.ms(), 0); RTC_DCHECK(worker_thread_); RTC_DCHECK(worker_thread_->IsCurrent()); - - repeating_task_ = RepeatingTaskHandle::DelayedStart( - TaskQueueBase::Current(), update_interval_, - [this]() { - RTC_DCHECK_RUN_ON(worker_thread_); - std::vector nack_batch = GetNackBatch(kTimeOnly); - if (!nack_batch.empty()) { - // This batch of NACKs is triggered externally; there is no external - // initiator who can batch them with other feedback messages. - nack_sender_->SendNack(nack_batch, /*buffering_allowed=*/false); - } - return update_interval_; - }, - clock_); } NackModule2::~NackModule2() { RTC_DCHECK_RUN_ON(worker_thread_); - repeating_task_.Stop(); +} + +void NackModule2::ProcessNacks() { + RTC_DCHECK_RUN_ON(worker_thread_); + std::vector nack_batch = GetNackBatch(kTimeOnly); + if (!nack_batch.empty()) { + // This batch of NACKs is triggered externally; there is no external + // initiator who can batch them with other feedback messages. + nack_sender_->SendNack(nack_batch, /*buffering_allowed=*/false); + } } int NackModule2::OnReceivedPacket(uint16_t seq_num, bool is_keyframe) { diff --git a/modules/video_coding/nack_module2.h b/modules/video_coding/nack_module2.h index f58f886934..f1f212c94f 100644 --- a/modules/video_coding/nack_module2.h +++ b/modules/video_coding/nack_module2.h @@ -30,20 +30,54 @@ namespace webrtc { +class NackModuleBase { + public: + virtual ~NackModuleBase() = default; + virtual void ProcessNacks() = 0; +}; + +class NackPeriodicProcessor { + public: + static constexpr TimeDelta kUpdateInterval = TimeDelta::Millis(20); + explicit NackPeriodicProcessor(TimeDelta update_interval = kUpdateInterval); + ~NackPeriodicProcessor(); + void RegisterNackModule(NackModuleBase* module); + void UnregisterNackModule(NackModuleBase* module); + + private: + void ProcessNackModules() RTC_RUN_ON(sequence_); + + const TimeDelta update_interval_; + RepeatingTaskHandle repeating_task_ RTC_GUARDED_BY(sequence_); + std::vector modules_ RTC_GUARDED_BY(sequence_); + RTC_NO_UNIQUE_ADDRESS SequenceChecker sequence_; +}; + +class ScopedNackPeriodicProcessorRegistration { + public: + ScopedNackPeriodicProcessorRegistration(NackModuleBase* module, + NackPeriodicProcessor* processor); + ~ScopedNackPeriodicProcessorRegistration(); + + private: + NackModuleBase* const module_; + NackPeriodicProcessor* const processor_; +}; + // TODO(bugs.webrtc.org/11594): This class no longer implements the Module // interface and therefore "NackModule" may not be a descriptive name anymore. // Consider renaming to e.g. NackTracker or NackRequester. -class NackModule2 final { +class NackModule2 final : public NackModuleBase { public: - static constexpr TimeDelta kUpdateInterval = TimeDelta::Millis(20); - NackModule2(TaskQueueBase* current_queue, + NackPeriodicProcessor* periodic_processor, Clock* clock, NackSender* nack_sender, - KeyFrameRequestSender* keyframe_request_sender, - TimeDelta update_interval = kUpdateInterval); + KeyFrameRequestSender* keyframe_request_sender); ~NackModule2(); + void ProcessNacks() override; + int OnReceivedPacket(uint16_t seq_num, bool is_keyframe); int OnReceivedPacket(uint16_t seq_num, bool is_keyframe, bool is_recovered); @@ -103,11 +137,6 @@ class NackModule2 final { RTC_EXCLUSIVE_LOCKS_REQUIRED(worker_thread_); TaskQueueBase* const worker_thread_; - - // Used to regularly call SendNack if needed. - RepeatingTaskHandle repeating_task_ RTC_GUARDED_BY(worker_thread_); - const TimeDelta update_interval_; - Clock* const clock_; NackSender* const nack_sender_; KeyFrameRequestSender* const keyframe_request_sender_; @@ -131,6 +160,8 @@ class NackModule2 final { const absl::optional backoff_settings_; + ScopedNackPeriodicProcessorRegistration processor_registration_; + // Used to signal destruction to potentially pending tasks. ScopedTaskSafety task_safety_; }; diff --git a/modules/video_coding/nack_module2_unittest.cc b/modules/video_coding/nack_module2_unittest.cc index acd1eead01..7ffcc12891 100644 --- a/modules/video_coding/nack_module2_unittest.cc +++ b/modules/video_coding/nack_module2_unittest.cc @@ -80,10 +80,13 @@ class TestNackModule2 : public ::testing::TestWithParam, } NackModule2& CreateNackModule( - TimeDelta interval = NackModule2::kUpdateInterval) { + TimeDelta interval = NackPeriodicProcessor::kUpdateInterval) { RTC_DCHECK(!nack_module_.get()); - nack_module_ = std::make_unique( - TaskQueueBase::Current(), clock_.get(), this, this, interval); + nack_periodic_processor_ = + std::make_unique(interval); + nack_module_ = std::make_unique(TaskQueueBase::Current(), + nack_periodic_processor_.get(), + clock_.get(), this, this); nack_module_->UpdateRtt(kDefaultRttMs); return *nack_module_.get(); } @@ -92,6 +95,7 @@ class TestNackModule2 : public ::testing::TestWithParam, test::RunLoop loop_; std::unique_ptr clock_; test::ScopedFieldTrials field_trial_; + std::unique_ptr nack_periodic_processor_; std::unique_ptr nack_module_; std::vector sent_nacks_; int keyframes_requested_; @@ -379,7 +383,11 @@ class TestNackModule2WithFieldTrial : public ::testing::Test, TestNackModule2WithFieldTrial() : nack_delay_field_trial_("WebRTC-SendNackDelayMs/10/"), clock_(new SimulatedClock(0)), - nack_module_(TaskQueueBase::Current(), clock_.get(), this, this), + nack_module_(TaskQueueBase::Current(), + &nack_periodic_processor_, + clock_.get(), + this, + this), keyframes_requested_(0) {} void SendNack(const std::vector& sequence_numbers, @@ -392,6 +400,7 @@ class TestNackModule2WithFieldTrial : public ::testing::Test, test::ScopedFieldTrials nack_delay_field_trial_; std::unique_ptr clock_; + NackPeriodicProcessor nack_periodic_processor_; NackModule2 nack_module_; std::vector sent_nacks_; int keyframes_requested_; diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc index 4b43247b18..8929ab4f1c 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -105,6 +105,7 @@ std::unique_ptr CreateRtpRtcpModule( std::unique_ptr MaybeConstructNackModule( TaskQueueBase* current_queue, + NackPeriodicProcessor* nack_periodic_processor, const VideoReceiveStream::Config& config, Clock* clock, NackSender* nack_sender, @@ -113,7 +114,8 @@ std::unique_ptr MaybeConstructNackModule( return nullptr; // TODO(bugs.webrtc.org/12420): pass rtp_history_ms to the nack module. - return std::make_unique(current_queue, clock, nack_sender, + return std::make_unique(current_queue, nack_periodic_processor, + clock, nack_sender, keyframe_request_sender); } @@ -210,6 +212,7 @@ RtpVideoStreamReceiver2::RtpVideoStreamReceiver2( ReceiveStatistics* rtp_receive_statistics, RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer, RtcpCnameCallback* rtcp_cname_callback, + NackPeriodicProcessor* nack_periodic_processor, NackSender* nack_sender, KeyFrameRequestSender* keyframe_request_sender, OnCompleteFrameCallback* complete_frame_callback, @@ -243,6 +246,7 @@ RtpVideoStreamReceiver2::RtpVideoStreamReceiver2( // directly with |rtp_rtcp_|. rtcp_feedback_buffer_(this, nack_sender, this), nack_module_(MaybeConstructNackModule(current_queue, + nack_periodic_processor, config_, clock_, &rtcp_feedback_buffer_, diff --git a/video/rtp_video_stream_receiver2.h b/video/rtp_video_stream_receiver2.h index ddff26b3bd..d97f5211a7 100644 --- a/video/rtp_video_stream_receiver2.h +++ b/video/rtp_video_stream_receiver2.h @@ -39,6 +39,7 @@ #include "modules/rtp_rtcp/source/video_rtp_depacketizer.h" #include "modules/video_coding/h264_sps_pps_tracker.h" #include "modules/video_coding/loss_notification_controller.h" +#include "modules/video_coding/nack_module2.h" #include "modules/video_coding/packet_buffer.h" #include "modules/video_coding/rtp_frame_reference_finder.h" #include "modules/video_coding/unique_timestamp_counter.h" @@ -89,6 +90,7 @@ class RtpVideoStreamReceiver2 : public LossNotificationSender, ReceiveStatistics* rtp_receive_statistics, RtcpPacketTypeCounterObserver* rtcp_packet_type_counter_observer, RtcpCnameCallback* rtcp_cname_callback, + NackPeriodicProcessor* nack_periodic_processor, NackSender* nack_sender, // The KeyFrameRequestSender is optional; if not provided, key frame // requests are sent via the internal RtpRtcp module. diff --git a/video/rtp_video_stream_receiver2_unittest.cc b/video/rtp_video_stream_receiver2_unittest.cc index 7ccf0a5faa..f97ccb65b1 100644 --- a/video/rtp_video_stream_receiver2_unittest.cc +++ b/video/rtp_video_stream_receiver2_unittest.cc @@ -172,8 +172,9 @@ class RtpVideoStreamReceiver2Test : public ::testing::Test, rtp_video_stream_receiver_ = std::make_unique( TaskQueueBase::Current(), Clock::GetRealTimeClock(), &mock_transport_, nullptr, nullptr, &config_, rtp_receive_statistics_.get(), nullptr, - nullptr, &mock_nack_sender_, &mock_key_frame_request_sender_, - &mock_on_complete_frame_callback_, nullptr, nullptr); + nullptr, &nack_periodic_processor_, &mock_nack_sender_, + &mock_key_frame_request_sender_, &mock_on_complete_frame_callback_, + nullptr, nullptr); VideoCodec codec; codec.codecType = kVideoCodecGeneric; rtp_video_stream_receiver_->AddReceiveCodec(kPayloadType, codec, {}, @@ -244,6 +245,7 @@ class RtpVideoStreamReceiver2Test : public ::testing::Test, const webrtc::test::ScopedFieldTrials override_field_trials_; VideoReceiveStream::Config config_; + NackPeriodicProcessor nack_periodic_processor_; MockNackSender mock_nack_sender_; MockKeyFrameRequestSender mock_key_frame_request_sender_; MockTransport mock_transport_; @@ -1132,8 +1134,8 @@ TEST_F(RtpVideoStreamReceiver2Test, TransformFrame) { auto receiver = std::make_unique( TaskQueueBase::Current(), Clock::GetRealTimeClock(), &mock_transport_, nullptr, nullptr, &config_, rtp_receive_statistics_.get(), nullptr, - nullptr, &mock_nack_sender_, nullptr, &mock_on_complete_frame_callback_, - nullptr, mock_frame_transformer); + nullptr, &nack_periodic_processor_, &mock_nack_sender_, nullptr, + &mock_on_complete_frame_callback_, nullptr, mock_frame_transformer); VideoCodec video_codec; video_codec.codecType = kVideoCodecGeneric; receiver->AddReceiveCodec(kPayloadType, video_codec, {}, diff --git a/video/video_receive_stream2.cc b/video/video_receive_stream2.cc index 72257f01cc..0bb2307d12 100644 --- a/video/video_receive_stream2.cc +++ b/video/video_receive_stream2.cc @@ -211,14 +211,16 @@ int DetermineMaxWaitForFrame(const VideoReceiveStream::Config& config, : kMaxWaitForFrameMs; } -VideoReceiveStream2::VideoReceiveStream2(TaskQueueFactory* task_queue_factory, - Call* call, - int num_cpu_cores, - PacketRouter* packet_router, - VideoReceiveStream::Config config, - CallStats* call_stats, - Clock* clock, - VCMTiming* timing) +VideoReceiveStream2::VideoReceiveStream2( + TaskQueueFactory* task_queue_factory, + Call* call, + int num_cpu_cores, + PacketRouter* packet_router, + VideoReceiveStream::Config config, + CallStats* call_stats, + Clock* clock, + VCMTiming* timing, + NackPeriodicProcessor* nack_periodic_processor) : task_queue_factory_(task_queue_factory), transport_adapter_(config.rtcp_send_transport), config_(std::move(config)), @@ -240,6 +242,7 @@ VideoReceiveStream2::VideoReceiveStream2(TaskQueueFactory* task_queue_factory, rtp_receive_statistics_.get(), &stats_proxy_, &stats_proxy_, + nack_periodic_processor, this, // NackSender nullptr, // Use default KeyFrameRequestSender this, // OnCompleteFrameCallback diff --git a/video/video_receive_stream2.h b/video/video_receive_stream2.h index 9557044277..9ed5942453 100644 --- a/video/video_receive_stream2.h +++ b/video/video_receive_stream2.h @@ -25,6 +25,7 @@ #include "modules/rtp_rtcp/include/flexfec_receiver.h" #include "modules/rtp_rtcp/source/source_tracker.h" #include "modules/video_coding/frame_buffer2.h" +#include "modules/video_coding/nack_module2.h" #include "modules/video_coding/video_receiver2.h" #include "rtc_base/system/no_unique_address.h" #include "rtc_base/task_queue.h" @@ -97,7 +98,8 @@ class VideoReceiveStream2 VideoReceiveStream::Config config, CallStats* call_stats, Clock* clock, - VCMTiming* timing); + VCMTiming* timing, + NackPeriodicProcessor* nack_periodic_processor); // Destruction happens on the worker thread. Prior to destruction the caller // must ensure that a registration with the transport has been cleared. See // `RegisterWithTransport` for details. diff --git a/video/video_receive_stream2_unittest.cc b/video/video_receive_stream2_unittest.cc index 850fd0dbb5..0b0ea352b3 100644 --- a/video/video_receive_stream2_unittest.cc +++ b/video/video_receive_stream2_unittest.cc @@ -137,7 +137,8 @@ class VideoReceiveStream2Test : public ::testing::Test { video_receive_stream_ = std::make_unique( task_queue_factory_.get(), &fake_call_, kDefaultNumCpuCores, - &packet_router_, config_.Copy(), &call_stats_, clock_, timing_); + &packet_router_, config_.Copy(), &call_stats_, clock_, timing_, + &nack_periodic_processor_); video_receive_stream_->RegisterWithTransport( &rtp_stream_receiver_controller_); } @@ -146,6 +147,7 @@ class VideoReceiveStream2Test : public ::testing::Test { test::RunLoop loop_; const std::unique_ptr task_queue_factory_; test::VideoDecoderProxyFactory h264_decoder_factory_; + NackPeriodicProcessor nack_periodic_processor_; VideoReceiveStream::Config config_; internal::CallStats call_stats_; MockVideoDecoder mock_h264_video_decoder_; @@ -316,7 +318,8 @@ class VideoReceiveStream2TestWithFakeDecoder : public ::testing::Test { timing_ = new VCMTiming(clock_); video_receive_stream_.reset(new webrtc::internal::VideoReceiveStream2( task_queue_factory_.get(), &fake_call_, kDefaultNumCpuCores, - &packet_router_, config_.Copy(), &call_stats_, clock_, timing_)); + &packet_router_, config_.Copy(), &call_stats_, clock_, timing_, + &nack_periodic_processor_)); video_receive_stream_->RegisterWithTransport( &rtp_stream_receiver_controller_); video_receive_stream_->SetAndGetRecordingState(std::move(state), false); @@ -326,6 +329,7 @@ class VideoReceiveStream2TestWithFakeDecoder : public ::testing::Test { test::RunLoop loop_; test::FunctionVideoDecoderFactory fake_decoder_factory_; const std::unique_ptr task_queue_factory_; + NackPeriodicProcessor nack_periodic_processor_; VideoReceiveStream::Config config_; internal::CallStats call_stats_; cricket::FakeVideoRenderer fake_renderer_; @@ -581,7 +585,8 @@ class VideoReceiveStream2TestWithSimulatedClock config_.Copy(), &call_stats_, time_controller_.GetClock(), - new VCMTiming(time_controller_.GetClock())) { + new VCMTiming(time_controller_.GetClock()), + &nack_periodic_processor_) { video_receive_stream_.RegisterWithTransport( &rtp_stream_receiver_controller_); video_receive_stream_.Start(); @@ -608,6 +613,7 @@ class VideoReceiveStream2TestWithSimulatedClock MockTransport mock_transport_; FakeRenderer fake_renderer_; cricket::FakeCall fake_call_; + NackPeriodicProcessor nack_periodic_processor_; VideoReceiveStream::Config config_; internal::CallStats call_stats_; PacketRouter packet_router_; @@ -749,7 +755,8 @@ class VideoReceiveStream2TestWithLazyDecoderCreation : public ::testing::Test { video_receive_stream_ = std::make_unique( task_queue_factory_.get(), &fake_call_, kDefaultNumCpuCores, - &packet_router_, config_.Copy(), &call_stats_, clock_, timing_); + &packet_router_, config_.Copy(), &call_stats_, clock_, timing_, + &nack_periodic_processor_); video_receive_stream_->RegisterWithTransport( &rtp_stream_receiver_controller_); } @@ -758,6 +765,7 @@ class VideoReceiveStream2TestWithLazyDecoderCreation : public ::testing::Test { test::RunLoop loop_; const std::unique_ptr task_queue_factory_; MockVideoDecoderFactory mock_h264_decoder_factory_; + NackPeriodicProcessor nack_periodic_processor_; VideoReceiveStream::Config config_; internal::CallStats call_stats_; MockVideoDecoder mock_h264_video_decoder_; From 190244bb5979d7be68266694463df80665774325 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Fri, 9 Jul 2021 15:56:57 +0200 Subject: [PATCH 0065/1565] Remove all #include / and usage in Obj-C code. This CL completes the removal of assert() and relative headers from the codebase (excluded //examples/objc/AppRTCMobile/third_party/SocketRocket which is in a third_party sub-directory). Bug: webrtc:6779 Change-Id: I93ed57168d2c0e011626873d66529488c5f484f2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225546 Commit-Queue: Mirko Bonadei Reviewed-by: Harald Alvestrand Cr-Commit-Position: refs/heads/master@{#34528} --- api/audio_codecs/audio_decoder.cc | 1 - modules/audio_coding/acm2/acm_resampler.cc | 1 - modules/audio_coding/acm2/acm_send_test.cc | 1 - modules/audio_coding/acm2/audio_coding_module.cc | 1 - modules/audio_coding/neteq/accelerate.cc | 1 - modules/audio_coding/neteq/audio_decoder_unittest.cc | 1 - modules/audio_coding/neteq/audio_multi_vector.cc | 1 - modules/audio_coding/neteq/audio_vector.cc | 1 - modules/audio_coding/neteq/background_noise.cc | 1 - modules/audio_coding/neteq/comfort_noise.cc | 1 - modules/audio_coding/neteq/decision_logic.cc | 1 - modules/audio_coding/neteq/delay_manager.cc | 1 - modules/audio_coding/neteq/dsp_helper.cc | 1 - modules/audio_coding/neteq/expand.cc | 1 - modules/audio_coding/neteq/expand.h | 1 - modules/audio_coding/neteq/merge.cc | 1 - modules/audio_coding/neteq/nack_tracker.cc | 1 - modules/audio_coding/neteq/neteq_impl.cc | 1 - modules/audio_coding/neteq/red_payload_splitter.cc | 1 - .../neteq/red_payload_splitter_unittest.cc | 1 - modules/audio_coding/neteq/statistics_calculator.cc | 1 - modules/audio_coding/neteq/time_stretch.h | 1 - modules/audio_coding/neteq/tools/output_audio_file.h | 1 - modules/audio_coding/neteq/tools/rtp_analyze.cc | 1 - modules/audio_coding/neteq/tools/rtp_file_source.cc | 1 - modules/audio_coding/neteq/tools/rtp_generator.cc | 1 - modules/audio_coding/test/Channel.cc | 1 - modules/audio_device/linux/audio_device_alsa_linux.cc | 1 - modules/audio_device/win/audio_device_core_win.cc | 1 - modules/desktop_capture/mac/desktop_configuration.mm | 6 ++++-- modules/desktop_capture/mouse_cursor_monitor_mac.mm | 10 +++++----- .../desktop_capture/mouse_cursor_monitor_unittest.cc | 1 - modules/desktop_capture/mouse_cursor_monitor_win.cc | 1 - modules/desktop_capture/screen_capturer_helper.cc | 1 - modules/desktop_capture/window_capturer_mac.mm | 6 +++--- modules/remote_bitrate_estimator/aimd_rate_control.cc | 1 - modules/remote_bitrate_estimator/inter_arrival.cc | 2 -- modules/remote_bitrate_estimator/overuse_estimator.cc | 1 - .../remote_bitrate_estimator_single_stream.cc | 1 - modules/rtp_rtcp/source/rtp_format_video_generic.cc | 1 - modules/rtp_rtcp/source/rtp_utility.cc | 1 - modules/utility/source/helpers_android.cc | 1 - modules/video_capture/device_info_impl.cc | 1 - modules/video_capture/windows/device_info_ds.cc | 1 - modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc | 1 - modules/video_coding/codecs/vp9/include/vp9_globals.h | 1 - modules/video_coding/frame_buffer.cc | 1 - modules/video_coding/jitter_buffer.cc | 1 - modules/video_coding/jitter_estimator.cc | 1 - modules/video_coding/media_opt_util.cc | 1 - modules/video_coding/receiver.cc | 1 - modules/video_coding/session_info.cc | 1 - modules/video_coding/timing.cc | 1 - rtc_base/third_party/base64/base64.cc | 1 - test/field_trial.cc | 1 - test/frame_generator_unittest.cc | 1 - test/linux/glx_renderer.cc | 1 - test/rtp_file_reader.cc | 1 - test/testsupport/file_utils.cc | 1 - 59 files changed, 12 insertions(+), 67 deletions(-) diff --git a/api/audio_codecs/audio_decoder.cc b/api/audio_codecs/audio_decoder.cc index 4b18b4ab52..4fc995172b 100644 --- a/api/audio_codecs/audio_decoder.cc +++ b/api/audio_codecs/audio_decoder.cc @@ -10,7 +10,6 @@ #include "api/audio_codecs/audio_decoder.h" -#include #include #include diff --git a/modules/audio_coding/acm2/acm_resampler.cc b/modules/audio_coding/acm2/acm_resampler.cc index 367ec2b9cd..7c7393d72f 100644 --- a/modules/audio_coding/acm2/acm_resampler.cc +++ b/modules/audio_coding/acm2/acm_resampler.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/acm2/acm_resampler.h" -#include #include #include "rtc_base/logging.h" diff --git a/modules/audio_coding/acm2/acm_send_test.cc b/modules/audio_coding/acm2/acm_send_test.cc index cda668dab8..a84fa7c3e9 100644 --- a/modules/audio_coding/acm2/acm_send_test.cc +++ b/modules/audio_coding/acm2/acm_send_test.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/acm2/acm_send_test.h" -#include #include #include diff --git a/modules/audio_coding/acm2/audio_coding_module.cc b/modules/audio_coding/acm2/audio_coding_module.cc index 7d0f4d1e84..b5c0c3bc4e 100644 --- a/modules/audio_coding/acm2/audio_coding_module.cc +++ b/modules/audio_coding/acm2/audio_coding_module.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/include/audio_coding_module.h" -#include #include #include diff --git a/modules/audio_coding/neteq/accelerate.cc b/modules/audio_coding/neteq/accelerate.cc index e97191d8d2..954b148e0e 100644 --- a/modules/audio_coding/neteq/accelerate.cc +++ b/modules/audio_coding/neteq/accelerate.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/neteq/accelerate.h" -#include #include "api/array_view.h" #include "modules/audio_coding/neteq/audio_multi_vector.h" diff --git a/modules/audio_coding/neteq/audio_decoder_unittest.cc b/modules/audio_coding/neteq/audio_decoder_unittest.cc index 2277872ee4..b13fe44f87 100644 --- a/modules/audio_coding/neteq/audio_decoder_unittest.cc +++ b/modules/audio_coding/neteq/audio_decoder_unittest.cc @@ -8,7 +8,6 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include #include #include diff --git a/modules/audio_coding/neteq/audio_multi_vector.cc b/modules/audio_coding/neteq/audio_multi_vector.cc index 290d7eae22..a3b5ce30d7 100644 --- a/modules/audio_coding/neteq/audio_multi_vector.cc +++ b/modules/audio_coding/neteq/audio_multi_vector.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/neteq/audio_multi_vector.h" -#include #include diff --git a/modules/audio_coding/neteq/audio_vector.cc b/modules/audio_coding/neteq/audio_vector.cc index 5e435e944d..ce27a8842d 100644 --- a/modules/audio_coding/neteq/audio_vector.cc +++ b/modules/audio_coding/neteq/audio_vector.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/neteq/audio_vector.h" -#include #include #include diff --git a/modules/audio_coding/neteq/background_noise.cc b/modules/audio_coding/neteq/background_noise.cc index ae4645c78e..8f61598d48 100644 --- a/modules/audio_coding/neteq/background_noise.cc +++ b/modules/audio_coding/neteq/background_noise.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/neteq/background_noise.h" -#include #include // memcpy #include // min, max diff --git a/modules/audio_coding/neteq/comfort_noise.cc b/modules/audio_coding/neteq/comfort_noise.cc index b02e3d747f..7169f06cb3 100644 --- a/modules/audio_coding/neteq/comfort_noise.cc +++ b/modules/audio_coding/neteq/comfort_noise.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/neteq/comfort_noise.h" -#include #include #include diff --git a/modules/audio_coding/neteq/decision_logic.cc b/modules/audio_coding/neteq/decision_logic.cc index d702729881..edefbe6d67 100644 --- a/modules/audio_coding/neteq/decision_logic.cc +++ b/modules/audio_coding/neteq/decision_logic.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/neteq/decision_logic.h" -#include #include #include diff --git a/modules/audio_coding/neteq/delay_manager.cc b/modules/audio_coding/neteq/delay_manager.cc index aec80cfa4b..41de274ba3 100644 --- a/modules/audio_coding/neteq/delay_manager.cc +++ b/modules/audio_coding/neteq/delay_manager.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/neteq/delay_manager.h" -#include #include #include diff --git a/modules/audio_coding/neteq/dsp_helper.cc b/modules/audio_coding/neteq/dsp_helper.cc index 91979f2d48..2b1518e867 100644 --- a/modules/audio_coding/neteq/dsp_helper.cc +++ b/modules/audio_coding/neteq/dsp_helper.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/neteq/dsp_helper.h" -#include #include // Access to memset. #include // Access to min, max. diff --git a/modules/audio_coding/neteq/expand.cc b/modules/audio_coding/neteq/expand.cc index ffaa4c74aa..37a08d634b 100644 --- a/modules/audio_coding/neteq/expand.cc +++ b/modules/audio_coding/neteq/expand.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/neteq/expand.h" -#include #include // memset #include // min, max diff --git a/modules/audio_coding/neteq/expand.h b/modules/audio_coding/neteq/expand.h index 3b0cea3d93..35dee65e7f 100644 --- a/modules/audio_coding/neteq/expand.h +++ b/modules/audio_coding/neteq/expand.h @@ -11,7 +11,6 @@ #ifndef MODULES_AUDIO_CODING_NETEQ_EXPAND_H_ #define MODULES_AUDIO_CODING_NETEQ_EXPAND_H_ -#include #include diff --git a/modules/audio_coding/neteq/merge.cc b/modules/audio_coding/neteq/merge.cc index 770e2e3590..07d8722e37 100644 --- a/modules/audio_coding/neteq/merge.cc +++ b/modules/audio_coding/neteq/merge.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/neteq/merge.h" -#include #include // memmove, memcpy, memset, size_t #include // min, max diff --git a/modules/audio_coding/neteq/nack_tracker.cc b/modules/audio_coding/neteq/nack_tracker.cc index 9a873eee07..8d94306d04 100644 --- a/modules/audio_coding/neteq/nack_tracker.cc +++ b/modules/audio_coding/neteq/nack_tracker.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/neteq/nack_tracker.h" -#include #include #include diff --git a/modules/audio_coding/neteq/neteq_impl.cc b/modules/audio_coding/neteq/neteq_impl.cc index 8b07d7e47c..7225227789 100644 --- a/modules/audio_coding/neteq/neteq_impl.cc +++ b/modules/audio_coding/neteq/neteq_impl.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/neteq/neteq_impl.h" -#include #include #include diff --git a/modules/audio_coding/neteq/red_payload_splitter.cc b/modules/audio_coding/neteq/red_payload_splitter.cc index 2f21a5ff6c..b517e38071 100644 --- a/modules/audio_coding/neteq/red_payload_splitter.cc +++ b/modules/audio_coding/neteq/red_payload_splitter.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/neteq/red_payload_splitter.h" -#include #include #include diff --git a/modules/audio_coding/neteq/red_payload_splitter_unittest.cc b/modules/audio_coding/neteq/red_payload_splitter_unittest.cc index 7275232daa..1f16945cdb 100644 --- a/modules/audio_coding/neteq/red_payload_splitter_unittest.cc +++ b/modules/audio_coding/neteq/red_payload_splitter_unittest.cc @@ -12,7 +12,6 @@ #include "modules/audio_coding/neteq/red_payload_splitter.h" -#include #include #include // pair diff --git a/modules/audio_coding/neteq/statistics_calculator.cc b/modules/audio_coding/neteq/statistics_calculator.cc index 12a0e3c9ec..741cdbd778 100644 --- a/modules/audio_coding/neteq/statistics_calculator.cc +++ b/modules/audio_coding/neteq/statistics_calculator.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/neteq/statistics_calculator.h" -#include #include // memset #include diff --git a/modules/audio_coding/neteq/time_stretch.h b/modules/audio_coding/neteq/time_stretch.h index 26d295f669..17ea4ec5a7 100644 --- a/modules/audio_coding/neteq/time_stretch.h +++ b/modules/audio_coding/neteq/time_stretch.h @@ -11,7 +11,6 @@ #ifndef MODULES_AUDIO_CODING_NETEQ_TIME_STRETCH_H_ #define MODULES_AUDIO_CODING_NETEQ_TIME_STRETCH_H_ -#include #include // memset, size_t #include "modules/audio_coding/neteq/audio_multi_vector.h" diff --git a/modules/audio_coding/neteq/tools/output_audio_file.h b/modules/audio_coding/neteq/tools/output_audio_file.h index 7220a36d69..f5b0988aa3 100644 --- a/modules/audio_coding/neteq/tools/output_audio_file.h +++ b/modules/audio_coding/neteq/tools/output_audio_file.h @@ -11,7 +11,6 @@ #ifndef MODULES_AUDIO_CODING_NETEQ_TOOLS_OUTPUT_AUDIO_FILE_H_ #define MODULES_AUDIO_CODING_NETEQ_TOOLS_OUTPUT_AUDIO_FILE_H_ -#include #include #include diff --git a/modules/audio_coding/neteq/tools/rtp_analyze.cc b/modules/audio_coding/neteq/tools/rtp_analyze.cc index 46fc2d744e..7ecf925ebb 100644 --- a/modules/audio_coding/neteq/tools/rtp_analyze.cc +++ b/modules/audio_coding/neteq/tools/rtp_analyze.cc @@ -8,7 +8,6 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include #include #include diff --git a/modules/audio_coding/neteq/tools/rtp_file_source.cc b/modules/audio_coding/neteq/tools/rtp_file_source.cc index 16b225e5df..e9c6fed951 100644 --- a/modules/audio_coding/neteq/tools/rtp_file_source.cc +++ b/modules/audio_coding/neteq/tools/rtp_file_source.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/neteq/tools/rtp_file_source.h" -#include #include #ifndef WIN32 #include diff --git a/modules/audio_coding/neteq/tools/rtp_generator.cc b/modules/audio_coding/neteq/tools/rtp_generator.cc index a37edef20a..38c30c4f23 100644 --- a/modules/audio_coding/neteq/tools/rtp_generator.cc +++ b/modules/audio_coding/neteq/tools/rtp_generator.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/neteq/tools/rtp_generator.h" -#include namespace webrtc { namespace test { diff --git a/modules/audio_coding/test/Channel.cc b/modules/audio_coding/test/Channel.cc index d7bd6a968b..ec0eccb5d9 100644 --- a/modules/audio_coding/test/Channel.cc +++ b/modules/audio_coding/test/Channel.cc @@ -10,7 +10,6 @@ #include "modules/audio_coding/test/Channel.h" -#include #include diff --git a/modules/audio_device/linux/audio_device_alsa_linux.cc b/modules/audio_device/linux/audio_device_alsa_linux.cc index 60e01e1239..a0f574475a 100644 --- a/modules/audio_device/linux/audio_device_alsa_linux.cc +++ b/modules/audio_device/linux/audio_device_alsa_linux.cc @@ -10,7 +10,6 @@ #include "modules/audio_device/linux/audio_device_alsa_linux.h" -#include #include "modules/audio_device/audio_device_config.h" #include "rtc_base/logging.h" diff --git a/modules/audio_device/win/audio_device_core_win.cc b/modules/audio_device/win/audio_device_core_win.cc index a3723edb56..8bfa0eae15 100644 --- a/modules/audio_device/win/audio_device_core_win.cc +++ b/modules/audio_device/win/audio_device_core_win.cc @@ -25,7 +25,6 @@ #include "modules/audio_device/win/audio_device_core_win.h" -#include #include #include diff --git a/modules/desktop_capture/mac/desktop_configuration.mm b/modules/desktop_capture/mac/desktop_configuration.mm index 5962fabb70..ef69b6424f 100644 --- a/modules/desktop_capture/mac/desktop_configuration.mm +++ b/modules/desktop_capture/mac/desktop_configuration.mm @@ -14,6 +14,8 @@ #include #include +#include "rtc_base/checks.h" + #if !defined(MAC_OS_X_VERSION_10_7) || \ MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7 @@ -40,7 +42,7 @@ DesktopRect NSRectToDesktopRect(const NSRect& ns_rect) { // relative to |bounds|. void InvertRectYOrigin(const DesktopRect& bounds, DesktopRect* rect) { - assert(bounds.top() == 0); + RTC_DCHECK_EQ(bounds.top(), 0); *rect = DesktopRect::MakeXYWH( rect->left(), bounds.bottom() - rect->bottom(), rect->width(), rect->height()); @@ -106,7 +108,7 @@ MacDisplayConfiguration GetConfigurationForScreen(NSScreen* screen) { MacDesktopConfiguration desktop_config; NSArray* screens = [NSScreen screens]; - assert(screens); + RTC_DCHECK(screens); // Iterator over the monitors, adding the primary monitor and monitors whose // DPI match that of the primary monitor. diff --git a/modules/desktop_capture/mouse_cursor_monitor_mac.mm b/modules/desktop_capture/mouse_cursor_monitor_mac.mm index 31ad428e0a..995aeb9176 100644 --- a/modules/desktop_capture/mouse_cursor_monitor_mac.mm +++ b/modules/desktop_capture/mouse_cursor_monitor_mac.mm @@ -10,7 +10,6 @@ #include "modules/desktop_capture/mouse_cursor_monitor.h" -#include #include @@ -26,6 +25,7 @@ #include "modules/desktop_capture/mac/desktop_configuration_monitor.h" #include "modules/desktop_capture/mac/window_list_utils.h" #include "modules/desktop_capture/mouse_cursor.h" +#include "rtc_base/checks.h" namespace webrtc { @@ -88,21 +88,21 @@ void DisplaysReconfigured(CGDirectDisplayID display, screen_id_(screen_id), callback_(NULL), mode_(SHAPE_AND_POSITION) { - assert(window_id == kCGNullWindowID || screen_id == kInvalidScreenId); + RTC_DCHECK(window_id == kCGNullWindowID || screen_id == kInvalidScreenId); } MouseCursorMonitorMac::~MouseCursorMonitorMac() {} void MouseCursorMonitorMac::Init(Callback* callback, Mode mode) { - assert(!callback_); - assert(callback); + RTC_DCHECK(!callback_); + RTC_DCHECK(callback); callback_ = callback; mode_ = mode; } void MouseCursorMonitorMac::Capture() { - assert(callback_); + RTC_DCHECK(callback_); CGEventRef event = CGEventCreate(NULL); CGPoint gc_position = CGEventGetLocation(event); diff --git a/modules/desktop_capture/mouse_cursor_monitor_unittest.cc b/modules/desktop_capture/mouse_cursor_monitor_unittest.cc index 268e5e3475..f771276a2b 100644 --- a/modules/desktop_capture/mouse_cursor_monitor_unittest.cc +++ b/modules/desktop_capture/mouse_cursor_monitor_unittest.cc @@ -10,7 +10,6 @@ #include "modules/desktop_capture/mouse_cursor_monitor.h" -#include #include #include diff --git a/modules/desktop_capture/mouse_cursor_monitor_win.cc b/modules/desktop_capture/mouse_cursor_monitor_win.cc index 5a10ee1251..c892d59955 100644 --- a/modules/desktop_capture/mouse_cursor_monitor_win.cc +++ b/modules/desktop_capture/mouse_cursor_monitor_win.cc @@ -8,7 +8,6 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include #include #include diff --git a/modules/desktop_capture/screen_capturer_helper.cc b/modules/desktop_capture/screen_capturer_helper.cc index e8bd3fc450..d55aea6487 100644 --- a/modules/desktop_capture/screen_capturer_helper.cc +++ b/modules/desktop_capture/screen_capturer_helper.cc @@ -10,7 +10,6 @@ #include "modules/desktop_capture/screen_capturer_helper.h" -#include namespace webrtc { diff --git a/modules/desktop_capture/window_capturer_mac.mm b/modules/desktop_capture/window_capturer_mac.mm index cbbc500613..de15d65ac5 100644 --- a/modules/desktop_capture/window_capturer_mac.mm +++ b/modules/desktop_capture/window_capturer_mac.mm @@ -8,7 +8,6 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include #include #include #include @@ -24,6 +23,7 @@ #include "modules/desktop_capture/mac/desktop_frame_cgimage.h" #include "modules/desktop_capture/mac/window_list_utils.h" #include "modules/desktop_capture/window_finder_mac.h" +#include "rtc_base/checks.h" #include "rtc_base/constructor_magic.h" #include "rtc_base/logging.h" #include "rtc_base/trace_event.h" @@ -142,8 +142,8 @@ explicit WindowCapturerMac( } void WindowCapturerMac::Start(Callback* callback) { - assert(!callback_); - assert(callback); + RTC_DCHECK(!callback_); + RTC_DCHECK(callback); callback_ = callback; } diff --git a/modules/remote_bitrate_estimator/aimd_rate_control.cc b/modules/remote_bitrate_estimator/aimd_rate_control.cc index bf7119cc7d..0a754e1f41 100644 --- a/modules/remote_bitrate_estimator/aimd_rate_control.cc +++ b/modules/remote_bitrate_estimator/aimd_rate_control.cc @@ -13,7 +13,6 @@ #include #include -#include #include #include #include diff --git a/modules/remote_bitrate_estimator/inter_arrival.cc b/modules/remote_bitrate_estimator/inter_arrival.cc index a8cf47fbfe..ce8af0bfb7 100644 --- a/modules/remote_bitrate_estimator/inter_arrival.cc +++ b/modules/remote_bitrate_estimator/inter_arrival.cc @@ -10,8 +10,6 @@ #include "modules/remote_bitrate_estimator/inter_arrival.h" -#include - #include "modules/include/module_common_types_public.h" #include "rtc_base/logging.h" diff --git a/modules/remote_bitrate_estimator/overuse_estimator.cc b/modules/remote_bitrate_estimator/overuse_estimator.cc index 3427d5880c..1ae9fcfb07 100644 --- a/modules/remote_bitrate_estimator/overuse_estimator.cc +++ b/modules/remote_bitrate_estimator/overuse_estimator.cc @@ -10,7 +10,6 @@ #include "modules/remote_bitrate_estimator/overuse_estimator.h" -#include #include #include diff --git a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc index ddaa1de088..bbb2db2bb5 100644 --- a/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc +++ b/modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.cc @@ -10,7 +10,6 @@ #include "modules/remote_bitrate_estimator/remote_bitrate_estimator_single_stream.h" -#include #include #include diff --git a/modules/rtp_rtcp/source/rtp_format_video_generic.cc b/modules/rtp_rtcp/source/rtp_format_video_generic.cc index 35d0f3dcc5..f5c7f2ee29 100644 --- a/modules/rtp_rtcp/source/rtp_format_video_generic.cc +++ b/modules/rtp_rtcp/source/rtp_format_video_generic.cc @@ -10,7 +10,6 @@ #include "modules/rtp_rtcp/source/rtp_format_video_generic.h" -#include #include #include "absl/types/optional.h" diff --git a/modules/rtp_rtcp/source/rtp_utility.cc b/modules/rtp_rtcp/source/rtp_utility.cc index d76e1981f6..c96c082473 100644 --- a/modules/rtp_rtcp/source/rtp_utility.cc +++ b/modules/rtp_rtcp/source/rtp_utility.cc @@ -10,7 +10,6 @@ #include "modules/rtp_rtcp/source/rtp_utility.h" -#include #include #include diff --git a/modules/utility/source/helpers_android.cc b/modules/utility/source/helpers_android.cc index 0206d15274..f4b35a7ecb 100644 --- a/modules/utility/source/helpers_android.cc +++ b/modules/utility/source/helpers_android.cc @@ -11,7 +11,6 @@ #include "modules/utility/include/helpers_android.h" #include -#include #include #include #include diff --git a/modules/video_capture/device_info_impl.cc b/modules/video_capture/device_info_impl.cc index d5abb29407..ac78cbc84a 100644 --- a/modules/video_capture/device_info_impl.cc +++ b/modules/video_capture/device_info_impl.cc @@ -10,7 +10,6 @@ #include "modules/video_capture/device_info_impl.h" -#include #include #include "absl/strings/match.h" diff --git a/modules/video_capture/windows/device_info_ds.cc b/modules/video_capture/windows/device_info_ds.cc index 3731dce8bc..455501fb07 100644 --- a/modules/video_capture/windows/device_info_ds.cc +++ b/modules/video_capture/windows/device_info_ds.cc @@ -10,7 +10,6 @@ #include "modules/video_capture/windows/device_info_ds.h" -#include #include #include "modules/video_capture/video_capture_config.h" diff --git a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc index a994193031..51315fc900 100644 --- a/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc +++ b/modules/video_coding/codecs/vp8/libvpx_vp8_encoder.cc @@ -10,7 +10,6 @@ #include "modules/video_coding/codecs/vp8/libvpx_vp8_encoder.h" -#include #include #include diff --git a/modules/video_coding/codecs/vp9/include/vp9_globals.h b/modules/video_coding/codecs/vp9/include/vp9_globals.h index 34aa0bc6cf..840d63ec0f 100644 --- a/modules/video_coding/codecs/vp9/include/vp9_globals.h +++ b/modules/video_coding/codecs/vp9/include/vp9_globals.h @@ -14,7 +14,6 @@ #ifndef MODULES_VIDEO_CODING_CODECS_VP9_INCLUDE_VP9_GLOBALS_H_ #define MODULES_VIDEO_CODING_CODECS_VP9_INCLUDE_VP9_GLOBALS_H_ -#include #include #include "modules/video_coding/codecs/interface/common_constants.h" diff --git a/modules/video_coding/frame_buffer.cc b/modules/video_coding/frame_buffer.cc index 8f73e73bad..937534aab0 100644 --- a/modules/video_coding/frame_buffer.cc +++ b/modules/video_coding/frame_buffer.cc @@ -10,7 +10,6 @@ #include "modules/video_coding/frame_buffer.h" -#include #include #include "api/video/encoded_image.h" diff --git a/modules/video_coding/jitter_buffer.cc b/modules/video_coding/jitter_buffer.cc index 75142e93ee..2352a79d17 100644 --- a/modules/video_coding/jitter_buffer.cc +++ b/modules/video_coding/jitter_buffer.cc @@ -9,7 +9,6 @@ */ #include "modules/video_coding/jitter_buffer.h" -#include #include #include diff --git a/modules/video_coding/jitter_estimator.cc b/modules/video_coding/jitter_estimator.cc index 92a298c259..89cf51fe46 100644 --- a/modules/video_coding/jitter_estimator.cc +++ b/modules/video_coding/jitter_estimator.cc @@ -10,7 +10,6 @@ #include "modules/video_coding/jitter_estimator.h" -#include #include #include diff --git a/modules/video_coding/media_opt_util.cc b/modules/video_coding/media_opt_util.cc index 0136ae8ec9..01fc5fbeae 100644 --- a/modules/video_coding/media_opt_util.cc +++ b/modules/video_coding/media_opt_util.cc @@ -10,7 +10,6 @@ #include "modules/video_coding/media_opt_util.h" -#include #include #include diff --git a/modules/video_coding/receiver.cc b/modules/video_coding/receiver.cc index 6b942fbe57..544dd237b6 100644 --- a/modules/video_coding/receiver.cc +++ b/modules/video_coding/receiver.cc @@ -10,7 +10,6 @@ #include "modules/video_coding/receiver.h" -#include #include #include diff --git a/modules/video_coding/session_info.cc b/modules/video_coding/session_info.cc index 477bbbe209..150fc77c71 100644 --- a/modules/video_coding/session_info.cc +++ b/modules/video_coding/session_info.cc @@ -10,7 +10,6 @@ #include "modules/video_coding/session_info.h" -#include #include #include diff --git a/modules/video_coding/timing.cc b/modules/video_coding/timing.cc index e811925c6c..748013cf47 100644 --- a/modules/video_coding/timing.cc +++ b/modules/video_coding/timing.cc @@ -10,7 +10,6 @@ #include "modules/video_coding/timing.h" -#include #include diff --git a/rtc_base/third_party/base64/base64.cc b/rtc_base/third_party/base64/base64.cc index b9acf9a4c9..7e30b0eb34 100644 --- a/rtc_base/third_party/base64/base64.cc +++ b/rtc_base/third_party/base64/base64.cc @@ -16,7 +16,6 @@ #include "rtc_base/third_party/base64/base64.h" -#include #include #include "rtc_base/checks.h" diff --git a/test/field_trial.cc b/test/field_trial.cc index 80fee0c427..c40fcc36c1 100644 --- a/test/field_trial.cc +++ b/test/field_trial.cc @@ -11,7 +11,6 @@ #include "test/field_trial.h" #include -#include #include #include #include diff --git a/test/frame_generator_unittest.cc b/test/frame_generator_unittest.cc index 8e5cde8c5f..bcb30b978f 100644 --- a/test/frame_generator_unittest.cc +++ b/test/frame_generator_unittest.cc @@ -10,7 +10,6 @@ #include "test/frame_generator.h" -#include #include #include diff --git a/test/linux/glx_renderer.cc b/test/linux/glx_renderer.cc index 04d482c88b..509a6c286e 100644 --- a/test/linux/glx_renderer.cc +++ b/test/linux/glx_renderer.cc @@ -12,7 +12,6 @@ #include #include -#include #include namespace webrtc { diff --git a/test/rtp_file_reader.cc b/test/rtp_file_reader.cc index 203cbdfeed..b3d0742bf8 100644 --- a/test/rtp_file_reader.cc +++ b/test/rtp_file_reader.cc @@ -10,7 +10,6 @@ #include "test/rtp_file_reader.h" -#include #include #include diff --git a/test/testsupport/file_utils.cc b/test/testsupport/file_utils.cc index 1f829d320b..c66f67cfa2 100644 --- a/test/testsupport/file_utils.cc +++ b/test/testsupport/file_utils.cc @@ -10,7 +10,6 @@ #include "test/testsupport/file_utils.h" -#include #if defined(WEBRTC_POSIX) #include From 96dca920468c2d8fbaa7b1bfde4958f26c7e05af Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Sat, 10 Jul 2021 22:37:40 +0200 Subject: [PATCH 0066/1565] [sigslot] - Remove sigslot from JsepTransport. Bug: webrtc:11943 Change-Id: I59231cf0d5b700d0ef2feb94d9619b8b4d30d655 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225552 Reviewed-by: Harald Alvestrand Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34529} --- pc/jsep_transport.cc | 11 +++++++---- pc/jsep_transport.h | 19 ++++++++++--------- pc/jsep_transport_controller.cc | 7 ++++--- pc/jsep_transport_unittest.cc | 5 ++--- 4 files changed, 23 insertions(+), 19 deletions(-) diff --git a/pc/jsep_transport.cc b/pc/jsep_transport.cc index e72088885f..f0a062eaaa 100644 --- a/pc/jsep_transport.cc +++ b/pc/jsep_transport.cc @@ -13,8 +13,9 @@ #include #include +#include #include -#include // for std::pair +#include #include "api/array_view.h" #include "api/candidate.h" @@ -80,7 +81,8 @@ JsepTransport::JsepTransport( std::unique_ptr dtls_srtp_transport, std::unique_ptr rtp_dtls_transport, std::unique_ptr rtcp_dtls_transport, - std::unique_ptr sctp_transport) + std::unique_ptr sctp_transport, + std::function rtcp_mux_active_callback) : network_thread_(rtc::Thread::Current()), mid_(mid), local_certificate_(local_certificate), @@ -104,7 +106,8 @@ JsepTransport::JsepTransport( sctp_transport_(sctp_transport ? rtc::make_ref_counted( std::move(sctp_transport)) - : nullptr) { + : nullptr), + rtcp_mux_active_callback_(std::move(rtcp_mux_active_callback)) { TRACE_EVENT0("webrtc", "JsepTransport::JsepTransport"); RTC_DCHECK(ice_transport_); RTC_DCHECK(rtp_dtls_transport_); @@ -487,7 +490,7 @@ void JsepTransport::ActivateRtcpMux() { } rtcp_dtls_transport_ = nullptr; // Destroy this reference. // Notify the JsepTransportController to update the aggregate states. - SignalRtcpMuxActive(); + rtcp_mux_active_callback_(); } bool JsepTransport::SetSdes(const std::vector& cryptos, diff --git a/pc/jsep_transport.h b/pc/jsep_transport.h index 5e8cae0ecf..fe6f5829e1 100644 --- a/pc/jsep_transport.h +++ b/pc/jsep_transport.h @@ -11,6 +11,7 @@ #ifndef PC_JSEP_TRANSPORT_H_ #define PC_JSEP_TRANSPORT_H_ +#include #include #include #include @@ -47,7 +48,6 @@ #include "rtc_base/rtc_certificate.h" #include "rtc_base/ssl_fingerprint.h" #include "rtc_base/ssl_stream_adapter.h" -#include "rtc_base/third_party/sigslot/sigslot.h" #include "rtc_base/thread.h" #include "rtc_base/thread_annotations.h" @@ -86,7 +86,7 @@ struct JsepTransportDescription { // // On Threading: JsepTransport performs work solely on the network thread, and // so its methods should only be called on the network thread. -class JsepTransport : public sigslot::has_slots<> { +class JsepTransport { public: // |mid| is just used for log statements in order to identify the Transport. // Note that |local_certificate| is allowed to be null since a remote @@ -101,9 +101,10 @@ class JsepTransport : public sigslot::has_slots<> { std::unique_ptr dtls_srtp_transport, std::unique_ptr rtp_dtls_transport, std::unique_ptr rtcp_dtls_transport, - std::unique_ptr sctp_transport); + std::unique_ptr sctp_transport, + std::function rtcp_mux_active_callback); - ~JsepTransport() override; + ~JsepTransport(); // Returns the MID of this transport. This is only used for logging. const std::string& mid() const { return mid_; } @@ -226,11 +227,6 @@ class JsepTransport : public sigslot::has_slots<> { return nullptr; } - // This is signaled when RTCP-mux becomes active and - // |rtcp_dtls_transport_| is destroyed. The JsepTransportController will - // handle the signal and update the aggregate transport states. - sigslot::signal<> SignalRtcpMuxActive; - // TODO(deadbeef): The methods below are only public for testing. Should make // them utility functions or objects so they can be tested independently from // this class. @@ -326,6 +322,11 @@ class JsepTransport : public sigslot::has_slots<> { absl::optional> recv_extension_ids_ RTC_GUARDED_BY(network_thread_); + // This is invoked when RTCP-mux becomes active and + // |rtcp_dtls_transport_| is destroyed. The JsepTransportController will + // receive the callback and update the aggregate transport states. + std::function rtcp_mux_active_callback_; + RTC_DISALLOW_COPY_AND_ASSIGN(JsepTransport); }; diff --git a/pc/jsep_transport_controller.cc b/pc/jsep_transport_controller.cc index 95cf21587d..47fddd4e3e 100644 --- a/pc/jsep_transport_controller.cc +++ b/pc/jsep_transport_controller.cc @@ -1056,13 +1056,14 @@ RTCError JsepTransportController::MaybeCreateJsepTransport( content_info.name, certificate_, std::move(ice), std::move(rtcp_ice), std::move(unencrypted_rtp_transport), std::move(sdes_transport), std::move(dtls_srtp_transport), std::move(rtp_dtls_transport), - std::move(rtcp_dtls_transport), std::move(sctp_transport)); + std::move(rtcp_dtls_transport), std::move(sctp_transport), [&]() { + RTC_DCHECK_RUN_ON(network_thread_); + UpdateAggregateStates_n(); + }); jsep_transport->rtp_transport()->SignalRtcpPacketReceived.connect( this, &JsepTransportController::OnRtcpPacketReceived_n); - jsep_transport->SignalRtcpMuxActive.connect( - this, &JsepTransportController::UpdateAggregateStates_n); transports_.RegisterTransport(content_info.name, std::move(jsep_transport)); UpdateAggregateStates_n(); return RTCError::OK(); diff --git a/pc/jsep_transport_unittest.cc b/pc/jsep_transport_unittest.cc index 5f4334068a..ffca560cdd 100644 --- a/pc/jsep_transport_unittest.cc +++ b/pc/jsep_transport_unittest.cc @@ -118,11 +118,10 @@ class JsepTransport2Test : public ::testing::Test, public sigslot::has_slots<> { std::move(rtcp_ice), std::move(unencrypted_rtp_transport), std::move(sdes_transport), std::move(dtls_srtp_transport), std::move(rtp_dtls_transport), std::move(rtcp_dtls_transport), - /*sctp_transport=*/nullptr); + /*sctp_transport=*/nullptr, + /*rtcp_mux_active_callback=*/[&]() { OnRtcpMuxActive(); }); signal_rtcp_mux_active_received_ = false; - jsep_transport->SignalRtcpMuxActive.connect( - this, &JsepTransport2Test::OnRtcpMuxActive); return jsep_transport; } From cb42e108047d7d7c977ecd652db124da22311c5f Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Thu, 15 Jul 2021 14:09:40 +0900 Subject: [PATCH 0067/1565] Make the JsepSessionDescription clone() method work for the rollback type. Because clone() method didn't work for rollback type, rollback using SLD/SRD was broken in iOS SDK after https://webrtc-review.googlesource.com/c/src/+/209700. Fixed: webrtc:12912 Change-Id: I84a1fe7b682b2a73657d2fa121e8e529bce219b3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226160 Reviewed-by: Harald Alvestrand Commit-Queue: Byoungchan Lee Cr-Commit-Position: refs/heads/master@{#34530} --- pc/jsep_session_description.cc | 4 +++- pc/jsep_session_description_unittest.cc | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pc/jsep_session_description.cc b/pc/jsep_session_description.cc index 9de81947de..ccba75bc28 100644 --- a/pc/jsep_session_description.cc +++ b/pc/jsep_session_description.cc @@ -220,7 +220,9 @@ std::unique_ptr JsepSessionDescription::Clone() auto new_description = std::make_unique(type_); new_description->session_id_ = session_id_; new_description->session_version_ = session_version_; - new_description->description_ = description_->Clone(); + if (description_) { + new_description->description_ = description_->Clone(); + } for (const auto& collection : candidate_collection_) { new_description->candidate_collection_.push_back(collection.Clone()); } diff --git a/pc/jsep_session_description_unittest.cc b/pc/jsep_session_description_unittest.cc index d922a586c5..2202aa81d0 100644 --- a/pc/jsep_session_description_unittest.cc +++ b/pc/jsep_session_description_unittest.cc @@ -129,6 +129,12 @@ TEST_F(JsepSessionDescriptionTest, CloneDefault) { EXPECT_EQ(jsep_desc_->session_version(), new_desc->session_version()); } +TEST_F(JsepSessionDescriptionTest, CloneRollback) { + auto jsep_desc = std::make_unique(SdpType::kRollback); + auto new_desc = jsep_desc->Clone(); + EXPECT_EQ(jsep_desc->type(), new_desc->type()); +} + TEST_F(JsepSessionDescriptionTest, CloneWithCandidates) { cricket::Candidate candidate_v4( cricket::ICE_CANDIDATE_COMPONENT_RTP, "udp", From b0ed12099f6320837a519ea3d6ef9154b9996955 Mon Sep 17 00:00:00 2001 From: Tony Herre Date: Thu, 22 Jul 2021 15:40:44 +0000 Subject: [PATCH 0068/1565] Update links to point at main branch As part of go/coil update code search links to not point to the "master" branch. Bug: chromium:1226942 Change-Id: I0ae9e84ecc660f789a69fe0b226f93bbc39a8a66 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226081 Commit-Queue: Tony Herre Reviewed-by: Harald Alvestrand Cr-Commit-Position: refs/heads/master@{#34531} --- .vpython | 4 +- api/g3doc/index.md | 2 +- docs/native-code/ios/index.md | 2 +- g3doc/style-guide.md | 2 +- logging/g3doc/rtc_event_log.md | 2 +- modules/audio_coding/g3doc/index.md | 14 ++-- modules/audio_coding/neteq/g3doc/index.md | 18 ++--- .../audio_device/g3doc/audio_device_module.md | 74 +++++++++---------- modules/audio_mixer/g3doc/index.md | 8 +- .../g3doc/audio_processing_module.md | 4 +- modules/pacing/g3doc/index.md | 14 ++-- modules/video_coding/g3doc/index.md | 40 +++++----- net/dcsctp/public/strong_alias.h | 2 +- net/dcsctp/public/strong_alias_test.cc | 2 +- p2p/g3doc/ice.md | 40 +++++----- pc/g3doc/dtls_transport.md | 12 +-- pc/g3doc/sctp_transport.md | 6 +- test/pc/e2e/g3doc/architecture.md | 46 ++++++------ test/pc/e2e/g3doc/index.md | 22 +++--- video/g3doc/adaptation.md | 26 +++---- video/g3doc/stats.md | 14 ++-- 21 files changed, 177 insertions(+), 177 deletions(-) diff --git a/.vpython b/.vpython index df838dccf8..a57f82ff3e 100644 --- a/.vpython +++ b/.vpython @@ -9,7 +9,7 @@ # CIPD (the "Chrome Infrastructure Package Deployer" service). Unlike `pip`, # this never requires the end-user machine to have a working python extension # compilation environment. All of these packages are built using: -# https://chromium.googlesource.com/infra/infra/+/master/infra/tools/dockerbuild/ +# https://chromium.googlesource.com/infra/infra/+/main/infra/tools/dockerbuild/ # # All python scripts in the repo share this same spec, to avoid dependency # fragmentation. @@ -20,7 +20,7 @@ # vpython path/to/script.py some --arguments # # Read more about `vpython` and how to modify this file here: -# https://chromium.googlesource.com/infra/infra/+/master/doc/users/vpython.md +# https://chromium.googlesource.com/infra/infra/+/main/doc/users/vpython.md python_version: "2.7" diff --git a/api/g3doc/index.md b/api/g3doc/index.md index 49637d191a..0c7136c039 100644 --- a/api/g3doc/index.md +++ b/api/g3doc/index.md @@ -15,7 +15,7 @@ some basic concepts, such as: ## Using WebRTC through the PeerConnection class The -[PeerConnectionInterface](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/peer_connection_interface.h?q=webrtc::PeerConnectionInterface) +[PeerConnectionInterface](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/peer_connection_interface.h?q=webrtc::PeerConnectionInterface) class is the recommended way to use the WebRTC library. It is closely modeled after the Javascript API documented in the [WebRTC diff --git a/docs/native-code/ios/index.md b/docs/native-code/ios/index.md index d04692714e..e95f967bf9 100644 --- a/docs/native-code/ios/index.md +++ b/docs/native-code/ios/index.md @@ -189,6 +189,6 @@ For instructions on how to do this see [here][strip-arch]. [webrtc-development]: https://webrtc.googlesource.com/src/+/main/docs/native-code/development/index.md [framework-script]: https://webrtc.googlesource.com/src/+/main/tools_webrtc/ios/build_ios_libs.py [ninja]: https://ninja-build.org/ -[gn]: https://gn.googlesource.com/gn/+/master/README.md +[gn]: https://gn.googlesource.com/gn/+/main/README.md [ios-deploy]: https://github.com/phonegap/ios-deploy [strip-arch]: http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/ diff --git a/g3doc/style-guide.md b/g3doc/style-guide.md index e6195d7249..06f8e0e0ae 100644 --- a/g3doc/style-guide.md +++ b/g3doc/style-guide.md @@ -108,7 +108,7 @@ In other words, rename the existing function, and provide an inline wrapper using the original name that calls it. That way, callers who are willing to call it using the `DEPRECATED_`-prefixed name don't get the warning. -[ABSL_DEPRECATED]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/abseil-cpp/absl/base/attributes.h?q=ABSL_DEPRECATED +[ABSL_DEPRECATED]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/abseil-cpp/absl/base/attributes.h?q=ABSL_DEPRECATED ### ArrayView diff --git a/logging/g3doc/rtc_event_log.md b/logging/g3doc/rtc_event_log.md index c7996e0b42..6b81de1066 100644 --- a/logging/g3doc/rtc_event_log.md +++ b/logging/g3doc/rtc_event_log.md @@ -25,7 +25,7 @@ The contents include: No guarantees are made on the wire format, and the format may change without prior notice. To maintain compatibility with past and future formats, analysis tools should be built on top of the provided -[rtc_event_log_parser.h](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/logging/rtc_event_log/rtc_event_log_parser.h) +[rtc_event_log_parser.h](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/logging/rtc_event_log/rtc_event_log_parser.h) In particular, an analysis tool should *not* read the log as a protobuf. diff --git a/modules/audio_coding/g3doc/index.md b/modules/audio_coding/g3doc/index.md index bf50c155fc..d0f6b9f81b 100644 --- a/modules/audio_coding/g3doc/index.md +++ b/modules/audio_coding/g3doc/index.md @@ -23,10 +23,10 @@ WebRTC audio coding module can handle both audio sending and receiving. Folder Audio decoders are provided by an audio decoder factory. Decoded audio samples should be queried by calling [`PlayoutData10Ms()`][PlayoutData10Ms]. -[acm2]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_coding/acm2/;drc=854d59f7501aac9e9bccfa7b4d1f7f4db7842719 -[Add10MsData]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_coding/include/audio_coding_module.h;l=136;drc=d82a02c837d33cdfd75121e40dcccd32515e42d6 -[codecs]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_coding/codecs/;drc=883fea1548d58e0080f98d66fab2e0c744dfb556 -[ANA]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_coding/audio_network_adaptor/;drc=1f99551775cd876c116d1d90cba94c8a4670d184 -[IncomingPacket]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_coding/include/audio_coding_module.h;l=192;drc=d82a02c837d33cdfd75121e40dcccd32515e42d6 -[NetEq]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_coding/neteq/;drc=213dc2cfc5f1b360b1c6fc51d393491f5de49d3d -[PlayoutData10Ms]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_coding/include/audio_coding_module.h;l=216;drc=d82a02c837d33cdfd75121e40dcccd32515e42d6 +[acm2]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_coding/acm2/;drc=854d59f7501aac9e9bccfa7b4d1f7f4db7842719 +[Add10MsData]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_coding/include/audio_coding_module.h;l=136;drc=d82a02c837d33cdfd75121e40dcccd32515e42d6 +[codecs]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_coding/codecs/;drc=883fea1548d58e0080f98d66fab2e0c744dfb556 +[ANA]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_coding/audio_network_adaptor/;drc=1f99551775cd876c116d1d90cba94c8a4670d184 +[IncomingPacket]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_coding/include/audio_coding_module.h;l=192;drc=d82a02c837d33cdfd75121e40dcccd32515e42d6 +[NetEq]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_coding/neteq/;drc=213dc2cfc5f1b360b1c6fc51d393491f5de49d3d +[PlayoutData10Ms]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_coding/include/audio_coding_module.h;l=216;drc=d82a02c837d33cdfd75121e40dcccd32515e42d6 diff --git a/modules/audio_coding/neteq/g3doc/index.md b/modules/audio_coding/neteq/g3doc/index.md index d0624f46ef..e97324d89d 100644 --- a/modules/audio_coding/neteq/g3doc/index.md +++ b/modules/audio_coding/neteq/g3doc/index.md @@ -13,13 +13,13 @@ time keep the delay as low as possible. ## API At a high level, the NetEq API has two main functions: -[`InsertPacket`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/neteq/neteq.h;l=198;drc=4461f059d180fe8c2886d422ebd1cb55b5c83e72) +[`InsertPacket`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/neteq/neteq.h;l=198;drc=4461f059d180fe8c2886d422ebd1cb55b5c83e72) and -[`GetAudio`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/neteq/neteq.h;l=219;drc=4461f059d180fe8c2886d422ebd1cb55b5c83e72). +[`GetAudio`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/neteq/neteq.h;l=219;drc=4461f059d180fe8c2886d422ebd1cb55b5c83e72). ### InsertPacket -[`InsertPacket`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/neteq/neteq.h;l=198;drc=4461f059d180fe8c2886d422ebd1cb55b5c83e72) +[`InsertPacket`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/neteq/neteq.h;l=198;drc=4461f059d180fe8c2886d422ebd1cb55b5c83e72) delivers an RTP packet from the network to NetEq where the following happens: 1. The packet is discarded if it is too late for playout (for example if it was @@ -33,7 +33,7 @@ delivers an RTP packet from the network to NetEq where the following happens: ### GetAudio -[`GetAudio`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/neteq/neteq.h;l=219;drc=4461f059d180fe8c2886d422ebd1cb55b5c83e72) +[`GetAudio`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/neteq/neteq.h;l=219;drc=4461f059d180fe8c2886d422ebd1cb55b5c83e72) pulls 10 ms of audio from NetEq for playout. A much simplified decision logic is as follows: @@ -68,23 +68,23 @@ There are a number of functions that can be used to query the internal state of NetEq, statistics about the type of audio output and latency metrics such as how long time packets have waited in the buffer. -* [`NetworkStatistics`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/neteq/neteq.h;l=273;drc=4461f059d180fe8c2886d422ebd1cb55b5c83e72): +* [`NetworkStatistics`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/neteq/neteq.h;l=273;drc=4461f059d180fe8c2886d422ebd1cb55b5c83e72): instantaneous values or stats averaged over the duration since last call to this function. -* [`GetLifetimeStatistics`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/neteq/neteq.h;l=280;drc=4461f059d180fe8c2886d422ebd1cb55b5c83e72): +* [`GetLifetimeStatistics`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/neteq/neteq.h;l=280;drc=4461f059d180fe8c2886d422ebd1cb55b5c83e72): cumulative stats that persist over the lifetime of the class. -* [`GetOperationsAndState`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/neteq/neteq.h;l=284;drc=4461f059d180fe8c2886d422ebd1cb55b5c83e72): +* [`GetOperationsAndState`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/neteq/neteq.h;l=284;drc=4461f059d180fe8c2886d422ebd1cb55b5c83e72): information about the internal state of NetEq (is only inteded to be used for testing and debugging). ## Tests and tools -* [`neteq_rtpplay`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc;drc=cee751abff598fc19506f77de08bea7c61b9dcca): +* [`neteq_rtpplay`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc;drc=cee751abff598fc19506f77de08bea7c61b9dcca): Simulate NetEq behavior based on either an RTP dump, a PCAP file or an RTC event log. A replacement audio file can also be used instead of the original payload. Outputs aggregated statistics and optionally an audio file to listen to. -* [`neteq_speed_test`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_coding/neteq/test/neteq_speed_test.cc;drc=2ab97f6f8e27b47c0d9beeb8b6ca5387bda9f55c): +* [`neteq_speed_test`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_coding/neteq/test/neteq_speed_test.cc;drc=2ab97f6f8e27b47c0d9beeb8b6ca5387bda9f55c): Measure performance of NetEq, used on perf bots. * Unit tests including bit exactness tests where RTP file is used as an input to NetEq, the output is concatenated and a checksum is calculated and diff --git a/modules/audio_device/g3doc/audio_device_module.md b/modules/audio_device/g3doc/audio_device_module.md index fb88b6971a..101b2e4cc8 100644 --- a/modules/audio_device/g3doc/audio_device_module.md +++ b/modules/audio_device/g3doc/audio_device_module.md @@ -132,40 +132,40 @@ Finally, the corresponding stop methods [`AudiDeviceModule::StopRecording`][35] and [`AudiDeviceModule::StopPlayout`][36] are called followed by [`AudiDeviceModule::Terminate`][37]. -[1]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/media/engine/webrtc_voice_engine.cc;l=314;drc=f7b1b95f11c74cb5369fdd528b73c70a50f2e206 -[2]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/media/engine/webrtc_voice_engine.h;l=48;drc=d15a575ec3528c252419149d35977e55269d8a41 -[3]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/audio_device_unittest.cc;l=1;drc=d15a575ec3528c252419149d35977e55269d8a41 -[4]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=46;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738e -[5]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/media/engine/adm_helpers.h;drc=2222a80e79ae1ef5cb9510ec51d3868be75f47a2 -[6]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=62;drc=9438fb3fff97c803d1ead34c0e4f223db168526f -[7]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=77;drc=9438fb3fff97c803d1ead34c0e4f223db168526f -[8]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=69;drc=9438fb3fff97c803d1ead34c0e4f223db168526f -[9]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=79;drc=9438fb3fff97c803d1ead34c0e4f223db168526f -[10]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=72;drc=9438fb3fff97c803d1ead34c0e4f223db168526f -[11]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=99;drc=9438fb3fff97c803d1ead34c0e4f223db168526f -[12]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=101;drc=9438fb3fff97c803d1ead34c0e4f223db168526f -[13]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=130;drc=9438fb3fff97c803d1ead34c0e4f223db168526f -[14]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=133;drc=9438fb3fff97c803d1ead34c0e4f223db168526f -[15]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=59;drc=9438fb3fff97c803d1ead34c0e4f223db168526f -[16]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device_defines.h;l=34;drc=9438fb3fff97c803d1ead34c0e4f223db168526f -[17]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device_defines.h;l=36;drc=9438fb3fff97c803d1ead34c0e4f223db168526f -[18]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device_defines.h;l=48;drc=9438fb3fff97c803d1ead34c0e4f223db168526f -[19]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738es -[20]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/sdk/objc/native/api/audio_device_module.h;drc=76443eafa9375374d9f1d23da2b913f2acac6ac2 -[21]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/sdk/android/src/jni/audio_device/audio_device_module.h;drc=bbeb10925eb106eeed6143ccf571bc438ec22ce1 -[22]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/linux/;drc=d15a575ec3528c252419149d35977e55269d8a41 -[23]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/win/;drc=d15a575ec3528c252419149d35977e55269d8a41 -[24]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/mac/;drc=3b68aa346a5d3483c3448852d19d91723846825c -[25]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/create_peerconnection_factory.h;l=45;drc=09ceed2165137c4bea4e02e8d3db31970d0bf273 -[26]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/pc/peer_connection_interface_unittest.cc;l=692;drc=2efb8a5ec61b1b87475d046c03d20244f53b14b6 -[27]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/sdk/objc/native/api/audio_device_module.h;drc=76443eafa9375374d9f1d23da2b913f2acac6ac2 -[28]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/sdk/android/src/jni/audio_device/audio_device_module.h;drc=bbeb10925eb106eeed6143ccf571bc438ec22ce1 -[29]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/pc/test/fake_audio_capture_module.h;l=42;drc=d15a575ec3528c252419149d35977e55269d8a41 -[30]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/audio/audio_state.h;drc=d15a575ec3528c252419149d35977e55269d8a41 -[31]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=87;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738e -[32]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=94;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738e -[33]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=84;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738e -[34]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=91;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738e -[35]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=95;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738e -[36]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=92;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738e -[37]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_device/include/audio_device.h;l=63;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738e +[1]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/media/engine/webrtc_voice_engine.cc;l=314;drc=f7b1b95f11c74cb5369fdd528b73c70a50f2e206 +[2]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/media/engine/webrtc_voice_engine.h;l=48;drc=d15a575ec3528c252419149d35977e55269d8a41 +[3]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/audio_device_unittest.cc;l=1;drc=d15a575ec3528c252419149d35977e55269d8a41 +[4]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=46;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738e +[5]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/media/engine/adm_helpers.h;drc=2222a80e79ae1ef5cb9510ec51d3868be75f47a2 +[6]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=62;drc=9438fb3fff97c803d1ead34c0e4f223db168526f +[7]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=77;drc=9438fb3fff97c803d1ead34c0e4f223db168526f +[8]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=69;drc=9438fb3fff97c803d1ead34c0e4f223db168526f +[9]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=79;drc=9438fb3fff97c803d1ead34c0e4f223db168526f +[10]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=72;drc=9438fb3fff97c803d1ead34c0e4f223db168526f +[11]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=99;drc=9438fb3fff97c803d1ead34c0e4f223db168526f +[12]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=101;drc=9438fb3fff97c803d1ead34c0e4f223db168526f +[13]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=130;drc=9438fb3fff97c803d1ead34c0e4f223db168526f +[14]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=133;drc=9438fb3fff97c803d1ead34c0e4f223db168526f +[15]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=59;drc=9438fb3fff97c803d1ead34c0e4f223db168526f +[16]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device_defines.h;l=34;drc=9438fb3fff97c803d1ead34c0e4f223db168526f +[17]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device_defines.h;l=36;drc=9438fb3fff97c803d1ead34c0e4f223db168526f +[18]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device_defines.h;l=48;drc=9438fb3fff97c803d1ead34c0e4f223db168526f +[19]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738es +[20]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/sdk/objc/native/api/audio_device_module.h;drc=76443eafa9375374d9f1d23da2b913f2acac6ac2 +[21]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/sdk/android/src/jni/audio_device/audio_device_module.h;drc=bbeb10925eb106eeed6143ccf571bc438ec22ce1 +[22]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/linux/;drc=d15a575ec3528c252419149d35977e55269d8a41 +[23]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/win/;drc=d15a575ec3528c252419149d35977e55269d8a41 +[24]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/mac/;drc=3b68aa346a5d3483c3448852d19d91723846825c +[25]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/create_peerconnection_factory.h;l=45;drc=09ceed2165137c4bea4e02e8d3db31970d0bf273 +[26]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/pc/peer_connection_interface_unittest.cc;l=692;drc=2efb8a5ec61b1b87475d046c03d20244f53b14b6 +[27]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/sdk/objc/native/api/audio_device_module.h;drc=76443eafa9375374d9f1d23da2b913f2acac6ac2 +[28]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/sdk/android/src/jni/audio_device/audio_device_module.h;drc=bbeb10925eb106eeed6143ccf571bc438ec22ce1 +[29]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/pc/test/fake_audio_capture_module.h;l=42;drc=d15a575ec3528c252419149d35977e55269d8a41 +[30]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/audio/audio_state.h;drc=d15a575ec3528c252419149d35977e55269d8a41 +[31]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=87;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738e +[32]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=94;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738e +[33]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=84;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738e +[34]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=91;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738e +[35]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=95;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738e +[36]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=92;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738e +[37]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_device/include/audio_device.h;l=63;drc=eb8c4ca608486add9800f6bfb7a8ba3cf23e738e diff --git a/modules/audio_mixer/g3doc/index.md b/modules/audio_mixer/g3doc/index.md index 285530e95a..4ced289bf8 100644 --- a/modules/audio_mixer/g3doc/index.md +++ b/modules/audio_mixer/g3doc/index.md @@ -7,7 +7,7 @@ The WebRTC audio mixer module is responsible for mixing multiple incoming audio streams (sources) into a single audio stream (mix). It works with 10 ms frames, it supports sample rates up to 48 kHz and up to 8 audio channels. The API is defined in -[`api/audio/audio_mixer.h`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/audio/audio_mixer.h) +[`api/audio/audio_mixer.h`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/audio/audio_mixer.h) and it includes the definition of [`AudioMixer::Source`](https://source.chromium.org/search?q=symbol:AudioMixer::Source%20file:third_party%2Fwebrtc%2Fapi%2Faudio%2Faudio_mixer.h), which describes an incoming audio stream, and the definition of @@ -39,9 +39,9 @@ method allows to generates a mix with the desired number of channels. The interface is implemented in different parts of WebRTC: * [`AudioMixer::Source`](https://source.chromium.org/search?q=symbol:AudioMixer::Source%20file:third_party%2Fwebrtc%2Fapi%2Faudio%2Faudio_mixer.h): - [`audio/audio_receive_stream.h`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/audio/audio_receive_stream.h) + [`audio/audio_receive_stream.h`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/audio/audio_receive_stream.h) * [`AudioMixer`](https://source.chromium.org/search?q=symbol:AudioMixer%20file:third_party%2Fwebrtc%2Fapi%2Faudio%2Faudio_mixer.h): - [`modules/audio_mixer/audio_mixer_impl.h`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_mixer/audio_mixer_impl.h) + [`modules/audio_mixer/audio_mixer_impl.h`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_mixer/audio_mixer_impl.h) [`AudioMixer`](https://source.chromium.org/search?q=symbol:AudioMixer%20file:third_party%2Fwebrtc%2Fapi%2Faudio%2Faudio_mixer.h) is thread-safe. The output sample rate of the generated mix is automatically @@ -49,6 +49,6 @@ assigned depending on the sample rate of the sources; whereas the number of output channels is defined by the caller[^2]. Samples from the non-muted sources are summed up and then a limiter is used to apply soft-clipping when needed. -[^2]: [`audio/utility/channel_mixer.h`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/audio/utility/channel_mixer.h) +[^2]: [`audio/utility/channel_mixer.h`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/audio/utility/channel_mixer.h) is used to mix channels in the non-trivial cases - i.e., if the number of channels for a source or the mix is greater than 3. diff --git a/modules/audio_processing/g3doc/audio_processing_module.md b/modules/audio_processing/g3doc/audio_processing_module.md index bb80dc9882..fc63b34dfe 100644 --- a/modules/audio_processing/g3doc/audio_processing_module.md +++ b/modules/audio_processing/g3doc/audio_processing_module.md @@ -10,8 +10,8 @@ microphone signal. These effects are required for VoIP calling and some examples include echo cancellation (AEC), noise suppression (NS) and automatic gain control (AGC). -The API for APM resides in [`/modules/audio_processing/include`][https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_processing/include]. -APM is created using the [`AudioProcessingBuilder`][https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/audio_processing/include/audio_processing.h] +The API for APM resides in [`/modules/audio_processing/include`][https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_processing/include]. +APM is created using the [`AudioProcessingBuilder`][https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/audio_processing/include/audio_processing.h] builder that allows it to be customized and configured. Some specific aspects of APM include that: diff --git a/modules/pacing/g3doc/index.md b/modules/pacing/g3doc/index.md index 4187a8bd9b..c06fdc8b4f 100644 --- a/modules/pacing/g3doc/index.md +++ b/modules/pacing/g3doc/index.md @@ -160,10 +160,10 @@ Several methods are used to gather statistics in pacer state: * `FirstSentPacketTime()` absolute time the first packet was sent. * `ExpectedQueueTime()` total bytes in the queue divided by the send rate. -[RTPSender]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/rtp_rtcp/source/rtp_sender.h;drc=77ee8542dd35d5143b5788ddf47fb7cdb96eb08e -[RtpPacketSender]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/rtp_rtcp/include/rtp_packet_sender.h;drc=ea55b0872f14faab23a4e5dbcb6956369c8ed5dc -[RtpPacketPacer]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/pacing/rtp_packet_pacer.h;drc=e7bc3a347760023dd4840cf6ebdd1e6c8592f4d7 -[PacketRouter]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/pacing/packet_router.h;drc=3d2210876e31d0bb5c7de88b27fd02ceb1f4e03e -[PacedSender]: https://source.chromium.org/chromium/chromium/src/+/master:media/cast/net/pacing/paced_sender.h;drc=df00acf8f3cea9a947e11dc687aa1147971a1883 -[TaskQueuePacedSender]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/pacing/task_queue_paced_sender.h;drc=5051693ada61bc7b78855c6fb3fa87a0394fa813 -[RoundRobinPacketQueue]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/pacing/round_robin_packet_queue.h;drc=b571ff48f8fe07678da5a854cd6c3f5dde02855f +[RTPSender]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/rtp_rtcp/source/rtp_sender.h;drc=77ee8542dd35d5143b5788ddf47fb7cdb96eb08e +[RtpPacketSender]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/rtp_rtcp/include/rtp_packet_sender.h;drc=ea55b0872f14faab23a4e5dbcb6956369c8ed5dc +[RtpPacketPacer]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/pacing/rtp_packet_pacer.h;drc=e7bc3a347760023dd4840cf6ebdd1e6c8592f4d7 +[PacketRouter]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/pacing/packet_router.h;drc=3d2210876e31d0bb5c7de88b27fd02ceb1f4e03e +[PacedSender]: https://source.chromium.org/chromium/chromium/src/+/main:media/cast/net/pacing/paced_sender.h;drc=df00acf8f3cea9a947e11dc687aa1147971a1883 +[TaskQueuePacedSender]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/pacing/task_queue_paced_sender.h;drc=5051693ada61bc7b78855c6fb3fa87a0394fa813 +[RoundRobinPacketQueue]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/pacing/round_robin_packet_queue.h;drc=b571ff48f8fe07678da5a854cd6c3f5dde02855f diff --git a/modules/video_coding/g3doc/index.md b/modules/video_coding/g3doc/index.md index 6fdab6eb98..2e5695b715 100644 --- a/modules/video_coding/g3doc/index.md +++ b/modules/video_coding/g3doc/index.md @@ -151,27 +151,27 @@ performance of different video codec implementations. [vp9-spec]: https://storage.googleapis.com/downloads.webmproject.org/docs/vp9/vp9-bitstream-specification-v0.6-20160331-draft.pdf [av1-spec]: https://aomediacodec.github.io/av1-spec/ [h264-spec]: https://www.itu.int/rec/T-REC-H.264-201906-I/en -[video-encoder-factory-interface]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/video_codecs/video_encoder_factory.h;l=27;drc=afadfb24a5e608da6ae102b20b0add53a083dcf3 -[video-decoder-factory-interface]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/video_codecs/video_decoder_factory.h;l=27;drc=49c293f03d8f593aa3aca282577fcb14daa63207 +[video-encoder-factory-interface]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/video_codecs/video_encoder_factory.h;l=27;drc=afadfb24a5e608da6ae102b20b0add53a083dcf3 +[video-decoder-factory-interface]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/video_codecs/video_decoder_factory.h;l=27;drc=49c293f03d8f593aa3aca282577fcb14daa63207 [scalability-structure-spec]: https://w3c.github.io/webrtc-svc/#scalabilitymodes* [fec-wiki]: https://en.wikipedia.org/wiki/Error_correction_code#Forward_error_correction [entropy-coding-wiki]: https://en.wikipedia.org/wiki/Entropy_encoding -[modules-video-coding]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/ -[modules-video-coding-codecs]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/codecs/ -[modules-video-coding-codecs-test]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/codecs/test/ -[modules-video-coding-svc]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/svc/ -[modules-video-coding-utility]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/utility/ -[scalabilitystructure]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/svc/create_scalability_structure.h?q=CreateScalabilityStructure -[scalablevideocontroller]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/svc/scalable_video_controller.h?q=ScalableVideoController -[svcrateallocator]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/svc/svc_rate_allocator.h?q=SvcRateAllocator -[framedropper]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/utility/frame_dropper.h?q=FrameDropper -[frameratecontroller]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/utility/framerate_controller.h?q=FramerateController -[qpparser]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/utility/qp_parser.h?q=QpParser -[qualityscaler]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/utility/quality_scaler.h?q=QualityScaler -[simulcastrateallocator]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/utility/simulcast_rate_allocator.h?q=SimulcastRateAllocator -[feccontrollerdefault]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/fec_controller_default.h?q=FecControllerDefault -[videocodecinitializer]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/include/video_codec_initializer.h?q=VideoCodecInitializer -[packetbuffer]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/packet_buffer.h?q=PacketBuffer -[rtpframereferencefinder]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/rtp_frame_reference_finder.h?q=RtpFrameReferenceFinder -[framebuffer]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/frame_buffer2.h?q=FrameBuffer +[modules-video-coding]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/ +[modules-video-coding-codecs]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/codecs/ +[modules-video-coding-codecs-test]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/codecs/test/ +[modules-video-coding-svc]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/svc/ +[modules-video-coding-utility]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/utility/ +[scalabilitystructure]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/svc/create_scalability_structure.h?q=CreateScalabilityStructure +[scalablevideocontroller]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/svc/scalable_video_controller.h?q=ScalableVideoController +[svcrateallocator]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/svc/svc_rate_allocator.h?q=SvcRateAllocator +[framedropper]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/utility/frame_dropper.h?q=FrameDropper +[frameratecontroller]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/utility/framerate_controller.h?q=FramerateController +[qpparser]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/utility/qp_parser.h?q=QpParser +[qualityscaler]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/utility/quality_scaler.h?q=QualityScaler +[simulcastrateallocator]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/utility/simulcast_rate_allocator.h?q=SimulcastRateAllocator +[feccontrollerdefault]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/fec_controller_default.h?q=FecControllerDefault +[videocodecinitializer]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/include/video_codec_initializer.h?q=VideoCodecInitializer +[packetbuffer]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/packet_buffer.h?q=PacketBuffer +[rtpframereferencefinder]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/rtp_frame_reference_finder.h?q=RtpFrameReferenceFinder +[framebuffer]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/frame_buffer2.h?q=FrameBuffer [quantization-wiki]: https://en.wikipedia.org/wiki/Quantization_(signal_processing) diff --git a/net/dcsctp/public/strong_alias.h b/net/dcsctp/public/strong_alias.h index 96678442b4..7aea362c57 100644 --- a/net/dcsctp/public/strong_alias.h +++ b/net/dcsctp/public/strong_alias.h @@ -17,7 +17,7 @@ namespace dcsctp { // This is a copy of -// https://source.chromium.org/chromium/chromium/src/+/master:base/types/strong_alias.h +// https://source.chromium.org/chromium/chromium/src/+/main:base/types/strong_alias.h // as the API (and internals) are using type-safe integral identifiers, but this // library can't depend on that file. The ostream operator has been removed // per WebRTC library conventions, and the underlying type is exposed. diff --git a/net/dcsctp/public/strong_alias_test.cc b/net/dcsctp/public/strong_alias_test.cc index 0c57c6b248..5c94881ec6 100644 --- a/net/dcsctp/public/strong_alias_test.cc +++ b/net/dcsctp/public/strong_alias_test.cc @@ -22,7 +22,7 @@ #include "test/gmock.h" // This is a copy of -// https://source.chromium.org/chromium/chromium/src/+/master:base/types/strong_alias_unittest.cc +// https://source.chromium.org/chromium/chromium/src/+/main:base/types/strong_alias_unittest.cc // but adapted to use WebRTC's includes, remove unit tests that test the ostream // operator (it's removed in this port) and other adaptations to pass lint. diff --git a/p2p/g3doc/ice.md b/p2p/g3doc/ice.md index be81ff9e22..eef979b0d4 100644 --- a/p2p/g3doc/ice.md +++ b/p2p/g3doc/ice.md @@ -12,31 +12,31 @@ server. This documentation provides an overview of how ICE is implemented, i.e how the following classes interact. -* [`cricket::IceTransportInternal`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/ice_transport_internal.h;l=225;drc=8cb97062880b0e0a78f9d578370a01aced81a13f) - +* [`cricket::IceTransportInternal`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/ice_transport_internal.h;l=225;drc=8cb97062880b0e0a78f9d578370a01aced81a13f) - is the interface that does ICE (manage ports, candidates, connections to send/receive packets). The interface is implemented by - [`cricket::P2PTransportChannel`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/p2p_transport_channel.h;l=103;drc=0ccfbd2de7bc3b237a0f8c30f48666c97b9e5523). + [`cricket::P2PTransportChannel`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/p2p_transport_channel.h;l=103;drc=0ccfbd2de7bc3b237a0f8c30f48666c97b9e5523). -* [`cricket::PortInterface`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/port_interface.h;l=47;drc=c3a486c41e682cce943f2b20fe987c9421d4b631) +* [`cricket::PortInterface`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/port_interface.h;l=47;drc=c3a486c41e682cce943f2b20fe987c9421d4b631) Represents a local communication mechanism that can be used to create connections to similar mechanisms of the other client. There are 4 implementations of `cricket::PortInterface` - [`cricket::UDPPort`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/stun_port.h;l=33;drc=a4d873786f10eedd72de25ad0d94ad7c53c1f68a), - [`cricket::StunPort`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/stun_port.h;l=265;drc=a4d873786f10eedd72de25ad0d94ad7c53c1f68a), - [`cricket::TcpPort`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/tcp_port.h;l=33;drc=7a284e1614a38286477ed2334ecbdde78e87b79c) + [`cricket::UDPPort`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/stun_port.h;l=33;drc=a4d873786f10eedd72de25ad0d94ad7c53c1f68a), + [`cricket::StunPort`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/stun_port.h;l=265;drc=a4d873786f10eedd72de25ad0d94ad7c53c1f68a), + [`cricket::TcpPort`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/tcp_port.h;l=33;drc=7a284e1614a38286477ed2334ecbdde78e87b79c) and - [`cricket::TurnPort`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/turn_port.h;l=44;drc=ffb7603b6025fbd6e79f360d293ab49092bded54). + [`cricket::TurnPort`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/turn_port.h;l=44;drc=ffb7603b6025fbd6e79f360d293ab49092bded54). The ports share lots of functionality in a base class, - [`cricket::Port`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/port.h;l=187;drc=3ba7beba29c4e542c4a9bffcc5a47d5e911865be). + [`cricket::Port`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/port.h;l=187;drc=3ba7beba29c4e542c4a9bffcc5a47d5e911865be). -* [`cricket::Candidate`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/candidate.h;l=30;drc=10542f21c8e4e2d60b136fab45338f2b1e132dde) +* [`cricket::Candidate`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/candidate.h;l=30;drc=10542f21c8e4e2d60b136fab45338f2b1e132dde) represents an address discovered by a `cricket::Port`. A candidate can be local (i.e discovered by a local port) or remote. Remote candidates are transported using signaling, i.e outside of webrtc. There are 4 types of candidates: `local`, `stun`, `prflx` or `relay` ([standard](https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidateType)) -* [`cricket::Connection`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/connection.h) +* [`cricket::Connection`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/connection.h) provides the management of a `cricket::CandidatePair`, i.e for sending data between two candidates. It sends STUN Binding requests (aka STUN pings) to verify that packets can traverse back and forth and keep connections alive @@ -44,13 +44,13 @@ following classes interact. connection to remain open). * `cricket::P2PTransportChannel` uses an - [`cricket::PortAllocator`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/port_allocator.h;l=335;drc=9438fb3fff97c803d1ead34c0e4f223db168526f) + [`cricket::PortAllocator`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/port_allocator.h;l=335;drc=9438fb3fff97c803d1ead34c0e4f223db168526f) to create ports and discover local candidates. The `cricket::PortAllocator` is implemented by - [`cricket::BasicPortAllocator`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/client/basic_port_allocator.h;l=29;drc=e27f3dea8293884701283a54f90f8a429ea99505). + [`cricket::BasicPortAllocator`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/client/basic_port_allocator.h;l=29;drc=e27f3dea8293884701283a54f90f8a429ea99505). * `cricket::P2PTransportChannel` uses an - [`cricket::IceControllerInterface`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/ice_controller_interface.h;l=73;drc=9438fb3fff97c803d1ead34c0e4f223db168526f) + [`cricket::IceControllerInterface`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/ice_controller_interface.h;l=73;drc=9438fb3fff97c803d1ead34c0e4f223db168526f) to manage a set of connections. The `cricket::IceControllerInterface` decides which `cricket::Connection` to send data on. @@ -58,26 +58,26 @@ following classes interact. This section describes a normal sequence of interactions to establish ice state completed -[ link ](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/ice_transport_internal.h;l=208;drc=9438fb3fff97c803d1ead34c0e4f223db168526f) +[ link ](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/ice_transport_internal.h;l=208;drc=9438fb3fff97c803d1ead34c0e4f223db168526f) ([ standard ](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/iceConnectionState)) All of these steps are invoked by interactions with `PeerConnection`. -1. [`P2PTransportChannel::MaybeStartGathering`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/p2p_transport_channel.cc;l=864;drc=0ccfbd2de7bc3b237a0f8c30f48666c97b9e5523) +1. [`P2PTransportChannel::MaybeStartGathering`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/p2p_transport_channel.cc;l=864;drc=0ccfbd2de7bc3b237a0f8c30f48666c97b9e5523) This function is invoked as part of `PeerConnection::SetLocalDescription`. `P2PTransportChannel` will use the `cricket::PortAllocator` to create a `cricket::PortAllocatorSession`. The `cricket::PortAllocatorSession` will create local ports as configured, and the ports will start gathering candidates. -2. [`IceTransportInternal::SignalCandidateGathered`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/ice_transport_internal.h;l=293;drc=8cb97062880b0e0a78f9d578370a01aced81a13f) +2. [`IceTransportInternal::SignalCandidateGathered`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/ice_transport_internal.h;l=293;drc=8cb97062880b0e0a78f9d578370a01aced81a13f) When a port finds a local candidate, it will be added to a list on `cricket::P2PTransportChannel` and signaled to application using `IceTransportInternal::SignalCandidateGathered`. A p2p application can then send them to peer using favorite transport mechanism whereas a client-server application will do nothing. -3. [`P2PTransportChannel::AddRemoteCandidate`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/p2p_transport_channel.cc;l=1233;drc=0ccfbd2de7bc3b237a0f8c30f48666c97b9e5523) +3. [`P2PTransportChannel::AddRemoteCandidate`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/p2p_transport_channel.cc;l=1233;drc=0ccfbd2de7bc3b237a0f8c30f48666c97b9e5523) When the application get a remote candidate, it can add it using `PeerConnection::AddRemoteCandidate` (after `PeerConnection::SetRemoteDescription` has been called!), this will trickle @@ -89,14 +89,14 @@ All of these steps are invoked by interactions with `PeerConnection`. added to the `cricket::IceController` that will decide which `cricket::Connection` to send STUN ping on. -4. [`P2PTransportChannel::SignalCandidatePairChanged`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/ice_transport_internal.h;l=310;drc=8cb97062880b0e0a78f9d578370a01aced81a13f) +4. [`P2PTransportChannel::SignalCandidatePairChanged`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/ice_transport_internal.h;l=310;drc=8cb97062880b0e0a78f9d578370a01aced81a13f) When a remote connection replies to a STUN ping, `cricket::IceController` will instruct `P2PTransportChannel` to use the connection. This is signalled up the stack using `P2PTransportChannel::SignalCandidatePairChanged`. Note that `cricket::IceController` will continue to send STUN pings on the selected connection, as well as other connections. -5. [`P2PTransportChannel::SignalIceTransportStateChanged`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/ice_transport_internal.h;l=323;drc=8cb97062880b0e0a78f9d578370a01aced81a13f) +5. [`P2PTransportChannel::SignalIceTransportStateChanged`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/ice_transport_internal.h;l=323;drc=8cb97062880b0e0a78f9d578370a01aced81a13f) The initial selection of a connection makes `P2PTransportChannel` signal up - stack that state has changed, which may make [`cricket::DtlsTransportInternal`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/dtls_transport_internal.h;l=63;drc=653bab6790ac92c513b7cf4cd3ad59039c589a95) + stack that state has changed, which may make [`cricket::DtlsTransportInternal`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/dtls_transport_internal.h;l=63;drc=653bab6790ac92c513b7cf4cd3ad59039c589a95) initiate a DTLS handshake (depending on the DTLS role). diff --git a/pc/g3doc/dtls_transport.md b/pc/g3doc/dtls_transport.md index 65206dff5d..b5343c16d1 100644 --- a/pc/g3doc/dtls_transport.md +++ b/pc/g3doc/dtls_transport.md @@ -44,10 +44,10 @@ The [`webrtc::DtlsSrtpTransport`][6] class is responsіble for extracting the SRTP keys after the DTLS handshake as well as protection and unprotection of SRTP packets via its [`cricket::SrtpSession`][7]. -[1]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/pc/dtls_transport.h;l=32;drc=6a55e7307b78edb50f94a1ff1ef8393d58218369 -[2]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/dtls_transport_interface.h;l=76;drc=34437d5660a80393d631657329ef74c6538be25a -[3]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/dtls_transport_interface.h;l=41;drc=34437d5660a80393d631657329ef74c6538be25a -[4]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/dtls_transport_internal.h;l=63;drc=34437d5660a80393d631657329ef74c6538be25a -[5]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/p2p/base/dtls_transport.h;l=94;drc=653bab6790ac92c513b7cf4cd3ad59039c589a95 -[6]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/pc/dtls_srtp_transport.h;l=31;drc=c32f00ea9ddf3267257fe6b45d4d79c6f6bcb829 +[1]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/pc/dtls_transport.h;l=32;drc=6a55e7307b78edb50f94a1ff1ef8393d58218369 +[2]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/dtls_transport_interface.h;l=76;drc=34437d5660a80393d631657329ef74c6538be25a +[3]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/dtls_transport_interface.h;l=41;drc=34437d5660a80393d631657329ef74c6538be25a +[4]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/dtls_transport_internal.h;l=63;drc=34437d5660a80393d631657329ef74c6538be25a +[5]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/p2p/base/dtls_transport.h;l=94;drc=653bab6790ac92c513b7cf4cd3ad59039c589a95 +[6]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/pc/dtls_srtp_transport.h;l=31;drc=c32f00ea9ddf3267257fe6b45d4d79c6f6bcb829 [7]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/pc/srtp_session.h;l=33;drc=be66d95ab7f9428028806bbf66cb83800bda9241 diff --git a/pc/g3doc/sctp_transport.md b/pc/g3doc/sctp_transport.md index 254e264b0b..863d289484 100644 --- a/pc/g3doc/sctp_transport.md +++ b/pc/g3doc/sctp_transport.md @@ -6,14 +6,14 @@ ## webrtc::SctpTransport -The [`webrtc::SctpTransport`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/pc/sctp_transport.h;l=33?q=class%20webrtc::SctpTransport) class encapsulates an SCTP association, and exposes a +The [`webrtc::SctpTransport`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/pc/sctp_transport.h;l=33?q=class%20webrtc::SctpTransport) class encapsulates an SCTP association, and exposes a few properties of this association to the WebRTC user (such as Chrome). The SctpTransport is used to support Datachannels, as described in the [WebRTC specification for the Peer-to-peer Data API](https://w3c.github.io/webrtc-pc/#peer-to-peer-data-api). -The public interface ([`webrtc::SctpTransportInterface`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/sctp_transport_interface.h?q=webrtc::SctpTransportInterface)) exposes an observer +The public interface ([`webrtc::SctpTransportInterface`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/sctp_transport_interface.h?q=webrtc::SctpTransportInterface)) exposes an observer interface where the user can define a callback to be called whenever the state of an SctpTransport changes; this callback is called on the network thread (as set during PeerConnectionFactory initialization). @@ -28,7 +28,7 @@ closes, but the object itself may survive longer than the PeerConnection. ## cricket::SctpTransportInternal -[`cricket::SctpTransportInternal`](https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/media/sctp/sctp_transport_internal.h?q=cricket::SctpTransportInternal) owns two objects: The SCTP association object (currently +[`cricket::SctpTransportInternal`](https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/media/sctp/sctp_transport_internal.h?q=cricket::SctpTransportInternal) owns two objects: The SCTP association object (currently implemented by wrapping the usrsctp library) and the DTLS transport, which is the object used to send and receive messages as emitted from or consumed by the usrsctp library. diff --git a/test/pc/e2e/g3doc/architecture.md b/test/pc/e2e/g3doc/architecture.md index 5708054c37..aacdf7e5d5 100644 --- a/test/pc/e2e/g3doc/architecture.md +++ b/test/pc/e2e/g3doc/architecture.md @@ -182,27 +182,27 @@ On the decoder side frames that should be "discarded" by fake SFU will be auto decoded into single pixel images and only the interesting simulcast stream/spatial layer will go into real decoder and then will be analyzed. -[1]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/test/peerconnection_quality_test_fixture.h;l=55;drc=484acf27231d931dbc99aedce85bc27e06486b96 -[2]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/pc/e2e/peer_connection_quality_test.h;l=44;drc=6cc893ad778a0965e2b7a8e614f3c98aa81bee5b -[3]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/pc/e2e/media/media_helper.h;l=27;drc=d46db9f1523ae45909b4a6fdc90a140443068bc6 -[4]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/pc/e2e/analyzer/video/video_quality_analyzer_injection_helper.h;l=38;drc=79020414fd5c71f9ec1f25445ea5f1c8001e1a49 -[5]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/pc/e2e/analyzer/video/single_process_encoded_image_data_injector.h;l=40;drc=79020414fd5c71f9ec1f25445ea5f1c8001e1a49 -[6]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/test/audio_quality_analyzer_interface.h;l=23;drc=20f45823e37fd7272aa841831c029c21f29742c2 -[7]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/pc/e2e/test_activities_executor.h;l=28;drc=6cc893ad778a0965e2b7a8e614f3c98aa81bee5b -[8]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/test/peerconnection_quality_test_fixture.h;l=439;drc=484acf27231d931dbc99aedce85bc27e06486b96 -[9]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/test/peerconnection_quality_test_fixture.h;l=445;drc=484acf27231d931dbc99aedce85bc27e06486b96 -[10]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/test/peerconnection_quality_test_fixture.h;l=413;drc=9438fb3fff97c803d1ead34c0e4f223db168526f -[11]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/pc/e2e/test_activities_executor.h;l=28;drc=6cc893ad778a0965e2b7a8e614f3c98aa81bee5b -[12]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/pc/e2e/test_activities_executor.h;l=28;drc=6cc893ad778a0965e2b7a8e614f3c98aa81bee5b -[13]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/pc/e2e/test_peer_factory.h;l=46;drc=0ef4a2488a466a24ab97b31fdddde55440d451f9 -[14]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/pc/peer_connection_wrapper.h;l=47;drc=5ab79e62f691875a237ea28ca3975ea1f0ed62ec -[15]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/test/peerconnection_quality_test_fixture.h;l=459;drc=484acf27231d931dbc99aedce85bc27e06486b96 -[16]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/peer_connection_interface.h;l=886;drc=9438fb3fff97c803d1ead34c0e4f223db168526f -[17]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/pc/e2e/cross_media_metrics_reporter.h;l=29;drc=9d777620236ec76754cfce19f6e82dd18e52d22c -[18]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/pc/e2e/cross_media_metrics_reporter.h;l=29;drc=9d777620236ec76754cfce19f6e82dd18e52d22c -[19]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/test/peerconnection_quality_test_fixture.h;l=450;drc=484acf27231d931dbc99aedce85bc27e06486b96 -[20]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/pc/e2e/stats_poller.h;l=52;drc=9b526180c9e9722d3fc7f8689da6ec094fc7fc0a -[21]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/pc/e2e/sdp/sdp_changer.h;l=79;drc=ee558dcca89fd8b105114ededf9e74d948da85e8 -[22]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.h;l=54;drc=79020414fd5c71f9ec1f25445ea5f1c8001e1a49 -[23]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/pc/e2e/analyzer/video/quality_analyzing_video_decoder.h;l=50;drc=79020414fd5c71f9ec1f25445ea5f1c8001e1a49 +[1]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/test/peerconnection_quality_test_fixture.h;l=55;drc=484acf27231d931dbc99aedce85bc27e06486b96 +[2]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/pc/e2e/peer_connection_quality_test.h;l=44;drc=6cc893ad778a0965e2b7a8e614f3c98aa81bee5b +[3]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/pc/e2e/media/media_helper.h;l=27;drc=d46db9f1523ae45909b4a6fdc90a140443068bc6 +[4]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/pc/e2e/analyzer/video/video_quality_analyzer_injection_helper.h;l=38;drc=79020414fd5c71f9ec1f25445ea5f1c8001e1a49 +[5]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/pc/e2e/analyzer/video/single_process_encoded_image_data_injector.h;l=40;drc=79020414fd5c71f9ec1f25445ea5f1c8001e1a49 +[6]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/test/audio_quality_analyzer_interface.h;l=23;drc=20f45823e37fd7272aa841831c029c21f29742c2 +[7]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/pc/e2e/test_activities_executor.h;l=28;drc=6cc893ad778a0965e2b7a8e614f3c98aa81bee5b +[8]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/test/peerconnection_quality_test_fixture.h;l=439;drc=484acf27231d931dbc99aedce85bc27e06486b96 +[9]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/test/peerconnection_quality_test_fixture.h;l=445;drc=484acf27231d931dbc99aedce85bc27e06486b96 +[10]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/test/peerconnection_quality_test_fixture.h;l=413;drc=9438fb3fff97c803d1ead34c0e4f223db168526f +[11]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/pc/e2e/test_activities_executor.h;l=28;drc=6cc893ad778a0965e2b7a8e614f3c98aa81bee5b +[12]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/pc/e2e/test_activities_executor.h;l=28;drc=6cc893ad778a0965e2b7a8e614f3c98aa81bee5b +[13]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/pc/e2e/test_peer_factory.h;l=46;drc=0ef4a2488a466a24ab97b31fdddde55440d451f9 +[14]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/pc/peer_connection_wrapper.h;l=47;drc=5ab79e62f691875a237ea28ca3975ea1f0ed62ec +[15]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/test/peerconnection_quality_test_fixture.h;l=459;drc=484acf27231d931dbc99aedce85bc27e06486b96 +[16]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/peer_connection_interface.h;l=886;drc=9438fb3fff97c803d1ead34c0e4f223db168526f +[17]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/pc/e2e/cross_media_metrics_reporter.h;l=29;drc=9d777620236ec76754cfce19f6e82dd18e52d22c +[18]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/pc/e2e/cross_media_metrics_reporter.h;l=29;drc=9d777620236ec76754cfce19f6e82dd18e52d22c +[19]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/test/peerconnection_quality_test_fixture.h;l=450;drc=484acf27231d931dbc99aedce85bc27e06486b96 +[20]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/pc/e2e/stats_poller.h;l=52;drc=9b526180c9e9722d3fc7f8689da6ec094fc7fc0a +[21]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/pc/e2e/sdp/sdp_changer.h;l=79;drc=ee558dcca89fd8b105114ededf9e74d948da85e8 +[22]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/pc/e2e/analyzer/video/quality_analyzing_video_encoder.h;l=54;drc=79020414fd5c71f9ec1f25445ea5f1c8001e1a49 +[23]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/pc/e2e/analyzer/video/quality_analyzing_video_decoder.h;l=50;drc=79020414fd5c71f9ec1f25445ea5f1c8001e1a49 [24]: /test/network/g3doc/index.md diff --git a/test/pc/e2e/g3doc/index.md b/test/pc/e2e/g3doc/index.md index d676476ddc..5a3c9a7e41 100644 --- a/test/pc/e2e/g3doc/index.md +++ b/test/pc/e2e/g3doc/index.md @@ -210,14 +210,14 @@ are several options how you can do this: desired_graphs)` to print plottable metrics to stdout. Then as in previous option you need to pipe result into plotter script. -[1]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/test/peerconnection_quality_test_fixture.h;drc=cbe6e8a2589a925d4c91a2ac2c69201f03de9c39 -[2]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/test/create_peerconnection_quality_test_fixture.h;drc=cbe6e8a2589a925d4c91a2ac2c69201f03de9c39 -[3]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/pc/e2e/peer_connection_e2e_smoke_test.cc;drc=cbe6e8a2589a925d4c91a2ac2c69201f03de9c39 -[4]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/video/pc_full_stack_tests.cc;drc=cbe6e8a2589a925d4c91a2ac2c69201f03de9c39 -[5]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/numerics/samples_stats_counter.h;drc=cbe6e8a2589a925d4c91a2ac2c69201f03de9c39 -[6]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/testsupport/perf_test.h;l=86;drc=0710b401b1e5b500b8e84946fb657656ba1b58b7 -[7]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/test_main_lib.h;l=23;drc=bcb42f1e4be136c390986a40d9d5cb3ad0de260b -[8]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/test_main.cc;drc=bcb42f1e4be136c390986a40d9d5cb3ad0de260b -[9]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/rtc_tools/metrics_plotter.py;drc=8cc6695652307929edfc877cd64b75cd9ec2d615 -[10]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/test/testsupport/perf_test.h;l=105;drc=0710b401b1e5b500b8e84946fb657656ba1b58b7 -[11]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/test/peerconnection_quality_test_fixture.h;l=272;drc=484acf27231d931dbc99aedce85bc27e06486b96 +[1]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/test/peerconnection_quality_test_fixture.h;drc=cbe6e8a2589a925d4c91a2ac2c69201f03de9c39 +[2]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/test/create_peerconnection_quality_test_fixture.h;drc=cbe6e8a2589a925d4c91a2ac2c69201f03de9c39 +[3]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/pc/e2e/peer_connection_e2e_smoke_test.cc;drc=cbe6e8a2589a925d4c91a2ac2c69201f03de9c39 +[4]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/video/pc_full_stack_tests.cc;drc=cbe6e8a2589a925d4c91a2ac2c69201f03de9c39 +[5]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/numerics/samples_stats_counter.h;drc=cbe6e8a2589a925d4c91a2ac2c69201f03de9c39 +[6]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/testsupport/perf_test.h;l=86;drc=0710b401b1e5b500b8e84946fb657656ba1b58b7 +[7]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/test_main_lib.h;l=23;drc=bcb42f1e4be136c390986a40d9d5cb3ad0de260b +[8]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/test_main.cc;drc=bcb42f1e4be136c390986a40d9d5cb3ad0de260b +[9]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/rtc_tools/metrics_plotter.py;drc=8cc6695652307929edfc877cd64b75cd9ec2d615 +[10]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/test/testsupport/perf_test.h;l=105;drc=0710b401b1e5b500b8e84946fb657656ba1b58b7 +[11]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/test/peerconnection_quality_test_fixture.h;l=272;drc=484acf27231d931dbc99aedce85bc27e06486b96 diff --git a/video/g3doc/adaptation.md b/video/g3doc/adaptation.md index 084a0fd3aa..463f82caef 100644 --- a/video/g3doc/adaptation.md +++ b/video/g3doc/adaptation.md @@ -99,16 +99,16 @@ The `VideoSinkWants` can be applied by any video source, or one may use the [AdaptedVideoTraceSource][adapted_video_track_source.h] which is a base class for sources that need video adaptation. -[RtpParameters]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/rtp_parameters.h?q=%22RTC_EXPORT%20RtpParameters%22 -[resource.h]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/adaptation/resource.h -[Call::AddAdaptationResource]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/call/call.h?q=Call::AddAdaptationResource -[quality_scaler.h]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/modules/video_coding/utility/quality_scaler.h -[VideoEncoder::QpThresholds]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/video_codecs/video_encoder.h?q=VideoEncoder::QpThresholds -[EncoderInfo]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/video_codecs/video_encoder.h?q=VideoEncoder::EncoderInfo -[encode_usage_resource.h]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/video/adaptation/encode_usage_resource.h -[VideoStreamAdapter]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/call/adaptation/video_stream_adapter.h -[adaptation_constraint.h]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/call/adaptation/adaptation_constraint.h -[bitrate_constraint.h]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/video/adaptation/bitrate_constraint.h -[AddOrUpdateSink]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/video/video_source_interface.h?q=AddOrUpdateSink -[VideoSinkWants]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/api/video/video_source_interface.h?q=%22RTC_EXPORT%20VideoSinkWants%22 -[adapted_video_track_source.h]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/media/base/adapted_video_track_source.h +[RtpParameters]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/rtp_parameters.h?q=%22RTC_EXPORT%20RtpParameters%22 +[resource.h]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/adaptation/resource.h +[Call::AddAdaptationResource]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/call/call.h?q=Call::AddAdaptationResource +[quality_scaler.h]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/modules/video_coding/utility/quality_scaler.h +[VideoEncoder::QpThresholds]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/video_codecs/video_encoder.h?q=VideoEncoder::QpThresholds +[EncoderInfo]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/video_codecs/video_encoder.h?q=VideoEncoder::EncoderInfo +[encode_usage_resource.h]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/video/adaptation/encode_usage_resource.h +[VideoStreamAdapter]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/call/adaptation/video_stream_adapter.h +[adaptation_constraint.h]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/call/adaptation/adaptation_constraint.h +[bitrate_constraint.h]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/video/adaptation/bitrate_constraint.h +[AddOrUpdateSink]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/video/video_source_interface.h?q=AddOrUpdateSink +[VideoSinkWants]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/api/video/video_source_interface.h?q=%22RTC_EXPORT%20VideoSinkWants%22 +[adapted_video_track_source.h]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/media/base/adapted_video_track_source.h diff --git a/video/g3doc/stats.md b/video/g3doc/stats.md index a5d15fe2fa..669651e262 100644 --- a/video/g3doc/stats.md +++ b/video/g3doc/stats.md @@ -173,10 +173,10 @@ Updated when a RTCP packet is sent, `RTCPSender::ComputeCompoundRTCPPacket`. * `rtcp_packet_type_counts` - total number of sent NACK/FIR/PLI packets [rtcinboundrtpstreamstats-[nackcount], [fircount], [plicount]]. -[VideoSendStream]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/call/video_send_stream.h -[VideoSendStream::Stats]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/call/video_send_stream.h?q=VideoSendStream::Stats -[StreamStats]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/call/video_send_stream.h?q=VideoSendStream::StreamStats -[SendStatisticsProxy]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/video/send_statistics_proxy.h +[VideoSendStream]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/call/video_send_stream.h +[VideoSendStream::Stats]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/call/video_send_stream.h?q=VideoSendStream::Stats +[StreamStats]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/call/video_send_stream.h?q=VideoSendStream::StreamStats +[SendStatisticsProxy]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/video/send_statistics_proxy.h [rtcoutboundrtpstreamstats-framewidth]: https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-framewidth [rtcoutboundrtpstreamstats-frameheight]: https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-frameheight [rtcoutboundrtpstreamstats-qpsum]: https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-qpsum @@ -195,9 +195,9 @@ Updated when a RTCP packet is sent, `RTCPSender::ComputeCompoundRTCPPacket`. [rtcoutboundrtpstreamstats-qualitylimitationdurations]: https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-qualitylimitationdurations [rtcoutboundrtpstreamstats-qualitylimitationresolutionchanges]: https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-qualitylimitationresolutionchanges -[VideoReceiveStream]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/call/video_receive_stream.h -[VideoReceiveStream::Stats]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/call/video_receive_stream.h?q=VideoReceiveStream::Stats -[ReceiveStatisticsProxy]: https://source.chromium.org/chromium/chromium/src/+/master:third_party/webrtc/video/receive_statistics_proxy2.h +[VideoReceiveStream]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/call/video_receive_stream.h +[VideoReceiveStream::Stats]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/call/video_receive_stream.h?q=VideoReceiveStream::Stats +[ReceiveStatisticsProxy]: https://source.chromium.org/chromium/chromium/src/+/main:third_party/webrtc/video/receive_statistics_proxy2.h [rtcinboundrtpstreamstats-keyframesdecoded]: https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-keyframesdecoded [rtcinboundrtpstreamstats-jitterbufferdelay]: https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-jitterbufferdelay [rtcinboundrtpstreamstats-jitterbufferemittedcount]: https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-jitterbufferemittedcount From a6395132ae29ea0ab1f3e7132e7e6661f4a306b7 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Thu, 22 Jul 2021 17:35:59 +0200 Subject: [PATCH 0069/1565] Add presubmit check to guard against assert() usage. Example of error reporting: Usage of assert() has been detected in the following files, please use RTC_DCHECK() instead. Files: rtc_base/thread.cc Bug: webrtc:6779 Change-Id: Iae08c3d7ddcc0449073752cadca19b3cf662892c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225549 Commit-Queue: Mirko Bonadei Reviewed-by: Harald Alvestrand Cr-Commit-Position: refs/heads/master@{#34532} --- PRESUBMIT.py | 24 ++++++++++++++++ presubmit_test.py | 64 +++++++++++++++++++++++++++++++++++++++++ presubmit_test_mocks.py | 9 ++++-- 3 files changed, 95 insertions(+), 2 deletions(-) diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 21875f61af..6c4a04ce89 100755 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -1041,6 +1041,8 @@ def CommonChecks(input_api, output_api): results.extend(CheckApiDepsFileIsUpToDate(input_api, output_api)) results.extend( CheckAbslMemoryInclude(input_api, output_api, non_third_party_sources)) + results.extend( + CheckAssertUsage(input_api, output_api, non_third_party_sources)) results.extend( CheckBannedAbslMakeUnique(input_api, output_api, non_third_party_sources)) @@ -1158,6 +1160,28 @@ def CheckObjcApiSymbols(input_api, output_api, source_file_filter): return [] +def CheckAssertUsage(input_api, output_api, source_file_filter): + pattern = input_api.re.compile(r'\bassert\(') + file_filter = lambda f: (f.LocalPath().endswith(('.cc', '.h', '.m', '.mm')) + and source_file_filter(f)) + + files = [] + for f in input_api.AffectedFiles(include_deletes=False, + file_filter=file_filter): + for _, line in f.ChangedContents(): + if pattern.search(line): + files.append(f.LocalPath()) + break + + if len(files): + return [ + output_api.PresubmitError( + 'Usage of assert() has been detected in the following files, ' + 'please use RTC_DCHECK() instead.\n Files:', files) + ] + return [] + + def CheckAbslMemoryInclude(input_api, output_api, source_file_filter): pattern = input_api.re.compile(r'^#include\s*"absl/memory/memory.h"', input_api.re.MULTILINE) diff --git a/presubmit_test.py b/presubmit_test.py index bb93765f28..e7879f99f7 100755 --- a/presubmit_test.py +++ b/presubmit_test.py @@ -271,5 +271,69 @@ def _GenerateBuildFile(self, content): f.write(content) +class CheckAssertUsageTest(unittest.TestCase): + def setUp(self): + self.input_api = MockInputApi() + self.output_api = MockOutputApi() + self._content_with_assert = [ + 'void Foo() {', + ' assert(true);', + '}' + ] + self._content_without_assert = [ + 'void Foo() {', + ' RTC_CHECK(true);', + '}' + ] + + def testDetectsAssertInCcFile(self): + self.input_api.files = [ + MockFile('with_assert.cc', self._content_with_assert), + MockFile('without_assert.cc', self._content_without_assert), + ] + errors = PRESUBMIT.CheckAssertUsage( + self.input_api, self.output_api, lambda x: True) + self.assertEqual(1, len(errors)) + self.assertEqual('with_assert.cc', errors[0].items[0]) + + def testDetectsAssertInHeaderFile(self): + self.input_api.files = [ + MockFile('with_assert.h', self._content_with_assert), + MockFile('without_assert.h', self._content_without_assert), + ] + errors = PRESUBMIT.CheckAssertUsage( + self.input_api, self.output_api, lambda x: True) + self.assertEqual(1, len(errors)) + self.assertEqual('with_assert.h', errors[0].items[0]) + + def testDetectsAssertInObjCFile(self): + self.input_api.files = [ + MockFile('with_assert.m', self._content_with_assert), + MockFile('without_assert.m', self._content_without_assert), + ] + errors = PRESUBMIT.CheckAssertUsage( + self.input_api, self.output_api, lambda x: True) + self.assertEqual(1, len(errors)) + self.assertEqual('with_assert.m', errors[0].items[0]) + + def testDetectsAssertInObjCppFile(self): + self.input_api.files = [ + MockFile('with_assert.mm', self._content_with_assert), + MockFile('without_assert.mm', self._content_without_assert), + ] + errors = PRESUBMIT.CheckAssertUsage( + self.input_api, self.output_api, lambda x: True) + self.assertEqual(1, len(errors)) + self.assertEqual('with_assert.mm', errors[0].items[0]) + + def testDoesntDetectAssertInOtherFiles(self): + self.input_api.files = [ + MockFile('with_assert.cpp', self._content_with_assert), + ] + errors = PRESUBMIT.CheckAssertUsage( + self.input_api, self.output_api, lambda x: True) + self.assertEqual(0, len(errors)) + + if __name__ == '__main__': unittest.main() diff --git a/presubmit_test_mocks.py b/presubmit_test_mocks.py index b15eb74dd8..4ed7947530 100644 --- a/presubmit_test_mocks.py +++ b/presubmit_test_mocks.py @@ -24,13 +24,18 @@ def __init__(self): self.change = MockChange([], []) self.files = [] self.presubmit_local_path = os.path.dirname(__file__) + self.re = re # pylint: disable=invalid-name def AffectedSourceFiles(self, file_filter=None): return self.AffectedFiles(file_filter=file_filter) def AffectedFiles(self, file_filter=None, include_deletes=False): - # pylint: disable=unused-argument - return self.files + for f in self.files: + if file_filter and not file_filter(f): + continue + if not include_deletes and f.Action() == 'D': + continue + yield f @classmethod def FilterSourceFile(cls, From d5642de3534bcb522ddbb52bd4596dcf6bcaff45 Mon Sep 17 00:00:00 2001 From: chromium-webrtc-autoroll Date: Thu, 22 Jul 2021 09:02:18 -0700 Subject: [PATCH 0070/1565] Roll chromium_revision 89e5d40511..03a29cf406 (904223:904346) Change log: https://chromium.googlesource.com/chromium/src/+log/89e5d40511..03a29cf406 Full diff: https://chromium.googlesource.com/chromium/src/+/89e5d40511..03a29cf406 Changed dependencies * src/base: https://chromium.googlesource.com/chromium/src/base/+log/c3be4f97ad..58887e6f2a * src/build: https://chromium.googlesource.com/chromium/src/build/+log/488aac0b88..4638e26758 * src/ios: https://chromium.googlesource.com/chromium/src/ios/+log/c1da2dc834..c172f6d55d * src/testing: https://chromium.googlesource.com/chromium/src/testing/+log/8c3404999d..e6a8848e04 * src/third_party: https://chromium.googlesource.com/chromium/src/third_party/+log/ed132557b6..43300033c5 * src/third_party/androidx: R0benUT8A1oqvs7L0N-hfCvDpMzfzemd6fXXr4tBOrEC..hKpaz7h0NioWOEg8YP2hSuRaZ6uRCUEUcmNcvkxr9aYC * src/third_party/perfetto: https://android.googlesource.com/platform/external/perfetto.git/+log/cb07e44638..13482fe8f9 * src/tools: https://chromium.googlesource.com/chromium/src/tools/+log/5ddfcadec9..2f3bb89f4e DEPS diff: https://chromium.googlesource.com/chromium/src/+/89e5d40511..03a29cf406/DEPS No update to Clang. TBR=chromium-webrtc-autoroll@webrtc-ci.iam.gserviceaccount.com, BUG=None Change-Id: I1d641f6035a6ccc3b05aa141996bafa3d290b16d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226763 Reviewed-by: Autoroller Commit-Queue: Autoroller Cr-Commit-Position: refs/heads/master@{#34533} --- DEPS | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/DEPS b/DEPS index 153312fb4c..fe1142360b 100644 --- a/DEPS +++ b/DEPS @@ -10,7 +10,7 @@ vars = { # chromium waterfalls. More info at: crbug.com/570091. 'checkout_configuration': 'default', 'checkout_instrumented_libraries': 'checkout_linux and checkout_configuration == "default"', - 'chromium_revision': '89e5d4051156295bbb37c307f29e5482bae670e6', + 'chromium_revision': '03a29cf406887d9341dc238c873402084352613e', # Keep the Chromium default of generating location tags. 'generate_location_tags': True, @@ -20,9 +20,9 @@ deps = { # TODO(kjellander): Move this to be Android-only once the libevent dependency # in base/third_party/libevent is solved. 'src/base': - 'https://chromium.googlesource.com/chromium/src/base@c3be4f97adc91439690e0534c2e11143afc5b114', + 'https://chromium.googlesource.com/chromium/src/base@58887e6f2a7d5c37befea9ffb4d675df86bae5b7', 'src/build': - 'https://chromium.googlesource.com/chromium/src/build@488aac0b886533f5c5baf8214098a6afd1d46f00', + 'https://chromium.googlesource.com/chromium/src/build@4638e2675872e022efd9315b34bd364d5c62cac4', 'src/buildtools': 'https://chromium.googlesource.com/chromium/src/buildtools@37dc929ecb351687006a61744b116cda601753d7', # Gradle 6.6.1. Used for testing Android Studio project generation for WebRTC. @@ -31,13 +31,13 @@ deps = { 'condition': 'checkout_android', }, 'src/ios': { - 'url': 'https://chromium.googlesource.com/chromium/src/ios@c1da2dc8344d379dc6d9a6dfe55f5b9f31560095', + 'url': 'https://chromium.googlesource.com/chromium/src/ios@c172f6d55d8006686cc2e9a11bd775de46da15bd', 'condition': 'checkout_ios', }, 'src/testing': - 'https://chromium.googlesource.com/chromium/src/testing@8c3404999d90f3192a776dab50d26401fd676492', + 'https://chromium.googlesource.com/chromium/src/testing@e6a8848e04224cdd729ba957e7133368e2b4fa3f', 'src/third_party': - 'https://chromium.googlesource.com/chromium/src/third_party@ed132557b60ca3f46d2fe05fab9317985c0a778e', + 'https://chromium.googlesource.com/chromium/src/third_party@43300033c567983076ecf876ae86bd31dc9739a6', 'src/buildtools/linux64': { 'packages': [ @@ -214,7 +214,7 @@ deps = { 'condition': 'checkout_android', }, 'src/third_party/perfetto': - 'https://android.googlesource.com/platform/external/perfetto.git@cb07e44638b99718b8c54bc19f8dbd84a3743dc6', + 'https://android.googlesource.com/platform/external/perfetto.git@13482fe8f91c9249d7311899e1627f0ea670afb7', 'src/third_party/libvpx/source/libvpx': 'https://chromium.googlesource.com/webm/libvpx.git@eebc5cd487a89c51ba148f6d6ac45779970f72d7', 'src/third_party/libyuv': @@ -271,7 +271,7 @@ deps = { 'condition': 'checkout_win', }, 'src/tools': - 'https://chromium.googlesource.com/chromium/src/tools@5ddfcadec98e2c11158fde35550f019fadf2a437', + 'https://chromium.googlesource.com/chromium/src/tools@2f3bb89f4e4a952f55afbd3b7f36e02d404141b5', 'src/tools/swarming_client': 'https://chromium.googlesource.com/infra/luci/client-py.git@a32a1607f6093d338f756c7e7c7b4333b0c50c9c', @@ -372,7 +372,7 @@ deps = { 'packages': [ { 'package': 'chromium/third_party/androidx', - 'version': 'R0benUT8A1oqvs7L0N-hfCvDpMzfzemd6fXXr4tBOrEC', + 'version': 'hKpaz7h0NioWOEg8YP2hSuRaZ6uRCUEUcmNcvkxr9aYC', }, ], 'condition': 'checkout_android', From 645f899789a206811f4a8bc165f1614eecc74f66 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Thu, 22 Jul 2021 19:49:43 +0200 Subject: [PATCH 0071/1565] [sigslot] - Remove signal from StunPort::AddressResolver. Bug: webrtc:11943 Change-Id: I5c8fe10cbf47e85cfc26e1e7e548627a588ffcbf Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225551 Commit-Queue: Mirko Bonadei Reviewed-by: Harald Alvestrand Cr-Commit-Position: refs/heads/master@{#34534} --- p2p/base/stun_port.cc | 14 +++++++++----- p2p/base/stun_port.h | 16 ++++++++-------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/p2p/base/stun_port.cc b/p2p/base/stun_port.cc index 7b1a2a83a2..e149c206b1 100644 --- a/p2p/base/stun_port.cc +++ b/p2p/base/stun_port.cc @@ -115,8 +115,10 @@ class StunBindingRequest : public StunRequest { int64_t start_time_; }; -UDPPort::AddressResolver::AddressResolver(rtc::PacketSocketFactory* factory) - : socket_factory_(factory) {} +UDPPort::AddressResolver::AddressResolver( + rtc::PacketSocketFactory* factory, + std::function done_callback) + : socket_factory_(factory), done_(std::move(done_callback)) {} UDPPort::AddressResolver::~AddressResolver() { for (ResolverMap::iterator it = resolvers_.begin(); it != resolvers_.end(); @@ -159,7 +161,7 @@ void UDPPort::AddressResolver::OnResolveResult( for (ResolverMap::iterator it = resolvers_.begin(); it != resolvers_.end(); ++it) { if (it->second == resolver) { - SignalDone(it->first, resolver->GetError()); + done_(it->first, resolver->GetError()); return; } } @@ -434,8 +436,10 @@ void UDPPort::SendStunBindingRequests() { void UDPPort::ResolveStunAddress(const rtc::SocketAddress& stun_addr) { if (!resolver_) { - resolver_.reset(new AddressResolver(socket_factory())); - resolver_->SignalDone.connect(this, &UDPPort::OnResolveResult); + resolver_.reset(new AddressResolver( + socket_factory(), [&](const rtc::SocketAddress& input, int error) { + OnResolveResult(input, error); + })); } RTC_LOG(LS_INFO) << ToString() << ": Starting STUN host lookup for " diff --git a/p2p/base/stun_port.h b/p2p/base/stun_port.h index aa57d666b9..45150ae6c6 100644 --- a/p2p/base/stun_port.h +++ b/p2p/base/stun_port.h @@ -11,6 +11,7 @@ #ifndef P2P_BASE_STUN_PORT_H_ #define P2P_BASE_STUN_PORT_H_ +#include #include #include #include @@ -20,8 +21,6 @@ #include "p2p/base/stun_request.h" #include "rtc_base/async_packet_socket.h" -// TODO(mallinath) - Rename stunport.cc|h to udpport.cc|h. - namespace cricket { // Lifetime chosen for STUN ports on low-cost networks. @@ -183,7 +182,9 @@ class UDPPort : public Port { // resolve one address per instance. class AddressResolver : public sigslot::has_slots<> { public: - explicit AddressResolver(rtc::PacketSocketFactory* factory); + explicit AddressResolver( + rtc::PacketSocketFactory* factory, + std::function done_callback); ~AddressResolver() override; void Resolve(const rtc::SocketAddress& address); @@ -191,11 +192,6 @@ class UDPPort : public Port { int family, rtc::SocketAddress* output) const; - // The signal is sent when resolving the specified address is finished. The - // first argument is the input address, the second argument is the error - // or 0 if it succeeded. - sigslot::signal2 SignalDone; - private: typedef std::map ResolverMap; @@ -204,6 +200,10 @@ class UDPPort : public Port { rtc::PacketSocketFactory* socket_factory_; ResolverMap resolvers_; + // The function is called when resolving the specified address is finished. + // The first argument is the input address, the second argument is the error + // or 0 if it succeeded. + std::function done_; }; // DNS resolution of the STUN server. From d695ace023f092c11105ad1b603067226d39c8e4 Mon Sep 17 00:00:00 2001 From: webrtc-version-updater Date: Thu, 22 Jul 2021 21:03:55 -0700 Subject: [PATCH 0072/1565] Update WebRTC code version (2021-07-23T04:03:53). TBR=webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com,mbonadei@webrtc.org Bug: None Change-Id: Ida9dc0b22d0121bac154936f8857d29e2101bc8b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226820 Reviewed-by: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Commit-Queue: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Cr-Commit-Position: refs/heads/master@{#34535} --- call/version.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/call/version.cc b/call/version.cc index ec37f5068d..95d7307abb 100644 --- a/call/version.cc +++ b/call/version.cc @@ -13,7 +13,7 @@ namespace webrtc { // The timestamp is always in UTC. -const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-22T04:03:23"; +const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-23T04:03:53"; void LoadWebRTCVersionInRegister() { // Using volatile to instruct the compiler to not optimize `p` away even From b58f7eb97d65603c1a363d900b4c6a94898a93b9 Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Fri, 16 Jul 2021 03:04:44 +0900 Subject: [PATCH 0073/1565] Fix PRESUBMIT.py to not run pylint on deleted files. Bug: None Change-Id: I7963e51dd4b9102c84e22b2ad7b1510e8d29f2d4 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226280 Reviewed-by: Mirko Bonadei Reviewed-by: Harald Alvestrand Commit-Queue: Harald Alvestrand Cr-Commit-Position: refs/heads/master@{#34536} --- PRESUBMIT.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRESUBMIT.py b/PRESUBMIT.py index 6c4a04ce89..e951936690 100755 --- a/PRESUBMIT.py +++ b/PRESUBMIT.py @@ -922,7 +922,7 @@ def CommonChecks(input_api, output_api): python_file_filter = lambda f: (f.LocalPath().endswith('.py') and source_file_filter(f)) python_changed_files = [f.LocalPath() for f in input_api.AffectedFiles( - file_filter=python_file_filter)] + include_deletes=False, file_filter=python_file_filter)] results.extend( input_api.canned_checks.RunPylint( From 10ed32c114fd24018790e92dfdf30932909a80a2 Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Thu, 22 Jul 2021 11:09:28 +0200 Subject: [PATCH 0074/1565] do not require generic frame descriptor extension for FrameEncryptor as there are encryption schemes that preserve the payload structure well enough and do not require those extensions. This improves consistency as the webrtc-encoded-transform API (which does not use this synchronous codepath) does not require those header extensions either. BUG=webrtc:12995 Change-Id: If237ca5d92e8871ac71c3d48fdd05127206395e6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226741 Reviewed-by: Harald Alvestrand Reviewed-by: Danil Chapovalov Commit-Queue: Harald Alvestrand Cr-Commit-Position: refs/heads/master@{#34537} --- modules/rtp_rtcp/source/rtp_sender_video.cc | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/rtp_rtcp/source/rtp_sender_video.cc b/modules/rtp_rtcp/source/rtp_sender_video.cc index 4919e3ebf4..bb9080ff69 100644 --- a/modules/rtp_rtcp/source/rtp_sender_video.cc +++ b/modules/rtp_rtcp/source/rtp_sender_video.cc @@ -581,10 +581,6 @@ bool RTPSenderVideo::SendVideo( // TODO(benwright@webrtc.org) - Allocate enough to always encrypt inline. rtc::Buffer encrypted_video_payload; if (frame_encryptor_ != nullptr) { - if (!has_generic_descriptor) { - return false; - } - const size_t max_ciphertext_size = frame_encryptor_->GetMaxCiphertextByteSize(cricket::MEDIA_TYPE_VIDEO, payload.size()); From d7aa87501fef41a507c8de713aea8914a7707299 Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Fri, 9 Jul 2021 08:15:50 +0200 Subject: [PATCH 0075/1565] doc: add g3doc sitemap to toplevel readme BUG=None No-Try: true Change-Id: I18d0ff22089271f364651955f9718f7c603fca48 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225542 Reviewed-by: Harald Alvestrand Reviewed-by: Artem Titov Commit-Queue: Harald Alvestrand Cr-Commit-Position: refs/heads/master@{#34538} --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 37694d9514..332efcc58b 100644 --- a/README.md +++ b/README.md @@ -27,5 +27,6 @@ native API header files. * [Coding style guide](g3doc/style-guide.md) * [Code of conduct](CODE_OF_CONDUCT.md) * [Reporting bugs](docs/bug-reporting.md) + * [Documentation](g3doc/sitemap.md) [native-dev]: https://webrtc.googlesource.com/src/+/main/docs/native-code/index.md From 06a2bf09a462a514ba1a19faac617a5a15d034bb Mon Sep 17 00:00:00 2001 From: Markus Handell Date: Thu, 22 Jul 2021 15:09:39 +0200 Subject: [PATCH 0076/1565] NackModule2: Rename to NackRequester. The alternative new name proposed, NackTracker, is already in use in audio_coding. Fixed: webrtc:11594 Change-Id: I6a05fafc05fa7ddb18ea4f64886a135e5ef59f7e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226744 Reviewed-by: Ilya Nikolaevskiy Reviewed-by: Harald Alvestrand Commit-Queue: Markus Handell Cr-Commit-Position: refs/heads/master@{#34539} --- modules/video_coding/BUILD.gn | 10 +-- modules/video_coding/deprecated/BUILD.gn | 2 +- .../{nack_module2.cc => nack_requester.cc} | 70 +++++++-------- .../{nack_module2.h => nack_requester.h} | 37 ++++---- ...unittest.cc => nack_requester_unittest.cc} | 86 +++++++++---------- video/BUILD.gn | 2 +- video/rtp_video_stream_receiver2.cc | 10 +-- video/rtp_video_stream_receiver2.h | 6 +- video/video_receive_stream2.h | 2 +- 9 files changed, 111 insertions(+), 114 deletions(-) rename modules/video_coding/{nack_module2.cc => nack_requester.cc} (85%) rename modules/video_coding/{nack_module2.h => nack_requester.h} (83%) rename modules/video_coding/{nack_module2_unittest.cc => nack_requester_unittest.cc} (84%) diff --git a/modules/video_coding/BUILD.gn b/modules/video_coding/BUILD.gn index d88ce4221a..2ffee9e432 100644 --- a/modules/video_coding/BUILD.gn +++ b/modules/video_coding/BUILD.gn @@ -71,12 +71,12 @@ rtc_library("frame_dependencies_calculator") { ] } -rtc_library("nack_module") { +rtc_library("nack_requester") { sources = [ "histogram.cc", "histogram.h", - "nack_module2.cc", - "nack_module2.h", + "nack_requester.cc", + "nack_requester.h", ] deps = [ @@ -965,8 +965,8 @@ if (rtc_include_tests) { "jitter_buffer_unittest.cc", "jitter_estimator_tests.cc", "loss_notification_controller_unittest.cc", - "nack_module2_unittest.cc", "nack_module_unittest.cc", + "nack_requester_unittest.cc", "packet_buffer_unittest.cc", "receiver_unittest.cc", "rtp_frame_reference_finder_unittest.cc", @@ -1002,7 +1002,7 @@ if (rtc_include_tests) { ":codec_globals_headers", ":encoded_frame", ":frame_dependencies_calculator", - ":nack_module", + ":nack_requester", ":simulcast_test_fixture_impl", ":video_codec_interface", ":video_codecs_test_framework", diff --git a/modules/video_coding/deprecated/BUILD.gn b/modules/video_coding/deprecated/BUILD.gn index 487c0267d5..a6fa790f9c 100644 --- a/modules/video_coding/deprecated/BUILD.gn +++ b/modules/video_coding/deprecated/BUILD.gn @@ -15,7 +15,7 @@ rtc_library("nack_module") { ] deps = [ - "..:nack_module", + "..:nack_requester", "../..:module_api", "../../../api/units:time_delta", "../../../api/units:timestamp", diff --git a/modules/video_coding/nack_module2.cc b/modules/video_coding/nack_requester.cc similarity index 85% rename from modules/video_coding/nack_module2.cc rename to modules/video_coding/nack_requester.cc index 41a5b31cd2..6983576367 100644 --- a/modules/video_coding/nack_module2.cc +++ b/modules/video_coding/nack_requester.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "modules/video_coding/nack_module2.h" +#include "modules/video_coding/nack_requester.h" #include #include @@ -52,7 +52,7 @@ NackPeriodicProcessor::NackPeriodicProcessor(TimeDelta update_interval) NackPeriodicProcessor::~NackPeriodicProcessor() {} -void NackPeriodicProcessor::RegisterNackModule(NackModuleBase* module) { +void NackPeriodicProcessor::RegisterNackModule(NackRequesterBase* module) { RTC_DCHECK_RUN_ON(&sequence_); modules_.push_back(module); if (modules_.size() != 1) @@ -65,7 +65,7 @@ void NackPeriodicProcessor::RegisterNackModule(NackModuleBase* module) { }); } -void NackPeriodicProcessor::UnregisterNackModule(NackModuleBase* module) { +void NackPeriodicProcessor::UnregisterNackModule(NackRequesterBase* module) { RTC_DCHECK_RUN_ON(&sequence_); auto it = std::find(modules_.begin(), modules_.end(), module); RTC_DCHECK(it != modules_.end()); @@ -76,12 +76,12 @@ void NackPeriodicProcessor::UnregisterNackModule(NackModuleBase* module) { // RTC_RUN_ON(sequence_) void NackPeriodicProcessor::ProcessNackModules() { - for (NackModuleBase* module : modules_) + for (NackRequesterBase* module : modules_) module->ProcessNacks(); } ScopedNackPeriodicProcessorRegistration:: - ScopedNackPeriodicProcessorRegistration(NackModuleBase* module, + ScopedNackPeriodicProcessorRegistration(NackRequesterBase* module, NackPeriodicProcessor* processor) : module_(module), processor_(processor) { processor_->RegisterNackModule(module_); @@ -92,25 +92,25 @@ ScopedNackPeriodicProcessorRegistration:: processor_->UnregisterNackModule(module_); } -NackModule2::NackInfo::NackInfo() +NackRequester::NackInfo::NackInfo() : seq_num(0), send_at_seq_num(0), sent_at_time(-1), retries(0) {} -NackModule2::NackInfo::NackInfo(uint16_t seq_num, - uint16_t send_at_seq_num, - int64_t created_at_time) +NackRequester::NackInfo::NackInfo(uint16_t seq_num, + uint16_t send_at_seq_num, + int64_t created_at_time) : seq_num(seq_num), send_at_seq_num(send_at_seq_num), created_at_time(created_at_time), sent_at_time(-1), retries(0) {} -NackModule2::BackoffSettings::BackoffSettings(TimeDelta min_retry, - TimeDelta max_rtt, - double base) +NackRequester::BackoffSettings::BackoffSettings(TimeDelta min_retry, + TimeDelta max_rtt, + double base) : min_retry_interval(min_retry), max_rtt(max_rtt), base(base) {} -absl::optional -NackModule2::BackoffSettings::ParseFromFieldTrials() { +absl::optional +NackRequester::BackoffSettings::ParseFromFieldTrials() { // Matches magic number in RTPSender::OnReceivedNack(). const TimeDelta kDefaultMinRetryInterval = TimeDelta::Millis(5); // Upper bound on link-delay considered for exponential backoff. @@ -129,17 +129,17 @@ NackModule2::BackoffSettings::ParseFromFieldTrials() { field_trial::FindFullName("WebRTC-ExponentialNackBackoff")); if (enabled) { - return NackModule2::BackoffSettings(min_retry.Get(), max_rtt.Get(), - base.Get()); + return NackRequester::BackoffSettings(min_retry.Get(), max_rtt.Get(), + base.Get()); } return absl::nullopt; } -NackModule2::NackModule2(TaskQueueBase* current_queue, - NackPeriodicProcessor* periodic_processor, - Clock* clock, - NackSender* nack_sender, - KeyFrameRequestSender* keyframe_request_sender) +NackRequester::NackRequester(TaskQueueBase* current_queue, + NackPeriodicProcessor* periodic_processor, + Clock* clock, + NackSender* nack_sender, + KeyFrameRequestSender* keyframe_request_sender) : worker_thread_(current_queue), clock_(clock), nack_sender_(nack_sender), @@ -158,11 +158,11 @@ NackModule2::NackModule2(TaskQueueBase* current_queue, RTC_DCHECK(worker_thread_->IsCurrent()); } -NackModule2::~NackModule2() { +NackRequester::~NackRequester() { RTC_DCHECK_RUN_ON(worker_thread_); } -void NackModule2::ProcessNacks() { +void NackRequester::ProcessNacks() { RTC_DCHECK_RUN_ON(worker_thread_); std::vector nack_batch = GetNackBatch(kTimeOnly); if (!nack_batch.empty()) { @@ -172,14 +172,14 @@ void NackModule2::ProcessNacks() { } } -int NackModule2::OnReceivedPacket(uint16_t seq_num, bool is_keyframe) { +int NackRequester::OnReceivedPacket(uint16_t seq_num, bool is_keyframe) { RTC_DCHECK_RUN_ON(worker_thread_); return OnReceivedPacket(seq_num, is_keyframe, false); } -int NackModule2::OnReceivedPacket(uint16_t seq_num, - bool is_keyframe, - bool is_recovered) { +int NackRequester::OnReceivedPacket(uint16_t seq_num, + bool is_keyframe, + bool is_recovered) { RTC_DCHECK_RUN_ON(worker_thread_); // TODO(philipel): When the packet includes information whether it is // retransmitted or not, use that value instead. For @@ -248,7 +248,7 @@ int NackModule2::OnReceivedPacket(uint16_t seq_num, return 0; } -void NackModule2::ClearUpTo(uint16_t seq_num) { +void NackRequester::ClearUpTo(uint16_t seq_num) { // Called via RtpVideoStreamReceiver2::FrameContinuous on the network thread. worker_thread_->PostTask(ToQueuedTask(task_safety_, [seq_num, this]() { RTC_DCHECK_RUN_ON(worker_thread_); @@ -260,12 +260,12 @@ void NackModule2::ClearUpTo(uint16_t seq_num) { })); } -void NackModule2::UpdateRtt(int64_t rtt_ms) { +void NackRequester::UpdateRtt(int64_t rtt_ms) { RTC_DCHECK_RUN_ON(worker_thread_); rtt_ms_ = rtt_ms; } -bool NackModule2::RemovePacketsUntilKeyFrame() { +bool NackRequester::RemovePacketsUntilKeyFrame() { // Called on worker_thread_. while (!keyframe_list_.empty()) { auto it = nack_list_.lower_bound(*keyframe_list_.begin()); @@ -284,8 +284,8 @@ bool NackModule2::RemovePacketsUntilKeyFrame() { return false; } -void NackModule2::AddPacketsToNack(uint16_t seq_num_start, - uint16_t seq_num_end) { +void NackRequester::AddPacketsToNack(uint16_t seq_num_start, + uint16_t seq_num_end) { // Called on worker_thread_. // Remove old packets. auto it = nack_list_.lower_bound(seq_num_end - kMaxPacketAge); @@ -320,7 +320,7 @@ void NackModule2::AddPacketsToNack(uint16_t seq_num_start, } } -std::vector NackModule2::GetNackBatch(NackFilterOptions options) { +std::vector NackRequester::GetNackBatch(NackFilterOptions options) { // Called on worker_thread_. bool consider_seq_num = options != kTimeOnly; @@ -367,14 +367,14 @@ std::vector NackModule2::GetNackBatch(NackFilterOptions options) { return nack_batch; } -void NackModule2::UpdateReorderingStatistics(uint16_t seq_num) { +void NackRequester::UpdateReorderingStatistics(uint16_t seq_num) { // Running on worker_thread_. RTC_DCHECK(AheadOf(newest_seq_num_, seq_num)); uint16_t diff = ReverseDiff(newest_seq_num_, seq_num); reordering_histogram_.Add(diff); } -int NackModule2::WaitNumberOfPackets(float probability) const { +int NackRequester::WaitNumberOfPackets(float probability) const { // Called on worker_thread_; if (reordering_histogram_.NumValues() == 0) return 0; diff --git a/modules/video_coding/nack_module2.h b/modules/video_coding/nack_requester.h similarity index 83% rename from modules/video_coding/nack_module2.h rename to modules/video_coding/nack_requester.h index f1f212c94f..8b012379e2 100644 --- a/modules/video_coding/nack_module2.h +++ b/modules/video_coding/nack_requester.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef MODULES_VIDEO_CODING_NACK_MODULE2_H_ -#define MODULES_VIDEO_CODING_NACK_MODULE2_H_ +#ifndef MODULES_VIDEO_CODING_NACK_REQUESTER_H_ +#define MODULES_VIDEO_CODING_NACK_REQUESTER_H_ #include @@ -30,9 +30,9 @@ namespace webrtc { -class NackModuleBase { +class NackRequesterBase { public: - virtual ~NackModuleBase() = default; + virtual ~NackRequesterBase() = default; virtual void ProcessNacks() = 0; }; @@ -41,40 +41,37 @@ class NackPeriodicProcessor { static constexpr TimeDelta kUpdateInterval = TimeDelta::Millis(20); explicit NackPeriodicProcessor(TimeDelta update_interval = kUpdateInterval); ~NackPeriodicProcessor(); - void RegisterNackModule(NackModuleBase* module); - void UnregisterNackModule(NackModuleBase* module); + void RegisterNackModule(NackRequesterBase* module); + void UnregisterNackModule(NackRequesterBase* module); private: void ProcessNackModules() RTC_RUN_ON(sequence_); const TimeDelta update_interval_; RepeatingTaskHandle repeating_task_ RTC_GUARDED_BY(sequence_); - std::vector modules_ RTC_GUARDED_BY(sequence_); + std::vector modules_ RTC_GUARDED_BY(sequence_); RTC_NO_UNIQUE_ADDRESS SequenceChecker sequence_; }; class ScopedNackPeriodicProcessorRegistration { public: - ScopedNackPeriodicProcessorRegistration(NackModuleBase* module, + ScopedNackPeriodicProcessorRegistration(NackRequesterBase* module, NackPeriodicProcessor* processor); ~ScopedNackPeriodicProcessorRegistration(); private: - NackModuleBase* const module_; + NackRequesterBase* const module_; NackPeriodicProcessor* const processor_; }; -// TODO(bugs.webrtc.org/11594): This class no longer implements the Module -// interface and therefore "NackModule" may not be a descriptive name anymore. -// Consider renaming to e.g. NackTracker or NackRequester. -class NackModule2 final : public NackModuleBase { +class NackRequester final : public NackRequesterBase { public: - NackModule2(TaskQueueBase* current_queue, - NackPeriodicProcessor* periodic_processor, - Clock* clock, - NackSender* nack_sender, - KeyFrameRequestSender* keyframe_request_sender); - ~NackModule2(); + NackRequester(TaskQueueBase* current_queue, + NackPeriodicProcessor* periodic_processor, + Clock* clock, + NackSender* nack_sender, + KeyFrameRequestSender* keyframe_request_sender); + ~NackRequester(); void ProcessNacks() override; @@ -168,4 +165,4 @@ class NackModule2 final : public NackModuleBase { } // namespace webrtc -#endif // MODULES_VIDEO_CODING_NACK_MODULE2_H_ +#endif // MODULES_VIDEO_CODING_NACK_REQUESTER_H_ diff --git a/modules/video_coding/nack_module2_unittest.cc b/modules/video_coding/nack_requester_unittest.cc similarity index 84% rename from modules/video_coding/nack_module2_unittest.cc rename to modules/video_coding/nack_requester_unittest.cc index 7ffcc12891..c9659e37ea 100644 --- a/modules/video_coding/nack_module2_unittest.cc +++ b/modules/video_coding/nack_requester_unittest.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "modules/video_coding/nack_module2.h" +#include "modules/video_coding/nack_requester.h" #include #include @@ -24,11 +24,11 @@ namespace webrtc { // TODO(bugs.webrtc.org/11594): Use the use the GlobalSimulatedTimeController // instead of RunLoop. At the moment we mix use of the Clock and the underlying // implementation of RunLoop, which is realtime. -class TestNackModule2 : public ::testing::TestWithParam, - public NackSender, - public KeyFrameRequestSender { +class TestNackRequester : public ::testing::TestWithParam, + public NackSender, + public KeyFrameRequestSender { protected: - TestNackModule2() + TestNackRequester() : clock_(new SimulatedClock(0)), field_trial_(GetParam() ? "WebRTC-ExponentialNackBackoff/enabled:true/" @@ -79,14 +79,14 @@ class TestNackModule2 : public ::testing::TestWithParam, return true; } - NackModule2& CreateNackModule( + NackRequester& CreateNackModule( TimeDelta interval = NackPeriodicProcessor::kUpdateInterval) { RTC_DCHECK(!nack_module_.get()); nack_periodic_processor_ = std::make_unique(interval); - nack_module_ = std::make_unique(TaskQueueBase::Current(), - nack_periodic_processor_.get(), - clock_.get(), this, this); + nack_module_ = std::make_unique( + TaskQueueBase::Current(), nack_periodic_processor_.get(), clock_.get(), + this, this); nack_module_->UpdateRtt(kDefaultRttMs); return *nack_module_.get(); } @@ -96,23 +96,23 @@ class TestNackModule2 : public ::testing::TestWithParam, std::unique_ptr clock_; test::ScopedFieldTrials field_trial_; std::unique_ptr nack_periodic_processor_; - std::unique_ptr nack_module_; + std::unique_ptr nack_module_; std::vector sent_nacks_; int keyframes_requested_; bool waiting_for_send_nack_ = false; bool timed_out_ = false; }; -TEST_P(TestNackModule2, NackOnePacket) { - NackModule2& nack_module = CreateNackModule(); +TEST_P(TestNackRequester, NackOnePacket) { + NackRequester& nack_module = CreateNackModule(); nack_module.OnReceivedPacket(1, false, false); nack_module.OnReceivedPacket(3, false, false); ASSERT_EQ(1u, sent_nacks_.size()); EXPECT_EQ(2, sent_nacks_[0]); } -TEST_P(TestNackModule2, WrappingSeqNum) { - NackModule2& nack_module = CreateNackModule(); +TEST_P(TestNackRequester, WrappingSeqNum) { + NackRequester& nack_module = CreateNackModule(); nack_module.OnReceivedPacket(0xfffe, false, false); nack_module.OnReceivedPacket(1, false, false); ASSERT_EQ(2u, sent_nacks_.size()); @@ -120,8 +120,8 @@ TEST_P(TestNackModule2, WrappingSeqNum) { EXPECT_EQ(0, sent_nacks_[1]); } -TEST_P(TestNackModule2, WrappingSeqNumClearToKeyframe) { - NackModule2& nack_module = CreateNackModule(TimeDelta::Millis(10)); +TEST_P(TestNackRequester, WrappingSeqNumClearToKeyframe) { + NackRequester& nack_module = CreateNackModule(TimeDelta::Millis(10)); nack_module.OnReceivedPacket(0xfffe, false, false); nack_module.OnReceivedPacket(1, false, false); ASSERT_EQ(2u, sent_nacks_.size()); @@ -185,8 +185,8 @@ TEST_P(TestNackModule2, WrappingSeqNumClearToKeyframe) { EXPECT_EQ(1006, sent_nacks_[502]); } -TEST_P(TestNackModule2, ResendNack) { - NackModule2& nack_module = CreateNackModule(TimeDelta::Millis(1)); +TEST_P(TestNackRequester, ResendNack) { + NackRequester& nack_module = CreateNackModule(TimeDelta::Millis(1)); nack_module.OnReceivedPacket(1, false, false); nack_module.OnReceivedPacket(3, false, false); size_t expected_nacks_sent = 1; @@ -239,8 +239,8 @@ TEST_P(TestNackModule2, ResendNack) { EXPECT_EQ(expected_nacks_sent, sent_nacks_.size()); } -TEST_P(TestNackModule2, ResendPacketMaxRetries) { - NackModule2& nack_module = CreateNackModule(TimeDelta::Millis(1)); +TEST_P(TestNackRequester, ResendPacketMaxRetries) { + NackRequester& nack_module = CreateNackModule(TimeDelta::Millis(1)); nack_module.OnReceivedPacket(1, false, false); nack_module.OnReceivedPacket(3, false, false); ASSERT_EQ(1u, sent_nacks_.size()); @@ -260,8 +260,8 @@ TEST_P(TestNackModule2, ResendPacketMaxRetries) { EXPECT_EQ(10u, sent_nacks_.size()); } -TEST_P(TestNackModule2, TooLargeNackList) { - NackModule2& nack_module = CreateNackModule(); +TEST_P(TestNackRequester, TooLargeNackList) { + NackRequester& nack_module = CreateNackModule(); nack_module.OnReceivedPacket(0, false, false); nack_module.OnReceivedPacket(1001, false, false); EXPECT_EQ(1000u, sent_nacks_.size()); @@ -274,8 +274,8 @@ TEST_P(TestNackModule2, TooLargeNackList) { EXPECT_EQ(1, keyframes_requested_); } -TEST_P(TestNackModule2, TooLargeNackListWithKeyFrame) { - NackModule2& nack_module = CreateNackModule(); +TEST_P(TestNackRequester, TooLargeNackListWithKeyFrame) { + NackRequester& nack_module = CreateNackModule(); nack_module.OnReceivedPacket(0, false, false); nack_module.OnReceivedPacket(1, true, false); nack_module.OnReceivedPacket(1001, false, false); @@ -289,8 +289,8 @@ TEST_P(TestNackModule2, TooLargeNackListWithKeyFrame) { EXPECT_EQ(1, keyframes_requested_); } -TEST_P(TestNackModule2, ClearUpTo) { - NackModule2& nack_module = CreateNackModule(TimeDelta::Millis(1)); +TEST_P(TestNackRequester, ClearUpTo) { + NackRequester& nack_module = CreateNackModule(TimeDelta::Millis(1)); nack_module.OnReceivedPacket(0, false, false); nack_module.OnReceivedPacket(100, false, false); EXPECT_EQ(99u, sent_nacks_.size()); @@ -303,8 +303,8 @@ TEST_P(TestNackModule2, ClearUpTo) { EXPECT_EQ(50, sent_nacks_[0]); } -TEST_P(TestNackModule2, ClearUpToWrap) { - NackModule2& nack_module = CreateNackModule(); +TEST_P(TestNackRequester, ClearUpToWrap) { + NackRequester& nack_module = CreateNackModule(); nack_module.OnReceivedPacket(0xfff0, false, false); nack_module.OnReceivedPacket(0xf, false, false); EXPECT_EQ(30u, sent_nacks_.size()); @@ -317,8 +317,8 @@ TEST_P(TestNackModule2, ClearUpToWrap) { EXPECT_EQ(0, sent_nacks_[0]); } -TEST_P(TestNackModule2, PacketNackCount) { - NackModule2& nack_module = CreateNackModule(TimeDelta::Millis(1)); +TEST_P(TestNackRequester, PacketNackCount) { + NackRequester& nack_module = CreateNackModule(TimeDelta::Millis(1)); EXPECT_EQ(0, nack_module.OnReceivedPacket(0, false, false)); EXPECT_EQ(0, nack_module.OnReceivedPacket(2, false, false)); EXPECT_EQ(1, nack_module.OnReceivedPacket(1, false, false)); @@ -340,8 +340,8 @@ TEST_P(TestNackModule2, PacketNackCount) { EXPECT_EQ(0, nack_module.OnReceivedPacket(4, false, false)); } -TEST_P(TestNackModule2, NackListFullAndNoOverlapWithKeyframes) { - NackModule2& nack_module = CreateNackModule(); +TEST_P(TestNackRequester, NackListFullAndNoOverlapWithKeyframes) { + NackRequester& nack_module = CreateNackModule(); const int kMaxNackPackets = 1000; const unsigned int kFirstGap = kMaxNackPackets - 20; const unsigned int kSecondGap = 200; @@ -356,8 +356,8 @@ TEST_P(TestNackModule2, NackListFullAndNoOverlapWithKeyframes) { EXPECT_EQ(kSecondGap, sent_nacks_.size()); } -TEST_P(TestNackModule2, HandleFecRecoveredPacket) { - NackModule2& nack_module = CreateNackModule(); +TEST_P(TestNackRequester, HandleFecRecoveredPacket) { + NackRequester& nack_module = CreateNackModule(); nack_module.OnReceivedPacket(1, false, false); nack_module.OnReceivedPacket(4, false, true); EXPECT_EQ(0u, sent_nacks_.size()); @@ -365,22 +365,22 @@ TEST_P(TestNackModule2, HandleFecRecoveredPacket) { EXPECT_EQ(2u, sent_nacks_.size()); } -TEST_P(TestNackModule2, SendNackWithoutDelay) { - NackModule2& nack_module = CreateNackModule(); +TEST_P(TestNackRequester, SendNackWithoutDelay) { + NackRequester& nack_module = CreateNackModule(); nack_module.OnReceivedPacket(0, false, false); nack_module.OnReceivedPacket(100, false, false); EXPECT_EQ(99u, sent_nacks_.size()); } INSTANTIATE_TEST_SUITE_P(WithAndWithoutBackoff, - TestNackModule2, + TestNackRequester, ::testing::Values(true, false)); -class TestNackModule2WithFieldTrial : public ::testing::Test, - public NackSender, - public KeyFrameRequestSender { +class TestNackRequesterWithFieldTrial : public ::testing::Test, + public NackSender, + public KeyFrameRequestSender { protected: - TestNackModule2WithFieldTrial() + TestNackRequesterWithFieldTrial() : nack_delay_field_trial_("WebRTC-SendNackDelayMs/10/"), clock_(new SimulatedClock(0)), nack_module_(TaskQueueBase::Current(), @@ -401,12 +401,12 @@ class TestNackModule2WithFieldTrial : public ::testing::Test, test::ScopedFieldTrials nack_delay_field_trial_; std::unique_ptr clock_; NackPeriodicProcessor nack_periodic_processor_; - NackModule2 nack_module_; + NackRequester nack_module_; std::vector sent_nacks_; int keyframes_requested_; }; -TEST_F(TestNackModule2WithFieldTrial, SendNackWithDelay) { +TEST_F(TestNackRequesterWithFieldTrial, SendNackWithDelay) { nack_module_.OnReceivedPacket(0, false, false); nack_module_.OnReceivedPacket(100, false, false); EXPECT_EQ(0u, sent_nacks_.size()); diff --git a/video/BUILD.gn b/video/BUILD.gn index 7743aba944..4bdd94f345 100644 --- a/video/BUILD.gn +++ b/video/BUILD.gn @@ -95,7 +95,7 @@ rtc_library("video") { "../modules/utility", "../modules/video_coding", "../modules/video_coding:codec_globals_headers", - "../modules/video_coding:nack_module", + "../modules/video_coding:nack_requester", "../modules/video_coding:video_codec_interface", "../modules/video_coding:video_coding_utility", "../modules/video_processing", diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc index 8929ab4f1c..daddae9433 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -39,7 +39,7 @@ #include "modules/video_coding/frame_object.h" #include "modules/video_coding/h264_sprop_parameter_sets.h" #include "modules/video_coding/h264_sps_pps_tracker.h" -#include "modules/video_coding/nack_module2.h" +#include "modules/video_coding/nack_requester.h" #include "modules/video_coding/packet_buffer.h" #include "rtc_base/checks.h" #include "rtc_base/location.h" @@ -103,7 +103,7 @@ std::unique_ptr CreateRtpRtcpModule( return rtp_rtcp; } -std::unique_ptr MaybeConstructNackModule( +std::unique_ptr MaybeConstructNackModule( TaskQueueBase* current_queue, NackPeriodicProcessor* nack_periodic_processor, const VideoReceiveStream::Config& config, @@ -114,9 +114,9 @@ std::unique_ptr MaybeConstructNackModule( return nullptr; // TODO(bugs.webrtc.org/12420): pass rtp_history_ms to the nack module. - return std::make_unique(current_queue, nack_periodic_processor, - clock, nack_sender, - keyframe_request_sender); + return std::make_unique(current_queue, nack_periodic_processor, + clock, nack_sender, + keyframe_request_sender); } static const int kPacketLogIntervalMs = 10000; diff --git a/video/rtp_video_stream_receiver2.h b/video/rtp_video_stream_receiver2.h index d97f5211a7..3b20e1c53b 100644 --- a/video/rtp_video_stream_receiver2.h +++ b/video/rtp_video_stream_receiver2.h @@ -39,7 +39,7 @@ #include "modules/rtp_rtcp/source/video_rtp_depacketizer.h" #include "modules/video_coding/h264_sps_pps_tracker.h" #include "modules/video_coding/loss_notification_controller.h" -#include "modules/video_coding/nack_module2.h" +#include "modules/video_coding/nack_requester.h" #include "modules/video_coding/packet_buffer.h" #include "modules/video_coding/rtp_frame_reference_finder.h" #include "modules/video_coding/unique_timestamp_counter.h" @@ -53,7 +53,7 @@ namespace webrtc { -class NackModule2; +class NackRequester; class PacketRouter; class ReceiveStatistics; class RtcpRttStats; @@ -316,7 +316,7 @@ class RtpVideoStreamReceiver2 : public LossNotificationSender, KeyFrameRequestSender* const keyframe_request_sender_; RtcpFeedbackBuffer rtcp_feedback_buffer_; - const std::unique_ptr nack_module_; + const std::unique_ptr nack_module_; std::unique_ptr loss_notification_controller_; video_coding::PacketBuffer packet_buffer_ diff --git a/video/video_receive_stream2.h b/video/video_receive_stream2.h index 9ed5942453..2d19514abd 100644 --- a/video/video_receive_stream2.h +++ b/video/video_receive_stream2.h @@ -25,7 +25,7 @@ #include "modules/rtp_rtcp/include/flexfec_receiver.h" #include "modules/rtp_rtcp/source/source_tracker.h" #include "modules/video_coding/frame_buffer2.h" -#include "modules/video_coding/nack_module2.h" +#include "modules/video_coding/nack_requester.h" #include "modules/video_coding/video_receiver2.h" #include "rtc_base/system/no_unique_address.h" #include "rtc_base/task_queue.h" From 0d6d9488ae5183b5f0ebe7617dbfc4d13df37a8c Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Fri, 16 Jul 2021 03:13:37 +0900 Subject: [PATCH 0077/1565] Rename release_aar.py and modify it for validation of aar file. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As announced in the google groups [1], the pre-built Android aar is no longer distributed and last update was August 2020. [2] So we can remove the code that uploads aar to bintray in release_aar.py. Still, the ability to create an Android aar and use it in a gradle project (examples/aarproject) is useful. It can also be used to validate aar by running PeerConnectionClientTest from examples/androidtests. So I renamed release_aar.py to test_aar.py and make it working without releasing the aar to an external hosting server. This makes it easy to verify further changes to the aar. [1] https://groups.google.com/g/discuss-webrtc/c/Ozvbd0p7Q1Y/m/TtQyRI1KAgAJ [2] https://mvnrepository.com/artifact/org.webrtc/google-webrtc?repo=bt-google-webrtc Bug: webrtc:11962 Change-Id: Ibe066a3a770569924e3b57805986808e1dd19df6 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/220622 Commit-Queue: Byoungchan Lee Reviewed-by: Xavier Lepaul‎ Cr-Commit-Position: refs/heads/master@{#34540} --- examples/aarproject/app/build.gradle | 7 +- tools_webrtc/android/release_aar.py | 307 --------------------------- tools_webrtc/android/test_aar.py | 145 +++++++++++++ 3 files changed, 149 insertions(+), 310 deletions(-) delete mode 100644 tools_webrtc/android/release_aar.py create mode 100755 tools_webrtc/android/test_aar.py diff --git a/examples/aarproject/app/build.gradle b/examples/aarproject/app/build.gradle index b4f2acdbdd..77dc3703ee 100644 --- a/examples/aarproject/app/build.gradle +++ b/examples/aarproject/app/build.gradle @@ -42,10 +42,11 @@ android { } dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) + if (project.hasProperty('aarDir')) { + implementation fileTree(dir: project.aarDir, include: ['google-webrtc-*.aar']) + } implementation fileTree(dir: '../../androidapp/third_party/autobanh/lib', include: ['autobanh.jar']) - implementation 'com.android.support:appcompat-v7:26.1.0' - implementation 'org.webrtc:google-webrtc:1.0.+' + implementation 'com.android.support:support-annotations:26.1.0' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' diff --git a/tools_webrtc/android/release_aar.py b/tools_webrtc/android/release_aar.py deleted file mode 100644 index bc7f471ae3..0000000000 --- a/tools_webrtc/android/release_aar.py +++ /dev/null @@ -1,307 +0,0 @@ -#!/usr/bin/env python - -# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. -# -# Use of this source code is governed by a BSD-style license -# that can be found in the LICENSE file in the root of the source -# tree. An additional intellectual property rights grant can be found -# in the file PATENTS. All contributing project authors may -# be found in the AUTHORS file in the root of the source tree. -"""Script for publishing WebRTC AAR on Bintray. - -Set BINTRAY_USER and BINTRAY_API_KEY environment variables before running -this script for authentication. -""" - -import argparse -import json -import logging -import os -import re -import shutil -import subprocess -import sys -import tempfile -import time - -SCRIPT_DIR = os.path.dirname(os.path.realpath(sys.argv[0])) -CHECKOUT_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir, os.pardir)) - -sys.path.append(os.path.join(CHECKOUT_ROOT, 'third_party')) -import requests -import jinja2 - -sys.path.append(os.path.join(CHECKOUT_ROOT, 'tools_webrtc')) -from android.build_aar import BuildAar - -ARCHS = ['armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'] -MAVEN_REPOSITORY = 'https://google.bintray.com/webrtc' -API = 'https://api.bintray.com' -PACKAGE_PATH = 'google/webrtc/google-webrtc' -CONTENT_API = API + '/content/' + PACKAGE_PATH -PACKAGES_API = API + '/packages/' + PACKAGE_PATH -GROUP_ID = 'org/webrtc' -ARTIFACT_ID = 'google-webrtc' -COMMIT_POSITION_REGEX = r'^Cr-Commit-Position: refs/heads/master@{#(\d+)}$' -API_TIMEOUT_SECONDS = 10.0 -UPLOAD_TRIES = 3 -# The sleep time is increased exponentially. -UPLOAD_RETRY_BASE_SLEEP_SECONDS = 2.0 -GRADLEW_BIN = os.path.join(CHECKOUT_ROOT, - 'examples/androidtests/third_party/gradle/gradlew') -ADB_BIN = os.path.join(CHECKOUT_ROOT, - 'third_party/android_sdk/public/platform-tools/adb') -AAR_PROJECT_DIR = os.path.join(CHECKOUT_ROOT, 'examples/aarproject') -AAR_PROJECT_GRADLE = os.path.join(AAR_PROJECT_DIR, 'build.gradle') -AAR_PROJECT_APP_GRADLE = os.path.join(AAR_PROJECT_DIR, 'app', 'build.gradle') -AAR_PROJECT_DEPENDENCY = "implementation 'org.webrtc:google-webrtc:1.0.+'" -AAR_PROJECT_VERSION_DEPENDENCY = "implementation 'org.webrtc:google-webrtc:%s'" - - -def _ParseArgs(): - parser = argparse.ArgumentParser(description='Releases WebRTC on Bintray.') - parser.add_argument('--use-goma', - action='store_true', - default=False, - help='Use goma.') - parser.add_argument('--skip-tests', - action='store_true', - default=False, - help='Skips running the tests.') - parser.add_argument( - '--publish', - action='store_true', - default=False, - help='Automatically publishes the library if the tests pass.') - parser.add_argument( - '--build-dir', - default=None, - help='Temporary directory to store the build files. If not specified, ' - 'a new directory will be created.') - parser.add_argument('--verbose', - action='store_true', - default=False, - help='Debug logging.') - return parser.parse_args() - - -def _GetCommitHash(): - commit_hash = subprocess.check_output(['git', 'rev-parse', 'HEAD'], - cwd=CHECKOUT_ROOT).strip() - return commit_hash - - -def _GetCommitPos(): - commit_message = subprocess.check_output( - ['git', 'rev-list', '--format=%B', '--max-count=1', 'HEAD'], - cwd=CHECKOUT_ROOT) - commit_pos_match = re.search(COMMIT_POSITION_REGEX, commit_message, - re.MULTILINE) - if not commit_pos_match: - raise Exception('Commit position not found in the commit message: %s' % - commit_message) - return commit_pos_match.group(1) - - -def _UploadFile(user, password, filename, version, target_file): - # URL is of format: - # ///// - # Example: - # https://api.bintray.com/content/google/webrtc/google-webrtc/1.0.19742/org/webrtc/google-webrtc/1.0.19742/google-webrtc-1.0.19742.aar - - target_dir = version + '/' + GROUP_ID + '/' + ARTIFACT_ID + '/' + version - target_path = target_dir + '/' + target_file - url = CONTENT_API + '/' + target_path - - logging.info('Uploading %s to %s', filename, url) - with open(filename) as fh: - file_data = fh.read() - - for attempt in xrange(UPLOAD_TRIES): - try: - response = requests.put(url, - data=file_data, - auth=(user, password), - timeout=API_TIMEOUT_SECONDS) - break - except requests.exceptions.Timeout as e: - logging.warning('Timeout while uploading: %s', e) - time.sleep(UPLOAD_RETRY_BASE_SLEEP_SECONDS**attempt) - else: - raise Exception('Failed to upload %s' % filename) - - if not response.ok: - raise Exception('Failed to upload %s. Response: %s' % - (filename, response)) - logging.info('Uploaded %s: %s', filename, response) - - -def _GeneratePom(target_file, version, commit): - env = jinja2.Environment(loader=jinja2.PackageLoader('release_aar'), ) - template = env.get_template('pom.jinja') - pom = template.render(version=version, commit=commit) - with open(target_file, 'w') as fh: - fh.write(pom) - - -def _TestAAR(tmp_dir, username, password, version): - """Runs AppRTCMobile tests using the AAR. Returns true if the tests pass.""" - logging.info('Testing library.') - env = jinja2.Environment(loader=jinja2.PackageLoader('release_aar'), ) - - gradle_backup = os.path.join(tmp_dir, 'build.gradle.backup') - app_gradle_backup = os.path.join(tmp_dir, 'app-build.gradle.backup') - - # Make backup copies of the project files before modifying them. - shutil.copy2(AAR_PROJECT_GRADLE, gradle_backup) - shutil.copy2(AAR_PROJECT_APP_GRADLE, app_gradle_backup) - - try: - maven_repository_template = env.get_template('maven-repository.jinja') - maven_repository = maven_repository_template.render( - url=MAVEN_REPOSITORY, username=username, password=password) - - # Append Maven repository to build file to download unpublished files. - with open(AAR_PROJECT_GRADLE, 'a') as gradle_file: - gradle_file.write(maven_repository) - - # Read app build file. - with open(AAR_PROJECT_APP_GRADLE, 'r') as gradle_app_file: - gradle_app = gradle_app_file.read() - - if AAR_PROJECT_DEPENDENCY not in gradle_app: - raise Exception('%s not found in the build file.' % - AAR_PROJECT_DEPENDENCY) - # Set version to the version to be tested. - target_dependency = AAR_PROJECT_VERSION_DEPENDENCY % version - gradle_app = gradle_app.replace(AAR_PROJECT_DEPENDENCY, - target_dependency) - - # Write back. - with open(AAR_PROJECT_APP_GRADLE, 'w') as gradle_app_file: - gradle_app_file.write(gradle_app) - - # Uninstall any existing version of AppRTCMobile. - logging.info( - 'Uninstalling previous AppRTCMobile versions. It is okay for ' - 'these commands to fail if AppRTCMobile is not installed.') - subprocess.call([ADB_BIN, 'uninstall', 'org.appspot.apprtc']) - subprocess.call([ADB_BIN, 'uninstall', 'org.appspot.apprtc.test']) - - # Run tests. - try: - # First clean the project. - subprocess.check_call([GRADLEW_BIN, 'clean'], cwd=AAR_PROJECT_DIR) - # Then run the tests. - subprocess.check_call([GRADLEW_BIN, 'connectedDebugAndroidTest'], - cwd=AAR_PROJECT_DIR) - except subprocess.CalledProcessError: - logging.exception('Test failure.') - return False # Clean or tests failed - - return True # Tests pass - finally: - # Restore backups. - shutil.copy2(gradle_backup, AAR_PROJECT_GRADLE) - shutil.copy2(app_gradle_backup, AAR_PROJECT_APP_GRADLE) - - -def _PublishAAR(user, password, version, additional_args): - args = { - 'publish_wait_for_secs': 0 # Publish asynchronously. - } - args.update(additional_args) - - url = CONTENT_API + '/' + version + '/publish' - response = requests.post(url, - data=json.dumps(args), - auth=(user, password), - timeout=API_TIMEOUT_SECONDS) - - if not response.ok: - raise Exception('Failed to publish. Response: %s' % response) - - -def _DeleteUnpublishedVersion(user, password, version): - url = PACKAGES_API + '/versions/' + version - response = requests.get(url, - auth=(user, password), - timeout=API_TIMEOUT_SECONDS) - if not response.ok: - raise Exception('Failed to get version info. Response: %s' % response) - - version_info = json.loads(response.content) - if version_info['published']: - logging.info('Version has already been published, not deleting.') - return - - logging.info('Deleting unpublished version.') - response = requests.delete(url, - auth=(user, password), - timeout=API_TIMEOUT_SECONDS) - if not response.ok: - raise Exception('Failed to delete version. Response: %s' % response) - - -def ReleaseAar(use_goma, skip_tests, publish, build_dir): - version = '1.0.' + _GetCommitPos() - commit = _GetCommitHash() - logging.info('Releasing AAR version %s with hash %s', version, commit) - - user = os.environ.get('BINTRAY_USER', None) - api_key = os.environ.get('BINTRAY_API_KEY', None) - if not user or not api_key: - raise Exception( - 'Environment variables BINTRAY_USER and BINTRAY_API_KEY ' - 'must be defined.') - - # If build directory is not specified, create a temporary directory. - use_tmp_dir = not build_dir - if use_tmp_dir: - build_dir = tempfile.mkdtemp() - - try: - base_name = ARTIFACT_ID + '-' + version - aar_file = os.path.join(build_dir, base_name + '.aar') - third_party_licenses_file = os.path.join(build_dir, 'LICENSE.md') - pom_file = os.path.join(build_dir, base_name + '.pom') - - logging.info('Building at %s', build_dir) - BuildAar(ARCHS, - aar_file, - use_goma=use_goma, - ext_build_dir=os.path.join(build_dir, 'aar-build')) - _GeneratePom(pom_file, version, commit) - - _UploadFile(user, api_key, aar_file, version, base_name + '.aar') - _UploadFile(user, api_key, third_party_licenses_file, version, - 'THIRD_PARTY_LICENSES.md') - _UploadFile(user, api_key, pom_file, version, base_name + '.pom') - - tests_pass = skip_tests or _TestAAR(build_dir, user, api_key, version) - if not tests_pass: - logging.info('Discarding library.') - _PublishAAR(user, api_key, version, {'discard': True}) - _DeleteUnpublishedVersion(user, api_key, version) - raise Exception('Test failure. Discarded library.') - - if publish: - logging.info('Publishing library.') - _PublishAAR(user, api_key, version, {}) - else: - logging.info( - 'Note: The library has not not been published automatically.' - ' Please do so manually if desired.') - finally: - if use_tmp_dir: - shutil.rmtree(build_dir, True) - - -def main(): - args = _ParseArgs() - logging.basicConfig(level=logging.DEBUG if args.verbose else logging.INFO) - ReleaseAar(args.use_goma, args.skip_tests, args.publish, args.build_dir) - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/tools_webrtc/android/test_aar.py b/tools_webrtc/android/test_aar.py new file mode 100755 index 0000000000..cb8ad121a2 --- /dev/null +++ b/tools_webrtc/android/test_aar.py @@ -0,0 +1,145 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. +"""Script for building and testing WebRTC AAR. +""" + +import argparse +import logging +import os +import re +import shutil +import subprocess +import sys +import tempfile + +SCRIPT_DIR = os.path.dirname(os.path.realpath(sys.argv[0])) +CHECKOUT_ROOT = os.path.abspath(os.path.join(SCRIPT_DIR, os.pardir, os.pardir)) + +sys.path.append(os.path.join(CHECKOUT_ROOT, 'tools_webrtc')) +from android.build_aar import BuildAar + +ARCHS = ['armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'] +ARTIFACT_ID = 'google-webrtc' +COMMIT_POSITION_REGEX = r'^Cr-Commit-Position: refs/heads/master@{#(\d+)}$' +GRADLEW_BIN = os.path.join(CHECKOUT_ROOT, + 'examples/androidtests/third_party/gradle/gradlew') +ADB_BIN = os.path.join(CHECKOUT_ROOT, + 'third_party/android_sdk/public/platform-tools/adb') +AAR_PROJECT_DIR = os.path.join(CHECKOUT_ROOT, 'examples/aarproject') + + +def _ParseArgs(): + parser = argparse.ArgumentParser(description='Releases WebRTC on Bintray.') + parser.add_argument('--use-goma', + action='store_true', + default=False, + help='Use goma.') + parser.add_argument('--skip-tests', + action='store_true', + default=False, + help='Skips running the tests.') + parser.add_argument( + '--build-dir', + default=None, + help='Temporary directory to store the build files. If not specified, ' + 'a new directory will be created.') + parser.add_argument('--verbose', + action='store_true', + default=False, + help='Debug logging.') + return parser.parse_args() + + +def _GetCommitHash(): + commit_hash = subprocess.check_output( + ['git', 'rev-parse', 'HEAD'], cwd=CHECKOUT_ROOT).decode('UTF-8').strip() + return commit_hash + + +def _GetCommitPos(): + commit_message = subprocess.check_output( + ['git', 'rev-list', '--format=%B', '--max-count=1', 'HEAD'], + cwd=CHECKOUT_ROOT).decode('UTF-8') + commit_pos_match = re.search(COMMIT_POSITION_REGEX, commit_message, + re.MULTILINE) + if not commit_pos_match: + raise Exception('Commit position not found in the commit message: %s' % + commit_message) + return commit_pos_match.group(1) + + +def _TestAAR(build_dir): + """Runs AppRTCMobile tests using the AAR. Returns true if the tests pass.""" + logging.info('Testing library.') + + # Uninstall any existing version of AppRTCMobile. + logging.info( + 'Uninstalling previous AppRTCMobile versions. It is okay for ' + 'these commands to fail if AppRTCMobile is not installed.') + subprocess.call([ADB_BIN, 'uninstall', 'org.appspot.apprtc']) + subprocess.call([ADB_BIN, 'uninstall', 'org.appspot.apprtc.test']) + + # Run tests. + try: + # First clean the project. + subprocess.check_call([GRADLEW_BIN, 'clean'], cwd=AAR_PROJECT_DIR) + # Then run the tests. + subprocess.check_call([ + GRADLEW_BIN, + 'connectedDebugAndroidTest', + '-PaarDir=' + os.path.abspath(build_dir)], + cwd=AAR_PROJECT_DIR) + except subprocess.CalledProcessError: + logging.exception('Test failure.') + return False # Clean or tests failed + + return True # Tests pass + + +def BuildAndTestAar(use_goma, skip_tests, build_dir): + version = '1.0.' + _GetCommitPos() + commit = _GetCommitHash() + logging.info( + 'Building and Testing AAR version %s with hash %s', version, commit) + + # If build directory is not specified, create a temporary directory. + use_tmp_dir = not build_dir + if use_tmp_dir: + build_dir = tempfile.mkdtemp() + + try: + base_name = ARTIFACT_ID + '-' + version + aar_file = os.path.join(build_dir, base_name + '.aar') + + logging.info('Building at %s', build_dir) + BuildAar(ARCHS, + aar_file, + use_goma=use_goma, + ext_build_dir=os.path.join(build_dir, 'aar-build')) + + tests_pass = skip_tests or _TestAAR(build_dir) + if not tests_pass: + raise Exception('Test failure.') + + logging.info('Test success.') + + finally: + if use_tmp_dir: + shutil.rmtree(build_dir, True) + + +def main(): + args = _ParseArgs() + logging.basicConfig(level=logging.DEBUG if args.verbose else logging.INFO) + BuildAndTestAar(args.use_goma, args.skip_tests, args.build_dir) + + +if __name__ == '__main__': + sys.exit(main()) From c1c6bef99aa49a0bb3f8e99378438e72ffa02fdb Mon Sep 17 00:00:00 2001 From: Markus Handell Date: Fri, 23 Jul 2021 11:11:32 +0200 Subject: [PATCH 0078/1565] RepeatingTask: equip with DTrace probes. This change permits dtrace wakeup profiling of Chromium production builds. Bug: webrtc:13013 Change-Id: Iff936f7ff03ba7ef349f2bc7d3826a7c8b1bb1b8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226461 Commit-Queue: Markus Handell Reviewed-by: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34541} --- rtc_base/task_utils/repeating_task.cc | 7 +++++++ rtc_base/task_utils/repeating_task.h | 14 +++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/rtc_base/task_utils/repeating_task.cc b/rtc_base/task_utils/repeating_task.cc index 9636680cb4..1f3eb1d064 100644 --- a/rtc_base/task_utils/repeating_task.cc +++ b/rtc_base/task_utils/repeating_task.cc @@ -70,4 +70,11 @@ bool RepeatingTaskHandle::Running() const { return repeating_task_ != nullptr; } +namespace webrtc_repeating_task_impl { +// These methods are empty, but can be externally equipped with actions using +// dtrace. +void RepeatingTaskHandleDTraceProbeStart() {} +void RepeatingTaskHandleDTraceProbeDelayedStart() {} +void RepeatingTaskImplDTraceProbeRun() {} +} // namespace webrtc_repeating_task_impl } // namespace webrtc diff --git a/rtc_base/task_utils/repeating_task.h b/rtc_base/task_utils/repeating_task.h index d5066fdb5c..91a40e0714 100644 --- a/rtc_base/task_utils/repeating_task.h +++ b/rtc_base/task_utils/repeating_task.h @@ -23,7 +23,14 @@ #include "system_wrappers/include/clock.h" namespace webrtc { + namespace webrtc_repeating_task_impl { + +// Methods simplifying external tracing of RepeatingTaskHandle operations. +void RepeatingTaskHandleDTraceProbeStart(); +void RepeatingTaskHandleDTraceProbeDelayedStart(); +void RepeatingTaskImplDTraceProbeRun(); + class RepeatingTaskBase : public QueuedTask { public: RepeatingTaskBase(TaskQueueBase* task_queue, @@ -67,7 +74,10 @@ class RepeatingTaskImpl final : public RepeatingTaskBase { } private: - TimeDelta RunClosure() override { return closure_(); } + TimeDelta RunClosure() override { + RepeatingTaskImplDTraceProbeRun(); + return closure_(); + } typename std::remove_const< typename std::remove_reference::type>::type closure_; @@ -98,6 +108,7 @@ class RepeatingTaskHandle { Closure&& closure, Clock* clock = Clock::GetRealTimeClock()) { auto alive_flag = PendingTaskSafetyFlag::CreateDetached(); + webrtc_repeating_task_impl::RepeatingTaskHandleDTraceProbeStart(); task_queue->PostTask( std::make_unique< webrtc_repeating_task_impl::RepeatingTaskImpl>( @@ -115,6 +126,7 @@ class RepeatingTaskHandle { Closure&& closure, Clock* clock = Clock::GetRealTimeClock()) { auto alive_flag = PendingTaskSafetyFlag::CreateDetached(); + webrtc_repeating_task_impl::RepeatingTaskHandleDTraceProbeDelayedStart(); task_queue->PostDelayedTask( std::make_unique< webrtc_repeating_task_impl::RepeatingTaskImpl>( From fd3b97c5d253e2ea40e88be087b37d1722134fa8 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Fri, 23 Jul 2021 16:26:28 +0200 Subject: [PATCH 0079/1565] Ensure release bots run with dchecks off. Follow-up of https://webrtc-review.googlesource.com/c/src/+/226563, inspired by V8's crrev.com/c/3048180. Bug: chromium:1225701, webrtc:12988 Change-Id: I0e2ab4fe72941d764fddab87b730645c62ae968d Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226864 Reviewed-by: Andrey Logvin Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34542} --- tools_webrtc/mb/mb_config.pyl | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tools_webrtc/mb/mb_config.pyl b/tools_webrtc/mb/mb_config.pyl index 74678f875e..c3c593e75d 100644 --- a/tools_webrtc/mb/mb_config.pyl +++ b/tools_webrtc/mb/mb_config.pyl @@ -459,8 +459,12 @@ 'gn_args': 'is_clang=true', }, + # This mixin also sets 'dcheck_always_on=true' to ensure Chromium's + # GN files (e.g. things in //build, etc..) agree with the value of + # 'rtc_dcheck_always_on' when they read 'dcheck_always_on'. + # See crbug.com/1231890#c9 for more info. 'rtc_dcheck_always_on': { - 'gn_args': 'rtc_dcheck_always_on=true', + 'gn_args': 'rtc_dcheck_always_on=true dcheck_always_on=true', }, 'debug': { @@ -539,14 +543,17 @@ 'gn_args': 'optimize_for_fuzzing=true', }, - 'pure_release_bot': { - 'mixins': ['release', 'goma'], - }, - 'release': { - 'gn_args': 'is_debug=false', + 'gn_args': 'is_debug=false dcheck_always_on=false', }, + # The 'pure_release_bot' configuration is for release bots that are doing a + # 100% release build without DCHECKs while 'release_bot' is a partial + # release configs since both `rtc_dcheck_always_on` and `dcheck_always_on` + # are set to true. + 'pure_release_bot': { + 'mixins': ['release', 'goma'], + }, 'release_bot': { 'mixins': ['pure_release_bot', 'rtc_dcheck_always_on'], }, From d4b087c6cf50f1843200b1514d20dfc23c7b81cc Mon Sep 17 00:00:00 2001 From: Sergey Silkin Date: Fri, 23 Jul 2021 16:28:55 +0200 Subject: [PATCH 0080/1565] Use **** code for codec of unknown type This allows dumping kVideoCodecGeneric to IVF. Bug: none Change-Id: I71ae5f11dc226f68aa60e4423556feb1af96d11c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226865 Reviewed-by: Ilya Nikolaevskiy Commit-Queue: Sergey Silkin Cr-Commit-Position: refs/heads/master@{#34543} --- modules/video_coding/utility/ivf_file_writer.cc | 9 +++++++-- modules/video_coding/utility/ivf_file_writer_unittest.cc | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/video_coding/utility/ivf_file_writer.cc b/modules/video_coding/utility/ivf_file_writer.cc index 496da894a1..77c90ee158 100644 --- a/modules/video_coding/utility/ivf_file_writer.cc +++ b/modules/video_coding/utility/ivf_file_writer.cc @@ -88,8 +88,13 @@ bool IvfFileWriter::WriteHeader() { ivf_header[11] = '4'; break; default: - RTC_LOG(LS_ERROR) << "Unknown CODEC type: " << codec_type_; - return false; + // For unknown codec type use **** code. You can specify actual payload + // format when playing the video with ffplay: ffplay -f H263 file.ivf + ivf_header[8] = '*'; + ivf_header[9] = '*'; + ivf_header[10] = '*'; + ivf_header[11] = '*'; + break; } ByteWriter::WriteLittleEndian(&ivf_header[12], width_); diff --git a/modules/video_coding/utility/ivf_file_writer_unittest.cc b/modules/video_coding/utility/ivf_file_writer_unittest.cc index 8e781a7b22..1a84d4441b 100644 --- a/modules/video_coding/utility/ivf_file_writer_unittest.cc +++ b/modules/video_coding/utility/ivf_file_writer_unittest.cc @@ -167,6 +167,11 @@ TEST_F(IvfFileWriterTest, WritesBasicH264FileMsTimestamp) { RunBasicFileStructureTest(kVideoCodecH264, fourcc, true); } +TEST_F(IvfFileWriterTest, WritesBasicUnknownCodecFileMsTimestamp) { + const uint8_t fourcc[4] = {'*', '*', '*', '*'}; + RunBasicFileStructureTest(kVideoCodecGeneric, fourcc, true); +} + TEST_F(IvfFileWriterTest, ClosesWhenReachesLimit) { const uint8_t fourcc[4] = {'V', 'P', '8', '0'}; const int kWidth = 320; From d2b885fd91909f1b17fb11292a8c989d5d883b22 Mon Sep 17 00:00:00 2001 From: Taylor Brandstetter Date: Thu, 22 Jul 2021 17:41:55 -0700 Subject: [PATCH 0081/1565] Fix bug where we assume new m= sections will always be bundled. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A recent change [1] assumes that all new m= sections will share the first BUNDLE group (if one already exists), which avoids generating ICE candidates that are ultimately unnecessary. This is fine for JSEP endpoints, but it breaks the following scenarios for non-JSEP endpoints: * Remote offer adding a new m= section that's not part of any BUNDLE group. * Remote offer adding an m= section to the second BUNDLE group. The latter is specifically problematic for any application that wants to bundle all audio streams in one group and all video streams in another group when using Unified Plan SDP, to replicate the behavior of using Plan B without bundling. It may try to add a video stream only for WebRTC to bundle it with audio. This is fixed by doing some minor re-factoring, having BundleManager update the bundle groups at offer time. Also: * Added some additional validation for multiple bundle groups in a subsequent offer, since that now becomes relevant. * Improved rollback support, because now rolling back an offer may need to not only remove mid->transport mappings but alter them. [1]: https://webrtc-review.googlesource.com/c/src/+/221601 Bug: webrtc:12906, webrtc:12999 Change-Id: I4c6e7020c0be33a782d3608dee88e4e2fceb1be1 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/225642 Reviewed-by: Harald Alvestrand Reviewed-by: Henrik Boström Commit-Queue: Taylor Brandstetter Cr-Commit-Position: refs/heads/master@{#34544} --- pc/jsep_transport_collection.cc | 145 ++++-- pc/jsep_transport_collection.h | 42 +- pc/jsep_transport_controller.cc | 108 +++-- pc/jsep_transport_controller.h | 7 +- pc/jsep_transport_controller_unittest.cc | 566 +++++++++++++++++++++++ pc/peer_connection_bundle_unittest.cc | 59 ++- pc/sdp_offer_answer.cc | 5 +- 7 files changed, 830 insertions(+), 102 deletions(-) diff --git a/pc/jsep_transport_collection.cc b/pc/jsep_transport_collection.cc index ce068d99fc..98b8cd2a3d 100644 --- a/pc/jsep_transport_collection.cc +++ b/pc/jsep_transport_collection.cc @@ -20,22 +20,54 @@ namespace webrtc { -void BundleManager::Update(const cricket::SessionDescription* description) { +void BundleManager::Update(const cricket::SessionDescription* description, + SdpType type) { RTC_DCHECK_RUN_ON(&sequence_checker_); - bundle_groups_.clear(); - for (const cricket::ContentGroup* new_bundle_group : - description->GetGroupsByName(cricket::GROUP_TYPE_BUNDLE)) { - bundle_groups_.push_back( - std::make_unique(*new_bundle_group)); - RTC_DLOG(LS_VERBOSE) << "Establishing bundle group " - << new_bundle_group->ToString(); - } - established_bundle_groups_by_mid_.clear(); - for (const auto& bundle_group : bundle_groups_) { - for (const std::string& content_name : bundle_group->content_names()) { - established_bundle_groups_by_mid_[content_name] = bundle_group.get(); + // Rollbacks should call Rollback, not Update. + RTC_DCHECK(type != SdpType::kRollback); + bool bundle_groups_changed = false; + // TODO(bugs.webrtc.org/3349): Do this for kPrAnswer as well. To make this + // work, we also need to make sure PRANSWERs don't call + // MaybeDestroyJsepTransport, because the final answer may need the destroyed + // transport if it changes the BUNDLE group. + if (bundle_policy_ == PeerConnectionInterface::kBundlePolicyMaxBundle || + type == SdpType::kAnswer) { + // If our policy is "max-bundle" or this is an answer, update all bundle + // groups. + bundle_groups_changed = true; + bundle_groups_.clear(); + for (const cricket::ContentGroup* new_bundle_group : + description->GetGroupsByName(cricket::GROUP_TYPE_BUNDLE)) { + bundle_groups_.push_back( + std::make_unique(*new_bundle_group)); + RTC_DLOG(LS_VERBOSE) << "Establishing bundle group " + << new_bundle_group->ToString(); + } + } else if (type == SdpType::kOffer) { + // If this is an offer, update existing bundle groups. + // We do this because as per RFC 8843, section 7.3.2, the answerer cannot + // remove an m= section from an existing BUNDLE group without rejecting it. + // Thus any m= sections added to a BUNDLE group in this offer can + // preemptively start using the bundled transport, as there is no possible + // non-bundled fallback. + for (const cricket::ContentGroup* new_bundle_group : + description->GetGroupsByName(cricket::GROUP_TYPE_BUNDLE)) { + // Attempt to find a matching existing group. + for (const std::string& mid : new_bundle_group->content_names()) { + auto it = established_bundle_groups_by_mid_.find(mid); + if (it != established_bundle_groups_by_mid_.end()) { + *it->second = *new_bundle_group; + bundle_groups_changed = true; + RTC_DLOG(LS_VERBOSE) + << "Establishing bundle group " << new_bundle_group->ToString(); + break; + } + } } } + if (bundle_groups_changed) { + RefreshEstablishedBundleGroupsByMid(); + } } const cricket::ContentGroup* BundleManager::LookupGroupByMid( @@ -92,6 +124,34 @@ void BundleManager::DeleteGroup(const cricket::ContentGroup* bundle_group) { bundle_groups_.erase(bundle_group_it); } +void BundleManager::Rollback() { + RTC_DCHECK_RUN_ON(&sequence_checker_); + bundle_groups_.clear(); + for (const auto& bundle_group : stable_bundle_groups_) { + bundle_groups_.push_back( + std::make_unique(*bundle_group)); + } + RefreshEstablishedBundleGroupsByMid(); +} + +void BundleManager::Commit() { + RTC_DCHECK_RUN_ON(&sequence_checker_); + stable_bundle_groups_.clear(); + for (const auto& bundle_group : bundle_groups_) { + stable_bundle_groups_.push_back( + std::make_unique(*bundle_group)); + } +} + +void BundleManager::RefreshEstablishedBundleGroupsByMid() { + established_bundle_groups_by_mid_.clear(); + for (const auto& bundle_group : bundle_groups_) { + for (const std::string& content_name : bundle_group->content_names()) { + established_bundle_groups_by_mid_[content_name] = bundle_group.get(); + } + } +} + void JsepTransportCollection::RegisterTransport( const std::string& mid, std::unique_ptr transport) { @@ -157,8 +217,6 @@ bool JsepTransportCollection::SetTransportForMid( if (it != mid_to_transport_.end() && it->second == jsep_transport) return true; - pending_mids_.push_back(mid); - // The map_change_callback must be called before destroying the // transport, because it removes references to the transport // in the RTP demuxer. @@ -191,17 +249,33 @@ void JsepTransportCollection::RemoveTransportForMid(const std::string& mid) { RTC_DCHECK(IsConsistent()); } -void JsepTransportCollection::RollbackTransports() { +bool JsepTransportCollection::RollbackTransports() { RTC_DCHECK_RUN_ON(&sequence_checker_); - for (auto&& mid : pending_mids_) { - RemoveTransportForMid(mid); + bool ret = true; + // First, remove any new mid->transport mappings. + for (const auto& kv : mid_to_transport_) { + if (stable_mid_to_transport_.count(kv.first) == 0) { + ret = ret && map_change_callback_(kv.first, nullptr); + } + } + // Next, restore old mappings. + for (const auto& kv : stable_mid_to_transport_) { + auto it = mid_to_transport_.find(kv.first); + if (it == mid_to_transport_.end() || it->second != kv.second) { + ret = ret && map_change_callback_(kv.first, kv.second); + } } - pending_mids_.clear(); + mid_to_transport_ = stable_mid_to_transport_; + DestroyUnusedTransports(); + RTC_DCHECK(IsConsistent()); + return ret; } void JsepTransportCollection::CommitTransports() { RTC_DCHECK_RUN_ON(&sequence_checker_); - pending_mids_.clear(); + stable_mid_to_transport_ = mid_to_transport_; + DestroyUnusedTransports(); + RTC_DCHECK(IsConsistent()); } bool JsepTransportCollection::TransportInUse( @@ -212,6 +286,11 @@ bool JsepTransportCollection::TransportInUse( return true; } } + for (const auto& kv : stable_mid_to_transport_) { + if (kv.second == jsep_transport) { + return true; + } + } return false; } @@ -219,7 +298,7 @@ void JsepTransportCollection::MaybeDestroyJsepTransport( cricket::JsepTransport* transport) { RTC_DCHECK_RUN_ON(&sequence_checker_); // Don't destroy the JsepTransport if there are still media sections referring - // to it. + // to it, or if it will be needed in case of rollback. if (TransportInUse(transport)) { return; } @@ -233,6 +312,23 @@ void JsepTransportCollection::MaybeDestroyJsepTransport( RTC_DCHECK(IsConsistent()); } +void JsepTransportCollection::DestroyUnusedTransports() { + RTC_DCHECK_RUN_ON(&sequence_checker_); + bool need_state_change_callback = false; + auto it = jsep_transports_by_name_.begin(); + while (it != jsep_transports_by_name_.end()) { + if (TransportInUse(it->second.get())) { + ++it; + } else { + it = jsep_transports_by_name_.erase(it); + need_state_change_callback = true; + } + } + if (need_state_change_callback) { + state_change_callback_(); + } +} + bool JsepTransportCollection::IsConsistent() { RTC_DCHECK_RUN_ON(&sequence_checker_); for (const auto& it : jsep_transports_by_name_) { @@ -241,13 +337,6 @@ bool JsepTransportCollection::IsConsistent() { << " is not in use, transport " << it.second.get(); return false; } - const auto& lookup = mid_to_transport_.find(it.first); - if (lookup->second != it.second.get()) { - // Not an error, but unusual. - RTC_DLOG(LS_INFO) << "Note: Mid " << it.first << " was registered to " - << it.second.get() << " but currently maps to " - << lookup->second; - } } return true; } diff --git a/pc/jsep_transport_collection.h b/pc/jsep_transport_collection.h index 0dd528d348..93570379ac 100644 --- a/pc/jsep_transport_collection.h +++ b/pc/jsep_transport_collection.h @@ -18,6 +18,7 @@ #include #include +#include "api/peer_connection_interface.h" #include "api/sequence_checker.h" #include "pc/jsep_transport.h" #include "pc/session_description.h" @@ -41,7 +42,8 @@ namespace webrtc { // 6) Change the logic to do what's right. class BundleManager { public: - BundleManager() { + explicit BundleManager(PeerConnectionInterface::BundlePolicy bundle_policy) + : bundle_policy_(bundle_policy) { // Allow constructor to be called on a different thread. sequence_checker_.Detach(); } @@ -58,17 +60,27 @@ class BundleManager { bool IsFirstMidInGroup(const std::string& mid) const; // Update the groups description. This completely replaces the group // description with the one from the SessionDescription. - void Update(const cricket::SessionDescription* description); + void Update(const cricket::SessionDescription* description, SdpType type); // Delete a MID from the group that contains it. void DeleteMid(const cricket::ContentGroup* bundle_group, const std::string& mid); // Delete a group. void DeleteGroup(const cricket::ContentGroup* bundle_group); + // Roll back to previous stable state. + void Rollback(); + // Commit current bundle groups. + void Commit(); private: + // Recalculate established_bundle_groups_by_mid_ from bundle_groups_. + void RefreshEstablishedBundleGroupsByMid() RTC_RUN_ON(sequence_checker_); + RTC_NO_UNIQUE_ADDRESS SequenceChecker sequence_checker_; + PeerConnectionInterface::BundlePolicy bundle_policy_; std::vector> bundle_groups_ RTC_GUARDED_BY(sequence_checker_); + std::vector> stable_bundle_groups_ + RTC_GUARDED_BY(sequence_checker_); std::map established_bundle_groups_by_mid_; }; @@ -108,17 +120,25 @@ class JsepTransportCollection { // Remove a transport for a MID. This may destroy a transport if it is // no longer in use. void RemoveTransportForMid(const std::string& mid); - // Roll back pending mid-to-transport mappings. - void RollbackTransports(); - // Commit pending mid-transport mappings (rollback is no longer possible). + // Roll back to previous stable mid-to-transport mappings. + bool RollbackTransports(); + // Commit pending mid-transport mappings (rollback is no longer possible), + // and destroy unused transports because we know now we'll never need them + // again. void CommitTransports(); - // Returns true if any mid currently maps to this transport. - bool TransportInUse(cricket::JsepTransport* jsep_transport) const; private: - // Destroy a transport if it's no longer in use. + // Returns true if any mid currently maps to this transport, in either the + // pending or stable mapping. + bool TransportInUse(cricket::JsepTransport* jsep_transport) const; + + // Destroy a transport if it's no longer in use. This includes whether it + // will be needed in case of rollback. void MaybeDestroyJsepTransport(cricket::JsepTransport* transport); + // Destroys all transports that are no longer in use. + void DestroyUnusedTransports(); + bool IsConsistent(); // For testing only: Verify internal structure. RTC_NO_UNIQUE_ADDRESS SequenceChecker sequence_checker_; @@ -130,8 +150,10 @@ class JsepTransportCollection { // (BaseChannel/SctpTransport) and the JsepTransport underneath. std::map mid_to_transport_ RTC_GUARDED_BY(sequence_checker_); - // Keep track of mids that have been mapped to transports. Used for rollback. - std::vector pending_mids_ RTC_GUARDED_BY(sequence_checker_); + // A snapshot of mid_to_transport_ at the last stable state. Used for + // rollback. + std::map stable_mid_to_transport_ + RTC_GUARDED_BY(sequence_checker_); // Callback used to inform subscribers of altered transports. const std::function diff --git a/pc/jsep_transport_controller.cc b/pc/jsep_transport_controller.cc index 47fddd4e3e..8b9596b64e 100644 --- a/pc/jsep_transport_controller.cc +++ b/pc/jsep_transport_controller.cc @@ -55,7 +55,8 @@ JsepTransportController::JsepTransportController( UpdateAggregateStates_n(); }), config_(config), - active_reset_srtp_params_(config.active_reset_srtp_params) { + active_reset_srtp_params_(config.active_reset_srtp_params), + bundles_(config.bundle_policy) { // The |transport_observer| is assumed to be non-null. RTC_DCHECK(config_.transport_observer); RTC_DCHECK(config_.rtcp_handler); @@ -374,13 +375,18 @@ void JsepTransportController::SetActiveResetSrtpParams( } } -void JsepTransportController::RollbackTransports() { +RTCError JsepTransportController::RollbackTransports() { if (!network_thread_->IsCurrent()) { - network_thread_->Invoke(RTC_FROM_HERE, [=] { RollbackTransports(); }); - return; + return network_thread_->Invoke( + RTC_FROM_HERE, [=] { return RollbackTransports(); }); } RTC_DCHECK_RUN_ON(network_thread_); - transports_.RollbackTransports(); + bundles_.Rollback(); + if (!transports_.RollbackTransports()) { + LOG_AND_RETURN_ERROR(RTCErrorType::INTERNAL_ERROR, + "Failed to roll back transport state."); + } + return RTCError::OK(); } rtc::scoped_refptr @@ -551,17 +557,6 @@ RTCError JsepTransportController::ApplyDescription_n( MergeEncryptedHeaderExtensionIdsForBundles(description); } - // Because the creation of transports depends on whether - // certain mids are present, we have to process rejection - // before we try to create transports. - for (size_t i = 0; i < description->contents().size(); ++i) { - const cricket::ContentInfo& content_info = description->contents()[i]; - if (content_info.rejected) { - // This may cause groups to be removed from |bundles_.bundle_groups()|. - HandleRejectedContent(content_info); - } - } - for (const cricket::ContentInfo& content_info : description->contents()) { // Don't create transports for rejected m-lines and bundled m-lines. if (content_info.rejected || @@ -582,6 +577,8 @@ RTCError JsepTransportController::ApplyDescription_n( description->transport_infos()[i]; if (content_info.rejected) { + // This may cause groups to be removed from |bundles_.bundle_groups()|. + HandleRejectedContent(content_info); continue; } @@ -647,6 +644,7 @@ RTCError JsepTransportController::ApplyDescription_n( } if (type == SdpType::kAnswer) { transports_.CommitTransports(); + bundles_.Commit(); } return RTCError::OK(); } @@ -682,7 +680,44 @@ RTCError JsepTransportController::ValidateAndMaybeUpdateBundleGroups( } } - if (type == SdpType::kAnswer) { + if (type == SdpType::kOffer) { + // For an offer, we need to verify that there is not a conflicting mapping + // between existing and new bundle groups. For example, if the existing + // groups are [[1,2],[3,4]] and new are [[1,3],[2,4]] or [[1,2,3,4]], or + // vice versa. Switching things around like this requires a separate offer + // that removes the relevant sections from their group, as per RFC 8843, + // section 7.5.2. + std::map + new_bundle_groups_by_existing_bundle_groups; + std::map + existing_bundle_groups_by_new_bundle_groups; + for (const cricket::ContentGroup* new_bundle_group : new_bundle_groups) { + for (const std::string& mid : new_bundle_group->content_names()) { + cricket::ContentGroup* existing_bundle_group = + bundles_.LookupGroupByMid(mid); + if (!existing_bundle_group) { + continue; + } + auto it = new_bundle_groups_by_existing_bundle_groups.find( + existing_bundle_group); + if (it != new_bundle_groups_by_existing_bundle_groups.end() && + it->second != new_bundle_group) { + return RTCError(RTCErrorType::INVALID_PARAMETER, + "MID " + mid + " in the offer has changed group."); + } + new_bundle_groups_by_existing_bundle_groups.insert( + std::make_pair(existing_bundle_group, new_bundle_group)); + it = existing_bundle_groups_by_new_bundle_groups.find(new_bundle_group); + if (it != existing_bundle_groups_by_new_bundle_groups.end() && + it->second != existing_bundle_group) { + return RTCError(RTCErrorType::INVALID_PARAMETER, + "MID " + mid + " in the offer has changed group."); + } + existing_bundle_groups_by_new_bundle_groups.insert( + std::make_pair(new_bundle_group, existing_bundle_group)); + } + } + } else if (type == SdpType::kAnswer) { std::vector offered_bundle_groups = local ? remote_desc_->GetGroupsByName(cricket::GROUP_TYPE_BUNDLE) : local_desc_->GetGroupsByName(cricket::GROUP_TYPE_BUNDLE); @@ -762,9 +797,7 @@ RTCError JsepTransportController::ValidateAndMaybeUpdateBundleGroups( "max-bundle is used but no bundle group found."); } - if (ShouldUpdateBundleGroup(type, description)) { - bundles_.Update(description); - } + bundles_.Update(description, type); for (const auto& bundle_group : bundles_.bundle_groups()) { if (!bundle_group->FirstContentName()) @@ -872,26 +905,6 @@ JsepTransportController::CreateJsepTransportDescription( rtp_abs_sendtime_extn_id, transport_info.description); } -bool JsepTransportController::ShouldUpdateBundleGroup( - SdpType type, - const cricket::SessionDescription* description) { - if (config_.bundle_policy == - PeerConnectionInterface::kBundlePolicyMaxBundle) { - return true; - } - - if (type != SdpType::kAnswer) { - return false; - } - - RTC_DCHECK(local_desc_ && remote_desc_); - std::vector local_bundles = - local_desc_->GetGroupsByName(cricket::GROUP_TYPE_BUNDLE); - std::vector remote_bundles = - remote_desc_->GetGroupsByName(cricket::GROUP_TYPE_BUNDLE); - return !local_bundles.empty() && !remote_bundles.empty(); -} - std::vector JsepTransportController::GetEncryptedHeaderExtensionIds( const cricket::ContentInfo& content_info) { const cricket::MediaContentDescription* content_desc = @@ -987,21 +1000,6 @@ RTCError JsepTransportController::MaybeCreateJsepTransport( if (transport) { return RTCError::OK(); } - // If we have agreed to a bundle, the new mid will be added to the bundle - // according to JSEP, and the responder can't move it out of the group - // according to BUNDLE. So don't create a transport. - // The MID will be added to the bundle elsewhere in the code. - if (bundles_.bundle_groups().size() > 0) { - const auto& default_bundle_group = bundles_.bundle_groups()[0]; - if (default_bundle_group->content_names().size() > 0) { - auto bundle_transport = - GetJsepTransportByName(default_bundle_group->content_names()[0]); - if (bundle_transport) { - transports_.SetTransportForMid(content_info.name, bundle_transport); - return RTCError::OK(); - } - } - } const cricket::MediaContentDescription* content_desc = content_info.media_description(); if (certificate_ && !content_desc->cryptos().empty()) { diff --git a/pc/jsep_transport_controller.h b/pc/jsep_transport_controller.h index 71b01bffb2..3b20bbb5a9 100644 --- a/pc/jsep_transport_controller.h +++ b/pc/jsep_transport_controller.h @@ -224,9 +224,7 @@ class JsepTransportController : public sigslot::has_slots<> { void SetActiveResetSrtpParams(bool active_reset_srtp_params); - // For now the rollback only removes mid to transport mappings - // and deletes unused transports, but doesn't consider anything more complex. - void RollbackTransports(); + RTCError RollbackTransports(); // F: void(const std::string&, const std::vector&) template @@ -342,9 +340,6 @@ class JsepTransportController : public sigslot::has_slots<> { const std::vector& encrypted_extension_ids, int rtp_abs_sendtime_extn_id); - bool ShouldUpdateBundleGroup(SdpType type, - const cricket::SessionDescription* description); - std::map> MergeEncryptedHeaderExtensionIdsForBundles( const cricket::SessionDescription* description); diff --git a/pc/jsep_transport_controller_unittest.cc b/pc/jsep_transport_controller_unittest.cc index a06f5804e4..bc7cfebdb9 100644 --- a/pc/jsep_transport_controller_unittest.cc +++ b/pc/jsep_transport_controller_unittest.cc @@ -1608,6 +1608,356 @@ TEST_F(JsepTransportControllerTest, MultipleBundleGroupsChangeFirstMid) { EXPECT_EQ(mid5_transport, mid6_transport); } +TEST_F(JsepTransportControllerTest, + MultipleBundleGroupsSectionsAddedInSubsequentOffer) { + static const char kMid1Audio[] = "1_audio"; + static const char kMid2Audio[] = "2_audio"; + static const char kMid3Audio[] = "3_audio"; + static const char kMid4Video[] = "4_video"; + static const char kMid5Video[] = "5_video"; + static const char kMid6Video[] = "6_video"; + + CreateJsepTransportController(JsepTransportController::Config()); + // Start by grouping (kMid1Audio,kMid2Audio) and (kMid4Video,kMid4f5Video). + cricket::ContentGroup bundle_group1(cricket::GROUP_TYPE_BUNDLE); + bundle_group1.AddContentName(kMid1Audio); + bundle_group1.AddContentName(kMid2Audio); + cricket::ContentGroup bundle_group2(cricket::GROUP_TYPE_BUNDLE); + bundle_group2.AddContentName(kMid4Video); + bundle_group2.AddContentName(kMid5Video); + + auto local_offer = std::make_unique(); + AddAudioSection(local_offer.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddAudioSection(local_offer.get(), kMid2Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(local_offer.get(), kMid4Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(local_offer.get(), kMid5Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + local_offer->AddGroup(bundle_group1); + local_offer->AddGroup(bundle_group2); + + auto remote_answer = std::make_unique(); + AddAudioSection(remote_answer.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddAudioSection(remote_answer.get(), kMid2Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(remote_answer.get(), kMid4Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(remote_answer.get(), kMid5Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + remote_answer->AddGroup(bundle_group1); + remote_answer->AddGroup(bundle_group2); + + EXPECT_TRUE(transport_controller_ + ->SetLocalDescription(SdpType::kOffer, local_offer.get()) + .ok()); + EXPECT_TRUE(transport_controller_ + ->SetRemoteDescription(SdpType::kAnswer, remote_answer.get()) + .ok()); + + // Add kMid3Audio and kMid6Video to the respective audio/video bundle groups. + cricket::ContentGroup new_bundle_group1(cricket::GROUP_TYPE_BUNDLE); + bundle_group1.AddContentName(kMid3Audio); + cricket::ContentGroup new_bundle_group2(cricket::GROUP_TYPE_BUNDLE); + bundle_group2.AddContentName(kMid6Video); + + auto subsequent_offer = std::make_unique(); + AddAudioSection(subsequent_offer.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddAudioSection(subsequent_offer.get(), kMid2Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddAudioSection(subsequent_offer.get(), kMid3Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(subsequent_offer.get(), kMid4Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(subsequent_offer.get(), kMid5Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(subsequent_offer.get(), kMid6Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + subsequent_offer->AddGroup(bundle_group1); + subsequent_offer->AddGroup(bundle_group2); + EXPECT_TRUE(transport_controller_ + ->SetLocalDescription(SdpType::kOffer, subsequent_offer.get()) + .ok()); + auto mid1_transport = transport_controller_->GetRtpTransport(kMid1Audio); + auto mid2_transport = transport_controller_->GetRtpTransport(kMid2Audio); + auto mid3_transport = transport_controller_->GetRtpTransport(kMid3Audio); + auto mid4_transport = transport_controller_->GetRtpTransport(kMid4Video); + auto mid5_transport = transport_controller_->GetRtpTransport(kMid5Video); + auto mid6_transport = transport_controller_->GetRtpTransport(kMid6Video); + EXPECT_NE(mid1_transport, mid4_transport); + EXPECT_EQ(mid1_transport, mid2_transport); + EXPECT_EQ(mid2_transport, mid3_transport); + EXPECT_EQ(mid4_transport, mid5_transport); + EXPECT_EQ(mid5_transport, mid6_transport); +} + +TEST_F(JsepTransportControllerTest, + MultipleBundleGroupsCombinedInSubsequentOffer) { + static const char kMid1Audio[] = "1_audio"; + static const char kMid2Audio[] = "2_audio"; + static const char kMid3Video[] = "3_video"; + static const char kMid4Video[] = "4_video"; + + CreateJsepTransportController(JsepTransportController::Config()); + // Start by grouping (kMid1Audio,kMid2Audio) and (kMid3Video,kMid4Video). + cricket::ContentGroup bundle_group1(cricket::GROUP_TYPE_BUNDLE); + bundle_group1.AddContentName(kMid1Audio); + bundle_group1.AddContentName(kMid2Audio); + cricket::ContentGroup bundle_group2(cricket::GROUP_TYPE_BUNDLE); + bundle_group2.AddContentName(kMid3Video); + bundle_group2.AddContentName(kMid4Video); + + auto local_offer = std::make_unique(); + AddAudioSection(local_offer.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddAudioSection(local_offer.get(), kMid2Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(local_offer.get(), kMid3Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(local_offer.get(), kMid4Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + local_offer->AddGroup(bundle_group1); + local_offer->AddGroup(bundle_group2); + + auto remote_answer = std::make_unique(); + AddAudioSection(remote_answer.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddAudioSection(remote_answer.get(), kMid2Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(remote_answer.get(), kMid3Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(remote_answer.get(), kMid4Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + remote_answer->AddGroup(bundle_group1); + remote_answer->AddGroup(bundle_group2); + + EXPECT_TRUE(transport_controller_ + ->SetLocalDescription(SdpType::kOffer, local_offer.get()) + .ok()); + EXPECT_TRUE(transport_controller_ + ->SetRemoteDescription(SdpType::kAnswer, remote_answer.get()) + .ok()); + + // Switch to grouping (kMid1Audio,kMid2Audio,kMid3Video,kMid4Video). + // This is a illegal without first removing m= sections from their groups. + cricket::ContentGroup new_bundle_group(cricket::GROUP_TYPE_BUNDLE); + new_bundle_group.AddContentName(kMid1Audio); + new_bundle_group.AddContentName(kMid2Audio); + new_bundle_group.AddContentName(kMid3Video); + new_bundle_group.AddContentName(kMid4Video); + + auto subsequent_offer = std::make_unique(); + AddAudioSection(subsequent_offer.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddAudioSection(subsequent_offer.get(), kMid2Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(subsequent_offer.get(), kMid3Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(subsequent_offer.get(), kMid4Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + subsequent_offer->AddGroup(new_bundle_group); + EXPECT_FALSE( + transport_controller_ + ->SetLocalDescription(SdpType::kOffer, subsequent_offer.get()) + .ok()); +} + +TEST_F(JsepTransportControllerTest, + MultipleBundleGroupsSplitInSubsequentOffer) { + static const char kMid1Audio[] = "1_audio"; + static const char kMid2Audio[] = "2_audio"; + static const char kMid3Video[] = "3_video"; + static const char kMid4Video[] = "4_video"; + + CreateJsepTransportController(JsepTransportController::Config()); + // Start by grouping (kMid1Audio,kMid2Audio,kMid3Video,kMid4Video). + cricket::ContentGroup bundle_group(cricket::GROUP_TYPE_BUNDLE); + bundle_group.AddContentName(kMid1Audio); + bundle_group.AddContentName(kMid2Audio); + bundle_group.AddContentName(kMid3Video); + bundle_group.AddContentName(kMid4Video); + + auto local_offer = std::make_unique(); + AddAudioSection(local_offer.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddAudioSection(local_offer.get(), kMid2Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(local_offer.get(), kMid3Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(local_offer.get(), kMid4Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + local_offer->AddGroup(bundle_group); + + auto remote_answer = std::make_unique(); + AddAudioSection(remote_answer.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddAudioSection(remote_answer.get(), kMid2Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(remote_answer.get(), kMid3Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(remote_answer.get(), kMid4Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + remote_answer->AddGroup(bundle_group); + + EXPECT_TRUE(transport_controller_ + ->SetLocalDescription(SdpType::kOffer, local_offer.get()) + .ok()); + EXPECT_TRUE(transport_controller_ + ->SetRemoteDescription(SdpType::kAnswer, remote_answer.get()) + .ok()); + + // Switch to grouping (kMid1Audio,kMid2Audio) and (kMid3Video,kMid4Video). + // This is a illegal without first removing m= sections from their groups. + cricket::ContentGroup new_bundle_group1(cricket::GROUP_TYPE_BUNDLE); + new_bundle_group1.AddContentName(kMid1Audio); + new_bundle_group1.AddContentName(kMid2Audio); + cricket::ContentGroup new_bundle_group2(cricket::GROUP_TYPE_BUNDLE); + new_bundle_group2.AddContentName(kMid3Video); + new_bundle_group2.AddContentName(kMid4Video); + + auto subsequent_offer = std::make_unique(); + AddAudioSection(subsequent_offer.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddAudioSection(subsequent_offer.get(), kMid2Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(subsequent_offer.get(), kMid3Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(subsequent_offer.get(), kMid4Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + subsequent_offer->AddGroup(new_bundle_group1); + subsequent_offer->AddGroup(new_bundle_group2); + EXPECT_FALSE( + transport_controller_ + ->SetLocalDescription(SdpType::kOffer, subsequent_offer.get()) + .ok()); +} + +TEST_F(JsepTransportControllerTest, + MultipleBundleGroupsShuffledInSubsequentOffer) { + static const char kMid1Audio[] = "1_audio"; + static const char kMid2Audio[] = "2_audio"; + static const char kMid3Video[] = "3_video"; + static const char kMid4Video[] = "4_video"; + + CreateJsepTransportController(JsepTransportController::Config()); + // Start by grouping (kMid1Audio,kMid2Audio) and (kMid3Video,kMid4Video). + cricket::ContentGroup bundle_group1(cricket::GROUP_TYPE_BUNDLE); + bundle_group1.AddContentName(kMid1Audio); + bundle_group1.AddContentName(kMid2Audio); + cricket::ContentGroup bundle_group2(cricket::GROUP_TYPE_BUNDLE); + bundle_group2.AddContentName(kMid3Video); + bundle_group2.AddContentName(kMid4Video); + + auto local_offer = std::make_unique(); + AddAudioSection(local_offer.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddAudioSection(local_offer.get(), kMid2Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(local_offer.get(), kMid3Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(local_offer.get(), kMid4Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + local_offer->AddGroup(bundle_group1); + local_offer->AddGroup(bundle_group2); + + auto remote_answer = std::make_unique(); + AddAudioSection(remote_answer.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddAudioSection(remote_answer.get(), kMid2Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(remote_answer.get(), kMid3Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(remote_answer.get(), kMid4Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + remote_answer->AddGroup(bundle_group1); + remote_answer->AddGroup(bundle_group2); + + EXPECT_TRUE(transport_controller_ + ->SetLocalDescription(SdpType::kOffer, local_offer.get()) + .ok()); + EXPECT_TRUE(transport_controller_ + ->SetRemoteDescription(SdpType::kAnswer, remote_answer.get()) + .ok()); + + // Switch to grouping (kMid1Audio,kMid3Video) and (kMid2Audio,kMid3Video). + // This is a illegal without first removing m= sections from their groups. + cricket::ContentGroup new_bundle_group1(cricket::GROUP_TYPE_BUNDLE); + new_bundle_group1.AddContentName(kMid1Audio); + new_bundle_group1.AddContentName(kMid3Video); + cricket::ContentGroup new_bundle_group2(cricket::GROUP_TYPE_BUNDLE); + new_bundle_group2.AddContentName(kMid2Audio); + new_bundle_group2.AddContentName(kMid4Video); + + auto subsequent_offer = std::make_unique(); + AddAudioSection(subsequent_offer.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddAudioSection(subsequent_offer.get(), kMid2Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(subsequent_offer.get(), kMid3Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(subsequent_offer.get(), kMid4Video, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + subsequent_offer->AddGroup(new_bundle_group1); + subsequent_offer->AddGroup(new_bundle_group2); + EXPECT_FALSE( + transport_controller_ + ->SetLocalDescription(SdpType::kOffer, subsequent_offer.get()) + .ok()); +} + // Tests that only a subset of all the m= sections are bundled. TEST_F(JsepTransportControllerTest, BundleSubsetOfMediaSections) { CreateJsepTransportController(JsepTransportController::Config()); @@ -2059,4 +2409,220 @@ TEST_F(JsepTransportControllerTest, ChangeTaggedMediaSectionMaxBundle) { .ok()); } +TEST_F(JsepTransportControllerTest, RollbackRestoresRejectedTransport) { + static const char kMid1Audio[] = "1_audio"; + + // Perform initial offer/answer. + CreateJsepTransportController(JsepTransportController::Config()); + auto local_offer = std::make_unique(); + AddAudioSection(local_offer.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + std::unique_ptr remote_answer( + local_offer->Clone()); + EXPECT_TRUE(transport_controller_ + ->SetLocalDescription(SdpType::kOffer, local_offer.get()) + .ok()); + EXPECT_TRUE(transport_controller_ + ->SetRemoteDescription(SdpType::kAnswer, remote_answer.get()) + .ok()); + + auto mid1_transport = transport_controller_->GetRtpTransport(kMid1Audio); + + // Apply a reoffer which rejects the m= section, causing the transport to be + // set to null. + auto local_reoffer = std::make_unique(); + AddAudioSection(local_reoffer.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + local_reoffer->contents()[0].rejected = true; + + EXPECT_TRUE(transport_controller_ + ->SetLocalDescription(SdpType::kOffer, local_reoffer.get()) + .ok()); + auto old_mid1_transport = mid1_transport; + mid1_transport = transport_controller_->GetRtpTransport(kMid1Audio); + EXPECT_EQ(nullptr, mid1_transport); + + // Rolling back shouldn't just create a new transport for MID 1, it should + // restore the old transport. + EXPECT_TRUE(transport_controller_->RollbackTransports().ok()); + mid1_transport = transport_controller_->GetRtpTransport(kMid1Audio); + EXPECT_EQ(old_mid1_transport, mid1_transport); +} + +// If an offer with a modified BUNDLE group causes a MID->transport mapping to +// change, rollback should restore the previous mapping. +TEST_F(JsepTransportControllerTest, RollbackRestoresPreviousTransportMapping) { + static const char kMid1Audio[] = "1_audio"; + static const char kMid2Audio[] = "2_audio"; + static const char kMid3Audio[] = "3_audio"; + + // Perform an initial offer/answer to establish a (kMid1Audio,kMid2Audio) + // group. + CreateJsepTransportController(JsepTransportController::Config()); + cricket::ContentGroup bundle_group(cricket::GROUP_TYPE_BUNDLE); + bundle_group.AddContentName(kMid1Audio); + bundle_group.AddContentName(kMid2Audio); + + auto local_offer = std::make_unique(); + AddAudioSection(local_offer.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(local_offer.get(), kMid2Audio, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddAudioSection(local_offer.get(), kMid3Audio, kIceUfrag3, kIcePwd3, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + local_offer->AddGroup(bundle_group); + + std::unique_ptr remote_answer( + local_offer->Clone()); + + EXPECT_TRUE(transport_controller_ + ->SetLocalDescription(SdpType::kOffer, local_offer.get()) + .ok()); + EXPECT_TRUE(transport_controller_ + ->SetRemoteDescription(SdpType::kAnswer, remote_answer.get()) + .ok()); + + auto mid1_transport = transport_controller_->GetRtpTransport(kMid1Audio); + auto mid2_transport = transport_controller_->GetRtpTransport(kMid2Audio); + auto mid3_transport = transport_controller_->GetRtpTransport(kMid3Audio); + EXPECT_EQ(mid1_transport, mid2_transport); + EXPECT_NE(mid1_transport, mid3_transport); + + // Apply a reoffer adding kMid3Audio to the group; transport mapping should + // change, even without an answer, since this is an existing group. + bundle_group.AddContentName(kMid3Audio); + auto local_reoffer = std::make_unique(); + AddAudioSection(local_reoffer.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(local_reoffer.get(), kMid2Audio, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddAudioSection(local_reoffer.get(), kMid3Audio, kIceUfrag3, kIcePwd3, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + local_reoffer->AddGroup(bundle_group); + + EXPECT_TRUE(transport_controller_ + ->SetLocalDescription(SdpType::kOffer, local_reoffer.get()) + .ok()); + + // Store the old transport pointer and verify that the offer actually changed + // transports. + auto old_mid3_transport = mid3_transport; + mid1_transport = transport_controller_->GetRtpTransport(kMid1Audio); + mid2_transport = transport_controller_->GetRtpTransport(kMid2Audio); + mid3_transport = transport_controller_->GetRtpTransport(kMid3Audio); + EXPECT_EQ(mid1_transport, mid2_transport); + EXPECT_EQ(mid1_transport, mid3_transport); + + // Rolling back shouldn't just create a new transport for MID 3, it should + // restore the old transport. + EXPECT_TRUE(transport_controller_->RollbackTransports().ok()); + mid3_transport = transport_controller_->GetRtpTransport(kMid3Audio); + EXPECT_EQ(old_mid3_transport, mid3_transport); +} + +// Test that if an offer adds a MID to a specific BUNDLE group and is then +// rolled back, it can be added to a different BUNDLE group in a new offer. +// This is effectively testing that rollback resets the BundleManager state. +TEST_F(JsepTransportControllerTest, RollbackAndAddToDifferentBundleGroup) { + static const char kMid1Audio[] = "1_audio"; + static const char kMid2Audio[] = "2_audio"; + static const char kMid3Audio[] = "3_audio"; + + // Perform an initial offer/answer to establish two bundle groups, each with + // one MID. + CreateJsepTransportController(JsepTransportController::Config()); + cricket::ContentGroup bundle_group1(cricket::GROUP_TYPE_BUNDLE); + bundle_group1.AddContentName(kMid1Audio); + cricket::ContentGroup bundle_group2(cricket::GROUP_TYPE_BUNDLE); + bundle_group2.AddContentName(kMid2Audio); + + auto local_offer = std::make_unique(); + AddAudioSection(local_offer.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(local_offer.get(), kMid2Audio, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + local_offer->AddGroup(bundle_group1); + local_offer->AddGroup(bundle_group2); + + std::unique_ptr remote_answer( + local_offer->Clone()); + + EXPECT_TRUE(transport_controller_ + ->SetLocalDescription(SdpType::kOffer, local_offer.get()) + .ok()); + EXPECT_TRUE(transport_controller_ + ->SetRemoteDescription(SdpType::kAnswer, remote_answer.get()) + .ok()); + + // Apply an offer that adds kMid3Audio to the first BUNDLE group., + cricket::ContentGroup modified_bundle_group1(cricket::GROUP_TYPE_BUNDLE); + modified_bundle_group1.AddContentName(kMid1Audio); + modified_bundle_group1.AddContentName(kMid3Audio); + auto subsequent_offer_1 = std::make_unique(); + AddAudioSection(subsequent_offer_1.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(subsequent_offer_1.get(), kMid2Audio, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(subsequent_offer_1.get(), kMid3Audio, kIceUfrag3, kIcePwd3, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + subsequent_offer_1->AddGroup(modified_bundle_group1); + subsequent_offer_1->AddGroup(bundle_group2); + + EXPECT_TRUE( + transport_controller_ + ->SetLocalDescription(SdpType::kOffer, subsequent_offer_1.get()) + .ok()); + + auto mid1_transport = transport_controller_->GetRtpTransport(kMid1Audio); + auto mid2_transport = transport_controller_->GetRtpTransport(kMid2Audio); + auto mid3_transport = transport_controller_->GetRtpTransport(kMid3Audio); + EXPECT_NE(mid1_transport, mid2_transport); + EXPECT_EQ(mid1_transport, mid3_transport); + + // Rollback and expect the transport to be reset. + EXPECT_TRUE(transport_controller_->RollbackTransports().ok()); + EXPECT_EQ(nullptr, transport_controller_->GetRtpTransport(kMid3Audio)); + + // Apply an offer that adds kMid3Audio to the second BUNDLE group., + cricket::ContentGroup modified_bundle_group2(cricket::GROUP_TYPE_BUNDLE); + modified_bundle_group2.AddContentName(kMid2Audio); + modified_bundle_group2.AddContentName(kMid3Audio); + auto subsequent_offer_2 = std::make_unique(); + AddAudioSection(subsequent_offer_2.get(), kMid1Audio, kIceUfrag1, kIcePwd1, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(subsequent_offer_2.get(), kMid2Audio, kIceUfrag2, kIcePwd2, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + AddVideoSection(subsequent_offer_2.get(), kMid3Audio, kIceUfrag3, kIcePwd3, + cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, + nullptr); + subsequent_offer_2->AddGroup(bundle_group1); + subsequent_offer_2->AddGroup(modified_bundle_group2); + + EXPECT_TRUE( + transport_controller_ + ->SetLocalDescription(SdpType::kOffer, subsequent_offer_2.get()) + .ok()); + + mid1_transport = transport_controller_->GetRtpTransport(kMid1Audio); + mid2_transport = transport_controller_->GetRtpTransport(kMid2Audio); + mid3_transport = transport_controller_->GetRtpTransport(kMid3Audio); + EXPECT_NE(mid1_transport, mid2_transport); + EXPECT_EQ(mid2_transport, mid3_transport); +} + } // namespace webrtc diff --git a/pc/peer_connection_bundle_unittest.cc b/pc/peer_connection_bundle_unittest.cc index 08754c6820..be05af920c 100644 --- a/pc/peer_connection_bundle_unittest.cc +++ b/pc/peer_connection_bundle_unittest.cc @@ -909,11 +909,11 @@ TEST_F(PeerConnectionBundleTestUnifiedPlan, MultipleBundleGroups) { EXPECT_TRUE( caller->SetLocalDescription(CloneSessionDescription(offer.get()))); - callee->SetRemoteDescription(std::move(offer)); + EXPECT_TRUE(callee->SetRemoteDescription(std::move(offer))); auto answer = callee->CreateAnswer(); EXPECT_TRUE( callee->SetLocalDescription(CloneSessionDescription(answer.get()))); - caller->SetRemoteDescription(std::move(answer)); + EXPECT_TRUE(caller->SetRemoteDescription(std::move(answer))); // Verify bundling on sender side. auto senders = caller->pc()->GetSenders(); @@ -938,4 +938,59 @@ TEST_F(PeerConnectionBundleTestUnifiedPlan, MultipleBundleGroups) { EXPECT_NE(receiver0_transport, receiver2_transport); } +// Test that, with the "max-compat" bundle policy, it's possible to add an m= +// section that's not part of an existing bundle group. +TEST_F(PeerConnectionBundleTestUnifiedPlan, AddNonBundledSection) { + RTCConfiguration config; + config.bundle_policy = PeerConnectionInterface::kBundlePolicyMaxCompat; + auto caller = CreatePeerConnection(config); + caller->AddAudioTrack("0_audio"); + caller->AddAudioTrack("1_audio"); + auto callee = CreatePeerConnection(config); + + // Establish an existing BUNDLE group. + auto offer = caller->CreateOffer(RTCOfferAnswerOptions()); + EXPECT_TRUE( + caller->SetLocalDescription(CloneSessionDescription(offer.get()))); + EXPECT_TRUE(callee->SetRemoteDescription(std::move(offer))); + auto answer = callee->CreateAnswer(); + EXPECT_TRUE( + callee->SetLocalDescription(CloneSessionDescription(answer.get()))); + EXPECT_TRUE(caller->SetRemoteDescription(std::move(answer))); + + // Add a track but munge SDP so it's not part of the bundle group. + caller->AddAudioTrack("3_audio"); + offer = caller->CreateOffer(RTCOfferAnswerOptions()); + offer->description()->RemoveGroupByName(cricket::GROUP_TYPE_BUNDLE); + cricket::ContentGroup bundle_group(cricket::GROUP_TYPE_BUNDLE); + bundle_group.AddContentName("0"); + bundle_group.AddContentName("1"); + offer->description()->AddGroup(bundle_group); + EXPECT_TRUE( + caller->SetLocalDescription(CloneSessionDescription(offer.get()))); + EXPECT_TRUE(callee->SetRemoteDescription(std::move(offer))); + answer = callee->CreateAnswer(); + EXPECT_TRUE( + callee->SetLocalDescription(CloneSessionDescription(answer.get()))); + EXPECT_TRUE(caller->SetRemoteDescription(std::move(answer))); + + // Verify bundling on the sender side. + auto senders = caller->pc()->GetSenders(); + ASSERT_EQ(senders.size(), 3u); + auto sender0_transport = senders[0]->dtls_transport(); + auto sender1_transport = senders[1]->dtls_transport(); + auto sender2_transport = senders[2]->dtls_transport(); + EXPECT_EQ(sender0_transport, sender1_transport); + EXPECT_NE(sender0_transport, sender2_transport); + + // Verify bundling on receiver side. + auto receivers = callee->pc()->GetReceivers(); + ASSERT_EQ(receivers.size(), 3u); + auto receiver0_transport = receivers[0]->dtls_transport(); + auto receiver1_transport = receivers[1]->dtls_transport(); + auto receiver2_transport = receivers[2]->dtls_transport(); + EXPECT_EQ(receiver0_transport, receiver1_transport); + EXPECT_NE(receiver0_transport, receiver2_transport); +} + } // namespace webrtc diff --git a/pc/sdp_offer_answer.cc b/pc/sdp_offer_answer.cc index 533bd84dbe..929736e8c6 100644 --- a/pc/sdp_offer_answer.cc +++ b/pc/sdp_offer_answer.cc @@ -2737,7 +2737,10 @@ RTCError SdpOfferAnswerHandler::Rollback(SdpType desc_type) { transceiver->internal()->set_mid(state.mid()); transceiver->internal()->set_mline_index(state.mline_index()); } - transport_controller()->RollbackTransports(); + RTCError e = transport_controller()->RollbackTransports(); + if (!e.ok()) { + return e; + } transceivers()->DiscardStableStates(); pending_local_description_.reset(); pending_remote_description_.reset(); From f740c252e743d0791074868930cde200f6aa7bd9 Mon Sep 17 00:00:00 2001 From: Byoungchan Lee Date: Sat, 24 Jul 2021 06:16:20 +0900 Subject: [PATCH 0082/1565] Use the underlying type of Java Video Buffer on Java -> C++ Frame Buffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just like the C++ API, add a method in Java VideoFrame.Buffer that describes the underlying implementation. Use this method to properly select AndroidVideoBuffer or AndroidVideoI420Buffer in Java -> C++ Video Frame Conversion. Also, add a test case for WrappedNativeI420Buffer in VideoFrameBufferTest for consistency. Bug: webrtc:12602 Change-Id: I4c0444e8af6f6a1109bc514e7ab6c2214f1f6d60 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/223080 Commit-Queue: Byoungchan Lee Reviewed-by: Niels Moller Reviewed-by: Xavier Lepaul‎ Cr-Commit-Position: refs/heads/master@{#34545} --- api/video/BUILD.gn | 6 +++ api/video/video_frame_buffer.h | 2 + sdk/android/BUILD.gn | 9 +++- sdk/android/api/org/webrtc/VideoFrame.java | 14 ++++++ .../src/org/webrtc/VideoFrameBufferTest.java | 44 +++++++++++++++--- .../video_frame_buffer_test.cc | 45 +++++++++++++++++++ sdk/android/src/jni/video_frame.cc | 42 +++++++++++++++-- 7 files changed, 151 insertions(+), 11 deletions(-) create mode 100644 sdk/android/instrumentationtests/video_frame_buffer_test.cc diff --git a/api/video/BUILD.gn b/api/video/BUILD.gn index 41367132f6..eaa7715f75 100644 --- a/api/video/BUILD.gn +++ b/api/video/BUILD.gn @@ -69,6 +69,12 @@ rtc_library("video_frame") { absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] } +if (is_android) { + java_cpp_enum("video_frame_enums") { + sources = [ "video_frame_buffer.h" ] + } +} + rtc_library("video_frame_i010") { visibility = [ "*" ] sources = [ diff --git a/api/video/video_frame_buffer.h b/api/video/video_frame_buffer.h index 62adc204f6..3e41a9b2ca 100644 --- a/api/video/video_frame_buffer.h +++ b/api/video/video_frame_buffer.h @@ -46,6 +46,8 @@ class RTC_EXPORT VideoFrameBuffer : public rtc::RefCountInterface { // New frame buffer types will be added conservatively when there is an // opportunity to optimize the path between some pair of video source and // video sink. + // GENERATED_JAVA_ENUM_PACKAGE: org.webrtc + // GENERATED_JAVA_CLASS_NAME_OVERRIDE: VideoFrameBufferType enum class Type { kNative, kI420, diff --git a/sdk/android/BUILD.gn b/sdk/android/BUILD.gn index 57b9d629be..d4e8d182fe 100644 --- a/sdk/android/BUILD.gn +++ b/sdk/android/BUILD.gn @@ -202,7 +202,9 @@ if (is_android) { ":base_java", "//rtc_base:base_java", "//third_party/android_deps:com_android_support_support_annotations_java", + "//third_party/androidx:androidx_annotation_annotation_java", ] + srcjar_deps = [ "//api/video:video_frame_enums" ] } rtc_android_library("video_java") { @@ -1486,11 +1488,16 @@ if (is_android) { rtc_library("instrumentationtests_jni") { testonly = true - sources = [ "instrumentationtests/loggable_test.cc" ] + sources = [ + "instrumentationtests/loggable_test.cc", + "instrumentationtests/video_frame_buffer_test.cc", + ] deps = [ ":base_jni", ":native_api_jni", + ":videoframe_jni", + "../../api/video:video_frame", "../../rtc_base:rtc_base_approved", ] } diff --git a/sdk/android/api/org/webrtc/VideoFrame.java b/sdk/android/api/org/webrtc/VideoFrame.java index a0a0d4eecb..bb30069b92 100644 --- a/sdk/android/api/org/webrtc/VideoFrame.java +++ b/sdk/android/api/org/webrtc/VideoFrame.java @@ -34,6 +34,15 @@ public class VideoFrame implements RefCounted { * and the buffer needs to be returned to the VideoSource as soon as all references are gone. */ public interface Buffer extends RefCounted { + /** + * Representation of the underlying buffer. Currently, only NATIVE and I420 are supported. + */ + @CalledByNative("Buffer") + @VideoFrameBufferType + default int getBufferType() { + return VideoFrameBufferType.NATIVE; + } + /** * Resolution of the buffer in pixels. */ @@ -63,6 +72,11 @@ Buffer cropAndScale( * Interface for I420 buffers. */ public interface I420Buffer extends Buffer { + @Override + default int getBufferType() { + return VideoFrameBufferType.I420; + } + /** * Returns a direct ByteBuffer containing Y-plane data. The buffer capacity is at least * getStrideY() * getHeight() bytes. The position of the returned buffer is ignored and must diff --git a/sdk/android/instrumentationtests/src/org/webrtc/VideoFrameBufferTest.java b/sdk/android/instrumentationtests/src/org/webrtc/VideoFrameBufferTest.java index 53b2c58e18..4388e4a60e 100644 --- a/sdk/android/instrumentationtests/src/org/webrtc/VideoFrameBufferTest.java +++ b/sdk/android/instrumentationtests/src/org/webrtc/VideoFrameBufferTest.java @@ -32,6 +32,7 @@ import org.junit.BeforeClass; import org.junit.Test; import org.junit.runner.RunWith; +import org.webrtc.VideoFrame; /** * Test VideoFrame buffers of different kind of formats: I420, RGB, OES, NV12, NV21, and verify @@ -45,7 +46,7 @@ public class VideoFrameBufferTest { /** * These tests are parameterized on this enum which represents the different VideoFrame.Buffers. */ - private static enum BufferType { I420, RGB_TEXTURE, OES_TEXTURE, NV21, NV12 } + private static enum BufferType { I420_JAVA, I420_NATIVE, RGB_TEXTURE, OES_TEXTURE, NV21, NV12 } @ClassParameter private static List CLASS_PARAMS = new ArrayList<>(); @@ -75,17 +76,39 @@ public VideoFrameBufferTest(String bufferTypeName) { */ private static VideoFrame.Buffer createBufferWithType( BufferType bufferType, VideoFrame.I420Buffer i420Buffer) { + VideoFrame.Buffer buffer; switch (bufferType) { - case I420: - return i420Buffer.toI420(); + case I420_JAVA: + buffer = i420Buffer; + buffer.retain(); + assertEquals(VideoFrameBufferType.I420, buffer.getBufferType()); + assertEquals(VideoFrameBufferType.I420, nativeGetBufferType(buffer)); + return buffer; + case I420_NATIVE: + buffer = nativeGetNativeI420Buffer(i420Buffer); + assertEquals(VideoFrameBufferType.I420, buffer.getBufferType()); + assertEquals(VideoFrameBufferType.I420, nativeGetBufferType(buffer)); + return buffer; case RGB_TEXTURE: - return createRgbTextureBuffer(/* eglContext= */ null, i420Buffer); + buffer = createRgbTextureBuffer(/* eglContext= */ null, i420Buffer); + assertEquals(VideoFrameBufferType.NATIVE, buffer.getBufferType()); + assertEquals(VideoFrameBufferType.NATIVE, nativeGetBufferType(buffer)); + return buffer; case OES_TEXTURE: - return createOesTextureBuffer(/* eglContext= */ null, i420Buffer); + buffer = createOesTextureBuffer(/* eglContext= */ null, i420Buffer); + assertEquals(VideoFrameBufferType.NATIVE, buffer.getBufferType()); + assertEquals(VideoFrameBufferType.NATIVE, nativeGetBufferType(buffer)); + return buffer; case NV21: - return createNV21Buffer(i420Buffer); + buffer = createNV21Buffer(i420Buffer); + assertEquals(VideoFrameBufferType.NATIVE, buffer.getBufferType()); + assertEquals(VideoFrameBufferType.NATIVE, nativeGetBufferType(buffer)); + return buffer; case NV12: - return createNV12Buffer(i420Buffer); + buffer = createNV12Buffer(i420Buffer); + assertEquals(VideoFrameBufferType.NATIVE, buffer.getBufferType()); + assertEquals(VideoFrameBufferType.NATIVE, nativeGetBufferType(buffer)); + return buffer; default: throw new IllegalArgumentException("Unknown buffer type: " + bufferType); } @@ -452,6 +475,7 @@ public void testToI420() { final VideoFrame.I420Buffer outputI420Buffer = bufferToTest.toI420(); bufferToTest.release(); + assertEquals(VideoFrameBufferType.I420, nativeGetBufferType(outputI420Buffer)); assertAlmostEqualI420Buffers(referenceI420Buffer, outputI420Buffer); referenceI420Buffer.release(); outputI420Buffer.release(); @@ -504,4 +528,10 @@ public void testCropAndScale() { testCropAndScale(4 /* cropX= */, 4 /* cropY= */, /* cropWidth= */ 12, /* cropHeight= */ 12, /* scaleWidth= */ 8, /* scaleHeight= */ 8); } + + @VideoFrameBufferType private static native int nativeGetBufferType(VideoFrame.Buffer buffer); + + /** Returns the copy of I420Buffer using WrappedNativeI420Buffer. */ + private static native VideoFrame.Buffer nativeGetNativeI420Buffer( + VideoFrame.I420Buffer i420Buffer); } diff --git a/sdk/android/instrumentationtests/video_frame_buffer_test.cc b/sdk/android/instrumentationtests/video_frame_buffer_test.cc new file mode 100644 index 0000000000..686b232f6d --- /dev/null +++ b/sdk/android/instrumentationtests/video_frame_buffer_test.cc @@ -0,0 +1,45 @@ +/* + * Copyright 2021 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. An additional intellectual property rights grant can be found + * in the file PATENTS. All contributing project authors may + * be found in the AUTHORS file in the root of the source tree. + */ + +#include "api/video/i420_buffer.h" +#include "sdk/android/src/jni/jni_helpers.h" +#include "sdk/android/src/jni/video_frame.h" +#include "sdk/android/src/jni/wrapped_native_i420_buffer.h" + +namespace webrtc { +namespace jni { + +JNI_FUNCTION_DECLARATION(jint, + VideoFrameBufferTest_nativeGetBufferType, + JNIEnv* jni, + jclass, + jobject video_frame_buffer) { + const JavaParamRef j_video_frame_buffer(video_frame_buffer); + rtc::scoped_refptr buffer = + JavaToNativeFrameBuffer(jni, j_video_frame_buffer); + return static_cast(buffer->type()); +} + +JNI_FUNCTION_DECLARATION(jobject, + VideoFrameBufferTest_nativeGetNativeI420Buffer, + JNIEnv* jni, + jclass, + jobject i420_buffer) { + const JavaParamRef j_i420_buffer(i420_buffer); + rtc::scoped_refptr buffer = + JavaToNativeFrameBuffer(jni, j_i420_buffer); + const I420BufferInterface* inputBuffer = buffer->GetI420(); + RTC_DCHECK(inputBuffer != nullptr); + rtc::scoped_refptr outputBuffer = I420Buffer::Copy(*inputBuffer); + return WrapI420Buffer(jni, outputBuffer).Release(); +} + +} // namespace jni +} // namespace webrtc diff --git a/sdk/android/src/jni/video_frame.cc b/sdk/android/src/jni/video_frame.cc index e27a5c841b..35d04d8b9f 100644 --- a/sdk/android/src/jni/video_frame.cc +++ b/sdk/android/src/jni/video_frame.cc @@ -70,6 +70,13 @@ class AndroidVideoBuffer : public VideoFrameBuffer { class AndroidVideoI420Buffer : public I420BufferInterface { public: + // Creates a native VideoFrameBuffer from a Java VideoFrame.I420Buffer. + static rtc::scoped_refptr Create( + JNIEnv* jni, + int width, + int height, + const JavaRef& j_video_frame_buffer); + // Adopts and takes ownership of the Java VideoFrame.Buffer. I.e. retain() // will not be called, but release() will be called when the returned // AndroidVideoBuffer is destroyed. @@ -113,11 +120,24 @@ class AndroidVideoI420Buffer : public I420BufferInterface { int stride_v_; }; +rtc::scoped_refptr AndroidVideoI420Buffer::Create( + JNIEnv* jni, + int width, + int height, + const JavaRef& j_video_frame_buffer) { + Java_Buffer_retain(jni, j_video_frame_buffer); + return AndroidVideoI420Buffer::Adopt(jni, width, height, + j_video_frame_buffer); +} + rtc::scoped_refptr AndroidVideoI420Buffer::Adopt( JNIEnv* jni, int width, int height, const JavaRef& j_video_frame_buffer) { + RTC_DCHECK_EQ( + static_cast(Java_Buffer_getBufferType(jni, j_video_frame_buffer)), + Type::kI420); return rtc::make_ref_counted(jni, width, height, j_video_frame_buffer); } @@ -164,6 +184,9 @@ int64_t GetJavaVideoFrameTimestampNs(JNIEnv* jni, rtc::scoped_refptr AndroidVideoBuffer::Adopt( JNIEnv* jni, const JavaRef& j_video_frame_buffer) { + RTC_DCHECK_EQ( + static_cast(Java_Buffer_getBufferType(jni, j_video_frame_buffer)), + Type::kNative); return rtc::make_ref_counted(jni, j_video_frame_buffer); } @@ -233,7 +256,20 @@ rtc::scoped_refptr AndroidVideoBuffer::ToI420() { rtc::scoped_refptr JavaToNativeFrameBuffer( JNIEnv* jni, const JavaRef& j_video_frame_buffer) { - return AndroidVideoBuffer::Create(jni, j_video_frame_buffer); + VideoFrameBuffer::Type type = static_cast( + Java_Buffer_getBufferType(jni, j_video_frame_buffer)); + switch (type) { + case VideoFrameBuffer::Type::kI420: { + const int width = Java_Buffer_getWidth(jni, j_video_frame_buffer); + const int height = Java_Buffer_getHeight(jni, j_video_frame_buffer); + return AndroidVideoI420Buffer::Create(jni, width, height, + j_video_frame_buffer); + } + case VideoFrameBuffer::Type::kNative: + return AndroidVideoBuffer::Create(jni, j_video_frame_buffer); + default: + RTC_CHECK_NOTREACHED(); + } } VideoFrame JavaToNativeFrame(JNIEnv* jni, @@ -243,8 +279,8 @@ VideoFrame JavaToNativeFrame(JNIEnv* jni, Java_VideoFrame_getBuffer(jni, j_video_frame); int rotation = Java_VideoFrame_getRotation(jni, j_video_frame); int64_t timestamp_ns = Java_VideoFrame_getTimestampNs(jni, j_video_frame); - rtc::scoped_refptr buffer = - AndroidVideoBuffer::Create(jni, j_video_frame_buffer); + rtc::scoped_refptr buffer = + JavaToNativeFrameBuffer(jni, j_video_frame_buffer); return VideoFrame::Builder() .set_video_frame_buffer(buffer) .set_timestamp_rtp(timestamp_rtp) From cae23d9cc3c812062827c150d269cfb0f9ddce60 Mon Sep 17 00:00:00 2001 From: webrtc-version-updater Date: Fri, 23 Jul 2021 21:02:33 -0700 Subject: [PATCH 0083/1565] Update WebRTC code version (2021-07-24T04:02:31). TBR=webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com,mbonadei@webrtc.org Bug: None Change-Id: I544fc7e2de2f7828fa5c173117f7b9c389cdb26f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226920 Reviewed-by: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Commit-Queue: webrtc-version-updater@webrtc-ci.iam.gserviceaccount.com Cr-Commit-Position: refs/heads/master@{#34546} --- call/version.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/call/version.cc b/call/version.cc index 95d7307abb..a1488cbb46 100644 --- a/call/version.cc +++ b/call/version.cc @@ -13,7 +13,7 @@ namespace webrtc { // The timestamp is always in UTC. -const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-23T04:03:53"; +const char* const kSourceTimestamp = "WebRTC source stamp 2021-07-24T04:02:31"; void LoadWebRTCVersionInRegister() { // Using volatile to instruct the compiler to not optimize `p` away even From c91c2f5bc5e7fa45212a2ad83d3112b74a19f154 Mon Sep 17 00:00:00 2001 From: Philipp Hancke Date: Thu, 22 Jul 2021 13:51:21 +0200 Subject: [PATCH 0084/1565] peer_connection_server: fix static analysis issues coverity flags two issues on this: * no copy constructor (and assignment operator) for things that free in the destructor * missing return value check on setsockopt BUG=None Change-Id: I0671bf5f9bc0ede968f80c3686bf7bbd8eb63e98 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226743 Commit-Queue: Tommi Reviewed-by: Tommi Cr-Commit-Position: refs/heads/master@{#34547} --- examples/peerconnection/server/data_socket.cc | 8 ++++++-- examples/peerconnection/server/data_socket.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/peerconnection/server/data_socket.cc b/examples/peerconnection/server/data_socket.cc index 2d595a0e86..c57d992658 100644 --- a/examples/peerconnection/server/data_socket.cc +++ b/examples/peerconnection/server/data_socket.cc @@ -269,8 +269,12 @@ bool DataSocket::ParseContentLengthAndType(const char* headers, size_t length) { bool ListeningSocket::Listen(unsigned short port) { RTC_DCHECK(valid()); int enabled = 1; - setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, - reinterpret_cast(&enabled), sizeof(enabled)); + if (setsockopt(socket_, SOL_SOCKET, SO_REUSEADDR, + reinterpret_cast(&enabled), + sizeof(enabled)) != 0) { + printf("setsockopt failed\n"); + return false; + } struct sockaddr_in addr = {0}; addr.sin_family = AF_INET; addr.sin_addr.s_addr = htonl(INADDR_ANY); diff --git a/examples/peerconnection/server/data_socket.h b/examples/peerconnection/server/data_socket.h index 4429bc5a00..bafa5d39c2 100644 --- a/examples/peerconnection/server/data_socket.h +++ b/examples/peerconnection/server/data_socket.h @@ -37,6 +37,8 @@ class SocketBase { public: SocketBase() : socket_(INVALID_SOCKET) {} explicit SocketBase(NativeSocket socket) : socket_(socket) {} + SocketBase(SocketBase& other) = delete; + SocketBase& operator=(const SocketBase& other) = delete; ~SocketBase() { Close(); } NativeSocket socket() const { return socket_; } From 4a3296d0273cbb3df0913a826c79dda4599deb4c Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Fri, 23 Jul 2021 15:06:19 -0700 Subject: [PATCH 0085/1565] build_ios_libs.py: add support for building for Catalyst WebRTC can successfully build for arm64 Catalyst, but x64 Catalyst still needs some work. Nevertheless, the build script can now support it along with the existing 'simulator' and 'device' environments. Bug: webrtc:11516 Change-Id: Ic2ce8db32142a5a0a2e50f2d8a672710b283fac3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226900 Reviewed-by: Mirko Bonadei Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34548} --- tools_webrtc/ios/build_ios_libs.py | 37 ++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/tools_webrtc/ios/build_ios_libs.py b/tools_webrtc/ios/build_ios_libs.py index c931853229..3bc88743a7 100755 --- a/tools_webrtc/ios/build_ios_libs.py +++ b/tools_webrtc/ios/build_ios_libs.py @@ -13,7 +13,6 @@ """ import argparse -import distutils.dir_util import logging import os import shutil @@ -34,12 +33,17 @@ ENABLED_ARCHS = [ 'device:arm64', 'simulator:arm64', 'simulator:x64', + 'catalyst:arm64', 'catalyst:x64', 'arm64', 'x64' ] DEFAULT_ARCHS = [ 'device:arm64', 'simulator:arm64', 'simulator:x64' ] -IOS_DEPLOYMENT_TARGET = '12.0' +IOS_DEPLOYMENT_TARGET = { + 'device': '12.0', + 'simulator': '12.0', + 'catalyst': '14.0' +} LIBVPX_BUILD_VP9 = False sys.path.append(os.path.join(SCRIPT_DIR, '..', 'libs')) @@ -240,20 +244,26 @@ def main(): lib_path = os.path.join(framework_path, arch + '_libs') lib_paths.append(lib_path) BuildWebRTC(lib_path, environment, arch, args.build_config, - gn_target_name, IOS_DEPLOYMENT_TARGET, + gn_target_name, IOS_DEPLOYMENT_TARGET[environment], LIBVPX_BUILD_VP9, args.bitcode, args.use_goma, gn_args) all_lib_paths.extend(lib_paths) # Combine the slices. dylib_path = os.path.join(SDK_FRAMEWORK_NAME, 'WebRTC') # Dylibs will be combined, all other files are the same across archs. - # Use distutils instead of shutil to support merging folders. - distutils.dir_util.copy_tree( + shutil.rmtree( + os.path.join(framework_path, SDK_FRAMEWORK_NAME), + ignore_errors=True) + shutil.copytree( os.path.join(lib_paths[0], SDK_FRAMEWORK_NAME), - os.path.join(framework_path, SDK_FRAMEWORK_NAME)) + os.path.join(framework_path, SDK_FRAMEWORK_NAME), + symlinks=True) logging.info('Merging framework slices for %s.', environment) dylib_paths = [os.path.join(path, dylib_path) for path in lib_paths] out_dylib_path = os.path.join(framework_path, dylib_path) + if os.path.islink(out_dylib_path): + out_dylib_path = os.path.join(os.path.dirname(out_dylib_path), + os.readlink(out_dylib_path)) try: os.remove(out_dylib_path) except OSError: @@ -264,7 +274,10 @@ def main(): # Merge the dSYM slices. lib_dsym_dir_path = os.path.join(lib_paths[0], SDK_DSYM_NAME) if os.path.isdir(lib_dsym_dir_path): - distutils.dir_util.copy_tree( + shutil.rmtree( + os.path.join(framework_path, SDK_DSYM_NAME), + ignore_errors=True) + shutil.copytree( lib_dsym_dir_path, os.path.join(framework_path, SDK_DSYM_NAME)) logging.info('Merging dSYM slices.') dsym_path = os.path.join(SDK_DSYM_NAME, 'Contents', 'Resources', @@ -281,12 +294,18 @@ def main(): ] + lib_dsym_paths + ['-create', '-output', out_dsym_path] _RunCommand(cmd) + # Check for Mac-style WebRTC.framework/Resources/ (for Catalyst)... + resources_dir = os.path.join(framework_path, SDK_FRAMEWORK_NAME, + 'Resources') + if not os.path.exists(resources_dir): + # ...then fall back to iOS-style WebRTC.framework/ + resources_dir = os.path.dirname(resources_dir) + # Modify the version number. # Format should be ... # e.g. 55.0.14986 means # branch cut 55, no hotfixes, and revision 14986. - infoplist_path = os.path.join(framework_path, SDK_FRAMEWORK_NAME, - 'Info.plist') + infoplist_path = os.path.join(resources_dir, 'Info.plist') cmd = [ 'PlistBuddy', '-c', 'Print :CFBundleShortVersionString', infoplist_path From 0804fba0fd721e60fbb36697eea375e132015a63 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Sun, 25 Jul 2021 11:52:55 +0200 Subject: [PATCH 0086/1565] Remove duplicated or non effective build flags. -Winconsistent-missing-override is part of -Wall so there is no need to explicitly set it. -Wthread-safety and -Wimplicit-fallthrough are set by default by Chromium's toolchain and there is no need to duplicated it in WebRTC GN files: gn desc out/Debug/ //rtc_base cflags | grep "Wthread-safety" -Wthread-safety -Wthread-safety gn desc out/Debug/ //rtc_base cflags | grep "implicit" -Wimplicit-fallthrough -Wimplicit-fallthrough Bug: None Change-Id: Ie5104f7c6d508c7b45788420bf111a17b8b10939 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226868 Commit-Queue: Mirko Bonadei Reviewed-by: Nico Weber Cr-Commit-Position: refs/heads/master@{#34549} --- BUILD.gn | 3 --- 1 file changed, 3 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index f2713f62d2..4afbdc7b92 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -344,9 +344,6 @@ config("common_config") { if (is_clang) { cflags += [ "-Wc++11-narrowing", - "-Wimplicit-fallthrough", - "-Wthread-safety", - "-Winconsistent-missing-override", "-Wundef", ] From f325ea2e2ad182b7a17444f416c2c2ff8e229822 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Fri, 23 Jul 2021 16:15:16 +0200 Subject: [PATCH 0087/1565] Revert: webrtc::Mutex: Introduce mutex_race_check.h This is a revert of https://webrtc-review.googlesource.com/c/src/+/179284 the code is not used so removing to lower code maintenance. Bug: webrtc:11787 Change-Id: I5a8e981038ce28177fed4942fdd5f20a9b241bd7 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226863 Reviewed-by: Niels Moller Commit-Queue: Mirko Bonadei Cr-Commit-Position: refs/heads/master@{#34550} --- rtc_base/DEPS | 3 - rtc_base/logging.cc | 28 ++------- rtc_base/synchronization/BUILD.gn | 2 - rtc_base/synchronization/mutex.h | 7 +-- rtc_base/synchronization/mutex_race_check.h | 65 --------------------- 5 files changed, 6 insertions(+), 99 deletions(-) delete mode 100644 rtc_base/synchronization/mutex_race_check.h diff --git a/rtc_base/DEPS b/rtc_base/DEPS index 3fdc4bc10e..c9f7dc5898 100644 --- a/rtc_base/DEPS +++ b/rtc_base/DEPS @@ -12,7 +12,4 @@ specific_include_rules = { "gunit\.h": [ "+testing/base/public/gunit.h" ], - "logging\.cc": [ - "+absl/synchronization" - ], } diff --git a/rtc_base/logging.cc b/rtc_base/logging.cc index a333d83970..321d848384 100644 --- a/rtc_base/logging.cc +++ b/rtc_base/logging.cc @@ -51,17 +51,6 @@ static const int kMaxLogLineSize = 1024 - 60; #include "rtc_base/thread_annotations.h" #include "rtc_base/time_utils.h" -#if defined(WEBRTC_RACE_CHECK_MUTEX) -#if defined(WEBRTC_ABSL_MUTEX) -#error Please only define one of WEBRTC_RACE_CHECK_MUTEX and WEBRTC_ABSL_MUTEX. -#endif -#include "absl/base/const_init.h" -#include "absl/synchronization/mutex.h" // nogncheck -using LoggingMutexLock = ::absl::MutexLock; -#else -using LoggingMutexLock = ::webrtc::MutexLock; -#endif // if defined(WEBRTC_RACE_CHECK_MUTEX) - namespace rtc { namespace { // By default, release builds don't log, debug builds at info level @@ -86,14 +75,7 @@ const char* FilenameFromPath(const char* file) { // Global lock for log subsystem, only needed to serialize access to streams_. // TODO(bugs.webrtc.org/11665): this is not currently constant initialized and // trivially destructible. -#if defined(WEBRTC_RACE_CHECK_MUTEX) -// When WEBRTC_RACE_CHECK_MUTEX is defined, even though WebRTC objects are -// invoked serially, the logging is static, invoked concurrently and hence needs -// protection. -absl::Mutex g_log_mutex_(absl::kConstInit); -#else webrtc::Mutex g_log_mutex_; -#endif } // namespace @@ -220,7 +202,7 @@ LogMessage::~LogMessage() { #endif } - LoggingMutexLock lock(&g_log_mutex_); + webrtc::MutexLock lock(&g_log_mutex_); for (LogSink* entry = streams_; entry != nullptr; entry = entry->next_) { if (severity_ >= entry->min_severity_) { #if defined(WEBRTC_ANDROID) @@ -269,7 +251,7 @@ void LogMessage::LogTimestamps(bool on) { void LogMessage::LogToDebug(LoggingSeverity min_sev) { g_dbg_sev = min_sev; - LoggingMutexLock lock(&g_log_mutex_); + webrtc::MutexLock lock(&g_log_mutex_); UpdateMinLogSeverity(); } @@ -278,7 +260,7 @@ void LogMessage::SetLogToStderr(bool log_to_stderr) { } int LogMessage::GetLogToStream(LogSink* stream) { - LoggingMutexLock lock(&g_log_mutex_); + webrtc::MutexLock lock(&g_log_mutex_); LoggingSeverity sev = LS_NONE; for (LogSink* entry = streams_; entry != nullptr; entry = entry->next_) { if (stream == nullptr || stream == entry) { @@ -289,7 +271,7 @@ int LogMessage::GetLogToStream(LogSink* stream) { } void LogMessage::AddLogToStream(LogSink* stream, LoggingSeverity min_sev) { - LoggingMutexLock lock(&g_log_mutex_); + webrtc::MutexLock lock(&g_log_mutex_); stream->min_severity_ = min_sev; stream->next_ = streams_; streams_ = stream; @@ -298,7 +280,7 @@ void LogMessage::AddLogToStream(LogSink* stream, LoggingSeverity min_sev) { } void LogMessage::RemoveLogToStream(LogSink* stream) { - LoggingMutexLock lock(&g_log_mutex_); + webrtc::MutexLock lock(&g_log_mutex_); for (LogSink** entry = &streams_; *entry != nullptr; entry = &(*entry)->next_) { if (*entry == stream) { diff --git a/rtc_base/synchronization/BUILD.gn b/rtc_base/synchronization/BUILD.gn index 3cddc55c72..73ff667246 100644 --- a/rtc_base/synchronization/BUILD.gn +++ b/rtc_base/synchronization/BUILD.gn @@ -27,7 +27,6 @@ rtc_library("mutex") { "mutex.h", "mutex_critical_section.h", "mutex_pthread.h", - "mutex_race_check.h", ] if (rtc_use_absl_mutex) { sources += [ "mutex_abseil.h" ] @@ -38,7 +37,6 @@ rtc_library("mutex") { "..:checks", "..:macromagic", "..:platform_thread_types", - "../system:unused", ] absl_deps = [ "//third_party/abseil-cpp/absl/base:core_headers" ] if (rtc_use_absl_mutex) { diff --git a/rtc_base/synchronization/mutex.h b/rtc_base/synchronization/mutex.h index e1512e96cc..0023d90ef5 100644 --- a/rtc_base/synchronization/mutex.h +++ b/rtc_base/synchronization/mutex.h @@ -18,12 +18,7 @@ #include "rtc_base/checks.h" #include "rtc_base/thread_annotations.h" -#if defined(WEBRTC_RACE_CHECK_MUTEX) -// To use the race check mutex, define WEBRTC_RACE_CHECK_MUTEX globally. This -// also adds a dependency to absl::Mutex from logging.cc due to concurrent -// invocation of the static logging system. -#include "rtc_base/synchronization/mutex_race_check.h" -#elif defined(WEBRTC_ABSL_MUTEX) +#if defined(WEBRTC_ABSL_MUTEX) #include "rtc_base/synchronization/mutex_abseil.h" // nogncheck #elif defined(WEBRTC_WIN) #include "rtc_base/synchronization/mutex_critical_section.h" diff --git a/rtc_base/synchronization/mutex_race_check.h b/rtc_base/synchronization/mutex_race_check.h deleted file mode 100644 index cada6292b5..0000000000 --- a/rtc_base/synchronization/mutex_race_check.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2020 The WebRTC Project Authors. All rights reserved. - * - * Use of this source code is governed by a BSD-style license - * that can be found in the LICENSE file in the root of the source - * tree. An additional intellectual property rights grant can be found - * in the file PATENTS. All contributing project authors may - * be found in the AUTHORS file in the root of the source tree. - */ - -#ifndef RTC_BASE_SYNCHRONIZATION_MUTEX_RACE_CHECK_H_ -#define RTC_BASE_SYNCHRONIZATION_MUTEX_RACE_CHECK_H_ - -#include - -#include "absl/base/attributes.h" -#include "rtc_base/checks.h" -#include "rtc_base/system/unused.h" -#include "rtc_base/thread_annotations.h" - -namespace webrtc { - -// This implementation class is useful when a consuming project can guarantee -// that all WebRTC invocation is happening serially. Additionally, the consuming -// project cannot use WebRTC code that spawn threads or task queues. -// -// The class internally check fails on Lock() if it finds the consumer actually -// invokes WebRTC concurrently. -// -// To use the race check mutex, define WEBRTC_RACE_CHECK_MUTEX globally. This -// also adds a dependency to absl::Mutex from logging.cc because even though -// objects are invoked serially, the logging is static and invoked concurrently -// and hence needs protection. -class RTC_LOCKABLE MutexImpl final { - public: - MutexImpl() = default; - MutexImpl(const MutexImpl&) = delete; - MutexImpl& operator=(const MutexImpl&) = delete; - - void Lock() RTC_EXCLUSIVE_LOCK_FUNCTION() { - bool was_free = free_.exchange(false, std::memory_order_acquire); - RTC_CHECK(was_free) - << "WEBRTC_RACE_CHECK_MUTEX: mutex locked concurrently."; - } - ABSL_MUST_USE_RESULT bool TryLock() RTC_EXCLUSIVE_TRYLOCK_FUNCTION(true) { - bool was_free = free_.exchange(false, std::memory_order_acquire); - return was_free; - } - void Unlock() RTC_UNLOCK_FUNCTION() { - free_.store(true, std::memory_order_release); - } - - private: - // Release-acquire ordering is used. - // - In the Lock methods we're guaranteeing that reads and writes happening - // after the (Try)Lock don't appear to have happened before the Lock (acquire - // ordering). - // - In the Unlock method we're guaranteeing that reads and writes happening - // before the Unlock don't appear to happen after it (release ordering). - std::atomic free_{true}; -}; - -} // namespace webrtc - -#endif // RTC_BASE_SYNCHRONIZATION_MUTEX_RACE_CHECK_H_ From 33fdb3430d6d838f9be9d42abf432ae35a07d8b9 Mon Sep 17 00:00:00 2001 From: Danil Chapovalov Date: Fri, 23 Jul 2021 15:28:17 +0200 Subject: [PATCH 0088/1565] Migrate away from legacy rtp parser in test/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: None Change-Id: I71e4a352b67a304df44454b36352285e8b11e4b5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226742 Reviewed-by: Erik Språng Commit-Queue: Danil Chapovalov Cr-Commit-Position: refs/heads/master@{#34551} --- test/BUILD.gn | 2 +- test/peer_scenario/tests/BUILD.gn | 1 - .../tests/remote_estimate_test.cc | 28 +++++-------------- test/rtp_file_reader_unittest.cc | 11 ++++---- 4 files changed, 13 insertions(+), 29 deletions(-) diff --git a/test/BUILD.gn b/test/BUILD.gn index 9172eb3227..d645621e79 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -517,6 +517,7 @@ if (rtc_include_tests && !build_with_chromium) { ":test_support_test_artifacts", ":video_test_common", ":video_test_support", + "../api:array_view", "../api:create_frame_generator", "../api:create_simulcast_test_fixture_api", "../api:frame_generator_api", @@ -530,7 +531,6 @@ if (rtc_include_tests && !build_with_chromium) { "../call:video_stream_api", "../common_video", "../media:rtc_media_base", - "../modules/rtp_rtcp", "../modules/rtp_rtcp:rtp_rtcp_format", "../modules/video_coding:simulcast_test_fixture_impl", "../modules/video_coding:video_codec_interface", diff --git a/test/peer_scenario/tests/BUILD.gn b/test/peer_scenario/tests/BUILD.gn index 042b636690..dd72473bf8 100644 --- a/test/peer_scenario/tests/BUILD.gn +++ b/test/peer_scenario/tests/BUILD.gn @@ -21,7 +21,6 @@ if (rtc_include_tests) { "../../:field_trial", "../../:test_support", "../../../media:rtc_media_base", - "../../../modules/rtp_rtcp:rtp_rtcp", "../../../modules/rtp_rtcp:rtp_rtcp_format", "../../../pc:rtc_pc_base", "../../../pc:session_description", diff --git a/test/peer_scenario/tests/remote_estimate_test.cc b/test/peer_scenario/tests/remote_estimate_test.cc index f1d8345fde..429a5b4ef6 100644 --- a/test/peer_scenario/tests/remote_estimate_test.cc +++ b/test/peer_scenario/tests/remote_estimate_test.cc @@ -8,8 +8,10 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include "modules/rtp_rtcp/include/rtp_header_extension_map.h" +#include "modules/rtp_rtcp/source/rtp_header_extensions.h" +#include "modules/rtp_rtcp/source/rtp_packet.h" #include "modules/rtp_rtcp/source/rtp_util.h" -#include "modules/rtp_rtcp/source/rtp_utility.h" #include "pc/media_session.h" #include "pc/session_description.h" #include "test/field_trial.h" @@ -26,19 +28,6 @@ RtpHeaderExtensionMap AudioExtensions( return RtpHeaderExtensionMap(audio_desc->rtp_header_extensions()); } -absl::optional GetRtpPacketExtensions( - const rtc::ArrayView packet, - const RtpHeaderExtensionMap& extension_map) { - RtpUtility::RtpHeaderParser rtp_parser(packet.data(), packet.size()); - if (IsRtpPacket(packet)) { - RTPHeader header; - if (rtp_parser.Parse(&header, &extension_map, true)) { - return header.extension; - } - } - return absl::nullopt; -} - } // namespace TEST(RemoteEstimateEndToEnd, OfferedCapabilityIsInAnswer) { @@ -106,13 +95,10 @@ TEST(RemoteEstimateEndToEnd, AudioUsesAbsSendTimeExtension) { // The dummy packets used by the fake signaling are filled with 0. We // want to ignore those and we can do that on the basis that the first // byte of RTP packets are guaranteed to not be 0. - // TODO(srte): Find a more elegant way to check for RTP traffic. - if (packet.size() > 1 && packet.cdata()[0] != 0) { - auto extensions = GetRtpPacketExtensions(packet.data, extension_map); - if (extensions) { - EXPECT_TRUE(extensions->hasAbsoluteSendTime); - received_abs_send_time = true; - } + RtpPacket rtp_packet(&extension_map); + if (rtp_packet.Parse(packet.data)) { + EXPECT_TRUE(rtp_packet.HasExtension()); + received_abs_send_time = true; } }); RTC_CHECK(s.WaitAndProcess(&received_abs_send_time)); diff --git a/test/rtp_file_reader_unittest.cc b/test/rtp_file_reader_unittest.cc index 8dc817de60..995d9fbc9d 100644 --- a/test/rtp_file_reader_unittest.cc +++ b/test/rtp_file_reader_unittest.cc @@ -13,7 +13,8 @@ #include #include -#include "modules/rtp_rtcp/source/rtp_utility.h" +#include "api/array_view.h" +#include "modules/rtp_rtcp/source/rtp_util.h" #include "test/gtest.h" #include "test/testsupport/file_utils.h" @@ -84,11 +85,9 @@ class TestPcapFileReader : public ::testing::Test { PacketsPerSsrc pps; test::RtpPacket packet; while (rtp_packet_source_->NextPacket(&packet)) { - RtpUtility::RtpHeaderParser rtp_header_parser(packet.data, packet.length); - webrtc::RTPHeader header; - if (!rtp_header_parser.RTCP() && - rtp_header_parser.Parse(&header, nullptr)) { - pps[header.ssrc]++; + rtc::ArrayView raw(packet.data, packet.length); + if (IsRtpPacket(raw)) { + pps[ParseRtpSsrc(raw)]++; } } return pps; From f7448fb8829b7cd639cdd5a6928c51722b7f17bc Mon Sep 17 00:00:00 2001 From: Danil Chapovalov Date: Fri, 23 Jul 2021 15:06:36 +0200 Subject: [PATCH 0089/1565] Handle scenario when dependency descriptor fails to attach to a key frame Bug: chromium:1232358 Change-Id: I2c8a92fb3ac4ab981782077e29179ff2bece6c6c Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226861 Reviewed-by: Philip Eliasson Commit-Queue: Danil Chapovalov Cr-Commit-Position: refs/heads/master@{#34552} --- modules/rtp_rtcp/source/rtp_sender_video.cc | 12 +++++ .../source/rtp_sender_video_unittest.cc | 54 +++++++++++++++++++ 2 files changed, 66 insertions(+) diff --git a/modules/rtp_rtcp/source/rtp_sender_video.cc b/modules/rtp_rtcp/source/rtp_sender_video.cc index bb9080ff69..fa9c5ad8b1 100644 --- a/modules/rtp_rtcp/source/rtp_sender_video.cc +++ b/modules/rtp_rtcp/source/rtp_sender_video.cc @@ -539,6 +539,18 @@ bool RTPSenderVideo::SendVideo( AddRtpHeaderExtensions(video_header, absolute_capture_time, /*first_packet=*/true, /*last_packet=*/true, single_packet.get()); + if (video_structure_ != nullptr && + single_packet->IsRegistered() && + !single_packet->HasExtension()) { + RTC_DCHECK_EQ(video_header.frame_type, VideoFrameType::kVideoFrameKey); + // Disable attaching dependency descriptor to delta packets (including + // non-first packet of a key frame) when it wasn't attached to a key frame, + // as dependency descriptor can't be usable in such case. + RTC_LOG(LS_WARNING) << "Disable dependency descriptor because failed to " + "attach it to a key frame."; + video_structure_ = nullptr; + } + AddRtpHeaderExtensions(video_header, absolute_capture_time, /*first_packet=*/true, /*last_packet=*/false, first_packet.get()); diff --git a/modules/rtp_rtcp/source/rtp_sender_video_unittest.cc b/modules/rtp_rtcp/source/rtp_sender_video_unittest.cc index ea727828cc..6f1c038f7b 100644 --- a/modules/rtp_rtcp/source/rtp_sender_video_unittest.cc +++ b/modules/rtp_rtcp/source/rtp_sender_video_unittest.cc @@ -572,6 +572,60 @@ TEST_P(RtpSenderVideoTest, SendsDependencyDescriptorWhenVideoStructureIsSet) { ElementsAre(1, 501)); } +TEST_P(RtpSenderVideoTest, + SkipsDependencyDescriptorOnDeltaFrameWhenFailedToAttachToKeyFrame) { + const int64_t kFrameId = 100000; + uint8_t kFrame[100]; + rtp_module_->RegisterRtpHeaderExtension( + RtpDependencyDescriptorExtension::kUri, kDependencyDescriptorId); + rtp_module_->SetExtmapAllowMixed(false); + FrameDependencyStructure video_structure; + video_structure.num_decode_targets = 2; + // Use many templates so that key dependency descriptor would be too large + // to fit into 16 bytes (max size of one byte header rtp header extension) + video_structure.templates = { + FrameDependencyTemplate().S(0).T(0).Dtis("SS"), + FrameDependencyTemplate().S(1).T(0).Dtis("-S"), + FrameDependencyTemplate().S(1).T(1).Dtis("-D").FrameDiffs({1, 2, 3, 4}), + FrameDependencyTemplate().S(1).T(1).Dtis("-D").FrameDiffs({2, 3, 4, 5}), + FrameDependencyTemplate().S(1).T(1).Dtis("-D").FrameDiffs({3, 4, 5, 6}), + FrameDependencyTemplate().S(1).T(1).Dtis("-D").FrameDiffs({4, 5, 6, 7}), + }; + rtp_sender_video_->SetVideoStructure(&video_structure); + + // Send key frame. + RTPVideoHeader hdr; + RTPVideoHeader::GenericDescriptorInfo& generic = hdr.generic.emplace(); + generic.frame_id = kFrameId; + generic.temporal_index = 0; + generic.spatial_index = 0; + generic.decode_target_indications = {DecodeTargetIndication::kSwitch, + DecodeTargetIndication::kSwitch}; + hdr.frame_type = VideoFrameType::kVideoFrameKey; + rtp_sender_video_->SendVideo(kPayload, kType, kTimestamp, 0, kFrame, hdr, + kDefaultExpectedRetransmissionTimeMs); + + ASSERT_EQ(transport_.packets_sent(), 1); + DependencyDescriptor descriptor_key; + ASSERT_FALSE(transport_.last_sent_packet() + .HasExtension()); + + // Send delta frame. + generic.frame_id = kFrameId + 1; + generic.temporal_index = 1; + generic.spatial_index = 1; + generic.dependencies = {kFrameId, kFrameId - 500}; + generic.decode_target_indications = {DecodeTargetIndication::kNotPresent, + DecodeTargetIndication::kRequired}; + hdr.frame_type = VideoFrameType::kVideoFrameDelta; + rtp_sender_video_->SendVideo(kPayload, kType, kTimestamp, 0, kFrame, hdr, + kDefaultExpectedRetransmissionTimeMs); + + EXPECT_EQ(transport_.packets_sent(), 2); + EXPECT_FALSE(transport_.last_sent_packet() + .HasExtension()); +} + TEST_P(RtpSenderVideoTest, PropagatesChainDiffsIntoDependencyDescriptor) { const int64_t kFrameId = 100000; uint8_t kFrame[100]; From 7750d802a5f3de67a49db478a97f824d3b958bf3 Mon Sep 17 00:00:00 2001 From: Mirko Bonadei Date: Mon, 26 Jul 2021 17:27:42 +0200 Subject: [PATCH 0090/1565] Rename rtc_base/ssl_stream_adapter.h constants. Uppercase constants are more likely to conflict with macros (for example rtc::SRTP_AES128_CM_SHA1_80 and OpenSSL SRTP_AES128_CM_SHA1_80). This CL renames some constants and follows the C++ style guide. Bug: webrtc:12997 Change-Id: I2398232568b352f88afed571a9b698040bb81c30 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226564 Commit-Queue: Mirko Bonadei Reviewed-by: Harald Alvestrand Cr-Commit-Position: refs/heads/master@{#34553} --- api/crypto/crypto_options.cc | 14 ++--- api/crypto/crypto_options.h | 2 +- p2p/base/dtls_transport_unittest.cc | 10 +-- p2p/base/fake_dtls_transport.h | 2 +- pc/jsep_transport_unittest.cc | 26 ++++---- pc/media_session.cc | 24 +++---- pc/media_session_unittest.cc | 16 ++--- pc/peer_connection.cc | 20 +++--- pc/peer_connection_integrationtest.cc | 6 +- pc/rtc_stats_collector.cc | 4 +- pc/rtc_stats_collector_unittest.cc | 2 +- pc/srtp_filter.cc | 4 +- pc/srtp_filter_unittest.cc | 53 +++++++--------- pc/srtp_session.h | 2 +- pc/srtp_session_unittest.cc | 60 +++++++++--------- pc/srtp_transport.cc | 4 +- pc/srtp_transport_unittest.cc | 58 ++++++++--------- pc/stats_collector.cc | 4 +- pc/stats_collector_unittest.cc | 4 +- pc/test/integration_test_helpers.h | 4 +- pc/test/srtp_test_util.h | 12 ++-- pc/transport_stats.h | 4 +- rtc_base/openssl_stream_adapter.cc | 8 +-- rtc_base/ssl_stream_adapter.cc | 62 +++++++++++-------- rtc_base/ssl_stream_adapter.h | 30 +++++++-- rtc_base/ssl_stream_adapter_unittest.cc | 54 ++++++++-------- sdk/android/api/org/webrtc/CryptoOptions.java | 2 +- .../api/peerconnection/RTCCryptoOptions.h | 2 +- 28 files changed, 254 insertions(+), 239 deletions(-) diff --git a/api/crypto/crypto_options.cc b/api/crypto/crypto_options.cc index f47e844596..22c5dd464b 100644 --- a/api/crypto/crypto_options.cc +++ b/api/crypto/crypto_options.cc @@ -32,24 +32,24 @@ CryptoOptions CryptoOptions::NoGcm() { std::vector CryptoOptions::GetSupportedDtlsSrtpCryptoSuites() const { std::vector crypto_suites; - // Note: SRTP_AES128_CM_SHA1_80 is what is required to be supported (by - // draft-ietf-rtcweb-security-arch), but SRTP_AES128_CM_SHA1_32 is allowed as + // Note: kSrtpAes128CmSha1_80 is what is required to be supported (by + // draft-ietf-rtcweb-security-arch), but kSrtpAes128CmSha1_32 is allowed as // well, and saves a few bytes per packet if it ends up selected. // As the cipher suite is potentially insecure, it will only be used if // enabled by both peers. if (srtp.enable_aes128_sha1_32_crypto_cipher) { - crypto_suites.push_back(rtc::SRTP_AES128_CM_SHA1_32); + crypto_suites.push_back(rtc::kSrtpAes128CmSha1_32); } if (srtp.enable_aes128_sha1_80_crypto_cipher) { - crypto_suites.push_back(rtc::SRTP_AES128_CM_SHA1_80); + crypto_suites.push_back(rtc::kSrtpAes128CmSha1_80); } // Note: GCM cipher suites are not the top choice since they increase the // packet size. In order to negotiate them the other side must not support - // SRTP_AES128_CM_SHA1_80. + // kSrtpAes128CmSha1_80. if (srtp.enable_gcm_crypto_suites) { - crypto_suites.push_back(rtc::SRTP_AEAD_AES_256_GCM); - crypto_suites.push_back(rtc::SRTP_AEAD_AES_128_GCM); + crypto_suites.push_back(rtc::kSrtpAeadAes256Gcm); + crypto_suites.push_back(rtc::kSrtpAeadAes128Gcm); } RTC_CHECK(!crypto_suites.empty()); return crypto_suites; diff --git a/api/crypto/crypto_options.h b/api/crypto/crypto_options.h index 5f6cea6c82..317995134a 100644 --- a/api/crypto/crypto_options.h +++ b/api/crypto/crypto_options.h @@ -44,7 +44,7 @@ struct RTC_EXPORT CryptoOptions { bool enable_gcm_crypto_suites = false; // If set to true, the (potentially insecure) crypto cipher - // SRTP_AES128_CM_SHA1_32 will be included in the list of supported ciphers + // kSrtpAes128CmSha1_32 will be included in the list of supported ciphers // during negotiation. It will only be used if both peers support it and no // other ciphers get preferred. bool enable_aes128_sha1_32_crypto_cipher = false; diff --git a/p2p/base/dtls_transport_unittest.cc b/p2p/base/dtls_transport_unittest.cc index f01566d263..f584d94ac4 100644 --- a/p2p/base/dtls_transport_unittest.cc +++ b/p2p/base/dtls_transport_unittest.cc @@ -338,14 +338,14 @@ class DtlsTransportTestBase { if (use_dtls_) { // Check that we negotiated the right ciphers. Since GCM ciphers are not - // negotiated by default, we should end up with SRTP_AES128_CM_SHA1_80. - client1_.CheckSrtp(rtc::SRTP_AES128_CM_SHA1_80); - client2_.CheckSrtp(rtc::SRTP_AES128_CM_SHA1_80); + // negotiated by default, we should end up with kSrtpAes128CmSha1_80. + client1_.CheckSrtp(rtc::kSrtpAes128CmSha1_80); + client2_.CheckSrtp(rtc::kSrtpAes128CmSha1_80); } else { // If DTLS isn't actually being used, GetSrtpCryptoSuite should return // false. - client1_.CheckSrtp(rtc::SRTP_INVALID_CRYPTO_SUITE); - client2_.CheckSrtp(rtc::SRTP_INVALID_CRYPTO_SUITE); + client1_.CheckSrtp(rtc::kSrtpInvalidCryptoSuite); + client2_.CheckSrtp(rtc::kSrtpInvalidCryptoSuite); } client1_.CheckSsl(); diff --git a/p2p/base/fake_dtls_transport.h b/p2p/base/fake_dtls_transport.h index e02755c68f..af00016f9e 100644 --- a/p2p/base/fake_dtls_transport.h +++ b/p2p/base/fake_dtls_transport.h @@ -293,7 +293,7 @@ class FakeDtlsTransport : public DtlsTransportInternal { rtc::SSLProtocolVersion ssl_max_version_ = rtc::SSL_PROTOCOL_DTLS_12; rtc::SSLFingerprint dtls_fingerprint_; absl::optional dtls_role_; - int crypto_suite_ = rtc::SRTP_AES128_CM_SHA1_80; + int crypto_suite_ = rtc::kSrtpAes128CmSha1_80; absl::optional ssl_cipher_suite_; webrtc::DtlsTransportState dtls_state_ = webrtc::DtlsTransportState::kNew; diff --git a/pc/jsep_transport_unittest.cc b/pc/jsep_transport_unittest.cc index ffca560cdd..8c526a9613 100644 --- a/pc/jsep_transport_unittest.cc +++ b/pc/jsep_transport_unittest.cc @@ -924,8 +924,8 @@ TEST_F(JsepTransport2Test, SdesNegotiation) { JsepTransportDescription offer_desc; offer_desc.cryptos.push_back(cricket::CryptoParams( - 1, rtc::CS_AES_CM_128_HMAC_SHA1_32, - "inline:" + rtc::CreateRandomString(40), std::string())); + 1, rtc::kCsAesCm128HmacSha1_32, "inline:" + rtc::CreateRandomString(40), + std::string())); ASSERT_TRUE( jsep_transport_ ->SetLocalJsepTransportDescription(offer_desc, SdpType::kOffer) @@ -933,8 +933,8 @@ TEST_F(JsepTransport2Test, SdesNegotiation) { JsepTransportDescription answer_desc; answer_desc.cryptos.push_back(cricket::CryptoParams( - 1, rtc::CS_AES_CM_128_HMAC_SHA1_32, - "inline:" + rtc::CreateRandomString(40), std::string())); + 1, rtc::kCsAesCm128HmacSha1_32, "inline:" + rtc::CreateRandomString(40), + std::string())); ASSERT_TRUE( jsep_transport_ ->SetRemoteJsepTransportDescription(answer_desc, SdpType::kAnswer) @@ -950,8 +950,8 @@ TEST_F(JsepTransport2Test, SdesNegotiationWithEmptyCryptosInAnswer) { JsepTransportDescription offer_desc; offer_desc.cryptos.push_back(cricket::CryptoParams( - 1, rtc::CS_AES_CM_128_HMAC_SHA1_32, - "inline:" + rtc::CreateRandomString(40), std::string())); + 1, rtc::kCsAesCm128HmacSha1_32, "inline:" + rtc::CreateRandomString(40), + std::string())); ASSERT_TRUE( jsep_transport_ ->SetLocalJsepTransportDescription(offer_desc, SdpType::kOffer) @@ -974,8 +974,8 @@ TEST_F(JsepTransport2Test, SdesNegotiationWithMismatchedCryptos) { JsepTransportDescription offer_desc; offer_desc.cryptos.push_back(cricket::CryptoParams( - 1, rtc::CS_AES_CM_128_HMAC_SHA1_32, - "inline:" + rtc::CreateRandomString(40), std::string())); + 1, rtc::kCsAesCm128HmacSha1_32, "inline:" + rtc::CreateRandomString(40), + std::string())); ASSERT_TRUE( jsep_transport_ ->SetLocalJsepTransportDescription(offer_desc, SdpType::kOffer) @@ -983,8 +983,8 @@ TEST_F(JsepTransport2Test, SdesNegotiationWithMismatchedCryptos) { JsepTransportDescription answer_desc; answer_desc.cryptos.push_back(cricket::CryptoParams( - 1, rtc::CS_AES_CM_128_HMAC_SHA1_80, - "inline:" + rtc::CreateRandomString(40), std::string())); + 1, rtc::kCsAesCm128HmacSha1_80, "inline:" + rtc::CreateRandomString(40), + std::string())); // Expected to fail because the crypto parameters don't match. ASSERT_FALSE( jsep_transport_ @@ -1148,7 +1148,7 @@ TEST_P(JsepTransport2HeaderExtensionTest, EncryptedHeaderExtensionNegotiation) { recv_encrypted_headers1_.push_back(kHeaderExtensionIDs[0]); recv_encrypted_headers2_.push_back(kHeaderExtensionIDs[1]); - cricket::CryptoParams sdes_param(1, rtc::CS_AES_CM_128_HMAC_SHA1_80, + cricket::CryptoParams sdes_param(1, rtc::kCsAesCm128HmacSha1_80, "inline:" + rtc::CreateRandomString(40), std::string()); if (use_gcm) { @@ -1157,8 +1157,8 @@ TEST_P(JsepTransport2HeaderExtensionTest, EncryptedHeaderExtensionNegotiation) { auto fake_dtls2 = static_cast(jsep_transport2_->rtp_dtls_transport()); - fake_dtls1->SetSrtpCryptoSuite(rtc::SRTP_AEAD_AES_256_GCM); - fake_dtls2->SetSrtpCryptoSuite(rtc::SRTP_AEAD_AES_256_GCM); + fake_dtls1->SetSrtpCryptoSuite(rtc::kSrtpAeadAes256Gcm); + fake_dtls2->SetSrtpCryptoSuite(rtc::kSrtpAeadAes256Gcm); } if (scenario == Scenario::kDtlsBeforeCallerSendOffer) { diff --git a/pc/media_session.cc b/pc/media_session.cc index 3c73ddf535..0944a7a357 100644 --- a/pc/media_session.cc +++ b/pc/media_session.cc @@ -240,12 +240,12 @@ void GetSupportedAudioSdesCryptoSuites( const webrtc::CryptoOptions& crypto_options, std::vector* crypto_suites) { if (crypto_options.srtp.enable_aes128_sha1_32_crypto_cipher) { - crypto_suites->push_back(rtc::SRTP_AES128_CM_SHA1_32); + crypto_suites->push_back(rtc::kSrtpAes128CmSha1_32); } - crypto_suites->push_back(rtc::SRTP_AES128_CM_SHA1_80); + crypto_suites->push_back(rtc::kSrtpAes128CmSha1_80); if (crypto_options.srtp.enable_gcm_crypto_suites) { - crypto_suites->push_back(rtc::SRTP_AEAD_AES_256_GCM); - crypto_suites->push_back(rtc::SRTP_AEAD_AES_128_GCM); + crypto_suites->push_back(rtc::kSrtpAeadAes256Gcm); + crypto_suites->push_back(rtc::kSrtpAeadAes128Gcm); } } @@ -259,10 +259,10 @@ void GetSupportedAudioSdesCryptoSuiteNames( void GetSupportedVideoSdesCryptoSuites( const webrtc::CryptoOptions& crypto_options, std::vector* crypto_suites) { - crypto_suites->push_back(rtc::SRTP_AES128_CM_SHA1_80); + crypto_suites->push_back(rtc::kSrtpAes128CmSha1_80); if (crypto_options.srtp.enable_gcm_crypto_suites) { - crypto_suites->push_back(rtc::SRTP_AEAD_AES_256_GCM); - crypto_suites->push_back(rtc::SRTP_AEAD_AES_128_GCM); + crypto_suites->push_back(rtc::kSrtpAeadAes256Gcm); + crypto_suites->push_back(rtc::kSrtpAeadAes128Gcm); } } @@ -276,10 +276,10 @@ void GetSupportedVideoSdesCryptoSuiteNames( void GetSupportedDataSdesCryptoSuites( const webrtc::CryptoOptions& crypto_options, std::vector* crypto_suites) { - crypto_suites->push_back(rtc::SRTP_AES128_CM_SHA1_80); + crypto_suites->push_back(rtc::kSrtpAes128CmSha1_80); if (crypto_options.srtp.enable_gcm_crypto_suites) { - crypto_suites->push_back(rtc::SRTP_AEAD_AES_256_GCM); - crypto_suites->push_back(rtc::SRTP_AEAD_AES_128_GCM); + crypto_suites->push_back(rtc::kSrtpAeadAes256Gcm); + crypto_suites->push_back(rtc::kSrtpAeadAes128Gcm); } } @@ -304,8 +304,8 @@ static bool SelectCrypto(const MediaContentDescription* offer, for (const CryptoParams& crypto : cryptos) { if ((crypto_options.srtp.enable_gcm_crypto_suites && rtc::IsGcmCryptoSuiteName(crypto.cipher_suite)) || - rtc::CS_AES_CM_128_HMAC_SHA1_80 == crypto.cipher_suite || - (rtc::CS_AES_CM_128_HMAC_SHA1_32 == crypto.cipher_suite && audio && + rtc::kCsAesCm128HmacSha1_80 == crypto.cipher_suite || + (rtc::kCsAesCm128HmacSha1_32 == crypto.cipher_suite && audio && !bundle && crypto_options.srtp.enable_aes128_sha1_32_crypto_cipher)) { return CreateCryptoParams(crypto.tag, crypto.cipher_suite, crypto_out); } diff --git a/pc/media_session_unittest.cc b/pc/media_session_unittest.cc index c7c07fc527..c808d94080 100644 --- a/pc/media_session_unittest.cc +++ b/pc/media_session_unittest.cc @@ -80,10 +80,10 @@ using cricket::TransportDescriptionFactory; using cricket::TransportInfo; using cricket::VideoCodec; using cricket::VideoContentDescription; -using rtc::CS_AEAD_AES_128_GCM; -using rtc::CS_AEAD_AES_256_GCM; -using rtc::CS_AES_CM_128_HMAC_SHA1_32; -using rtc::CS_AES_CM_128_HMAC_SHA1_80; +using rtc::kCsAeadAes128Gcm; +using rtc::kCsAeadAes256Gcm; +using rtc::kCsAesCm128HmacSha1_32; +using rtc::kCsAesCm128HmacSha1_80; using rtc::UniqueRandomIdGenerator; using ::testing::Contains; using ::testing::Each; @@ -267,8 +267,8 @@ static const char* kMediaProtocolsDtls[] = { // SRTP cipher name negotiated by the tests. This must be updated if the // default changes. -static const char* kDefaultSrtpCryptoSuite = CS_AES_CM_128_HMAC_SHA1_80; -static const char* kDefaultSrtpCryptoSuiteGcm = CS_AEAD_AES_256_GCM; +static const char* kDefaultSrtpCryptoSuite = kCsAesCm128HmacSha1_80; +static const char* kDefaultSrtpCryptoSuiteGcm = kCsAeadAes256Gcm; // These constants are used to make the code using "AddMediaDescriptionOptions" // more readable. @@ -408,8 +408,8 @@ void PreferGcmCryptoParameters(CryptoParamsVec* cryptos) { cryptos->erase( std::remove_if(cryptos->begin(), cryptos->end(), [](const cricket::CryptoParams& crypto) { - return crypto.cipher_suite != CS_AEAD_AES_256_GCM && - crypto.cipher_suite != CS_AEAD_AES_128_GCM; + return crypto.cipher_suite != kCsAeadAes256Gcm && + crypto.cipher_suite != kCsAeadAes128Gcm; }), cryptos->end()); } diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc index 276af1787d..8ddf42ca34 100644 --- a/pc/peer_connection.cc +++ b/pc/peer_connection.cc @@ -2741,28 +2741,28 @@ void PeerConnection::ReportNegotiatedCiphers( int srtp_crypto_suite = stats.channel_stats[0].srtp_crypto_suite; int ssl_cipher_suite = stats.channel_stats[0].ssl_cipher_suite; - if (srtp_crypto_suite == rtc::SRTP_INVALID_CRYPTO_SUITE && - ssl_cipher_suite == rtc::TLS_NULL_WITH_NULL_NULL) { + if (srtp_crypto_suite == rtc::kSrtpInvalidCryptoSuite && + ssl_cipher_suite == rtc::kTlsNullWithNullNull) { return; } - if (srtp_crypto_suite != rtc::SRTP_INVALID_CRYPTO_SUITE) { + if (srtp_crypto_suite != rtc::kSrtpInvalidCryptoSuite) { for (cricket::MediaType media_type : media_types) { switch (media_type) { case cricket::MEDIA_TYPE_AUDIO: RTC_HISTOGRAM_ENUMERATION_SPARSE( "WebRTC.PeerConnection.SrtpCryptoSuite.Audio", srtp_crypto_suite, - rtc::SRTP_CRYPTO_SUITE_MAX_VALUE); + rtc::kSrtpCryptoSuiteMaxValue); break; case cricket::MEDIA_TYPE_VIDEO: RTC_HISTOGRAM_ENUMERATION_SPARSE( "WebRTC.PeerConnection.SrtpCryptoSuite.Video", srtp_crypto_suite, - rtc::SRTP_CRYPTO_SUITE_MAX_VALUE); + rtc::kSrtpCryptoSuiteMaxValue); break; case cricket::MEDIA_TYPE_DATA: RTC_HISTOGRAM_ENUMERATION_SPARSE( "WebRTC.PeerConnection.SrtpCryptoSuite.Data", srtp_crypto_suite, - rtc::SRTP_CRYPTO_SUITE_MAX_VALUE); + rtc::kSrtpCryptoSuiteMaxValue); break; default: RTC_NOTREACHED(); @@ -2771,23 +2771,23 @@ void PeerConnection::ReportNegotiatedCiphers( } } - if (ssl_cipher_suite != rtc::TLS_NULL_WITH_NULL_NULL) { + if (ssl_cipher_suite != rtc::kTlsNullWithNullNull) { for (cricket::MediaType media_type : media_types) { switch (media_type) { case cricket::MEDIA_TYPE_AUDIO: RTC_HISTOGRAM_ENUMERATION_SPARSE( "WebRTC.PeerConnection.SslCipherSuite.Audio", ssl_cipher_suite, - rtc::SSL_CIPHER_SUITE_MAX_VALUE); + rtc::kSslCipherSuiteMaxValue); break; case cricket::MEDIA_TYPE_VIDEO: RTC_HISTOGRAM_ENUMERATION_SPARSE( "WebRTC.PeerConnection.SslCipherSuite.Video", ssl_cipher_suite, - rtc::SSL_CIPHER_SUITE_MAX_VALUE); + rtc::kSslCipherSuiteMaxValue); break; case cricket::MEDIA_TYPE_DATA: RTC_HISTOGRAM_ENUMERATION_SPARSE( "WebRTC.PeerConnection.SslCipherSuite.Data", ssl_cipher_suite, - rtc::SSL_CIPHER_SUITE_MAX_VALUE); + rtc::kSslCipherSuiteMaxValue); break; default: RTC_NOTREACHED(); diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc index 53b674d851..4ec86b3af3 100644 --- a/pc/peer_connection_integrationtest.cc +++ b/pc/peer_connection_integrationtest.cc @@ -1762,7 +1762,7 @@ TEST_P(PeerConnectionIntegrationTest, PeerConnectionFactory::Options callee_options; callee_options.crypto_options.srtp.enable_aes128_sha1_32_crypto_cipher = false; - int expected_cipher_suite = rtc::SRTP_AES128_CM_SHA1_80; + int expected_cipher_suite = rtc::kSrtpAes128CmSha1_80; TestNegotiatedCipherSuite(caller_options, callee_options, expected_cipher_suite); } @@ -1774,7 +1774,7 @@ TEST_P(PeerConnectionIntegrationTest, false; PeerConnectionFactory::Options callee_options; callee_options.crypto_options.srtp.enable_aes128_sha1_32_crypto_cipher = true; - int expected_cipher_suite = rtc::SRTP_AES128_CM_SHA1_80; + int expected_cipher_suite = rtc::kSrtpAes128CmSha1_80; TestNegotiatedCipherSuite(caller_options, callee_options, expected_cipher_suite); } @@ -1784,7 +1784,7 @@ TEST_P(PeerConnectionIntegrationTest, Aes128Sha1_32_CipherUsedWhenSupported) { caller_options.crypto_options.srtp.enable_aes128_sha1_32_crypto_cipher = true; PeerConnectionFactory::Options callee_options; callee_options.crypto_options.srtp.enable_aes128_sha1_32_crypto_cipher = true; - int expected_cipher_suite = rtc::SRTP_AES128_CM_SHA1_32; + int expected_cipher_suite = rtc::kSrtpAes128CmSha1_32; TestNegotiatedCipherSuite(caller_options, callee_options, expected_cipher_suite); } diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc index ee5826486c..1fdc736227 100644 --- a/pc/rtc_stats_collector.cc +++ b/pc/rtc_stats_collector.cc @@ -2036,7 +2036,7 @@ void RTCStatsCollector::ProduceTransportStats_n( snprintf(bytes, sizeof(bytes), "%04X", channel_stats.ssl_version_bytes); transport_stats->tls_version = bytes; } - if (channel_stats.ssl_cipher_suite != rtc::TLS_NULL_WITH_NULL_NULL && + if (channel_stats.ssl_cipher_suite != rtc::kTlsNullWithNullNull && rtc::SSLStreamAdapter::SslCipherSuiteToName( channel_stats.ssl_cipher_suite) .length()) { @@ -2044,7 +2044,7 @@ void RTCStatsCollector::ProduceTransportStats_n( rtc::SSLStreamAdapter::SslCipherSuiteToName( channel_stats.ssl_cipher_suite); } - if (channel_stats.srtp_crypto_suite != rtc::SRTP_INVALID_CRYPTO_SUITE && + if (channel_stats.srtp_crypto_suite != rtc::kSrtpInvalidCryptoSuite && rtc::SrtpCryptoSuiteToName(channel_stats.srtp_crypto_suite) .length()) { transport_stats->srtp_cipher = diff --git a/pc/rtc_stats_collector_unittest.cc b/pc/rtc_stats_collector_unittest.cc index 4ec86ab24f..44cafbc9a2 100644 --- a/pc/rtc_stats_collector_unittest.cc +++ b/pc/rtc_stats_collector_unittest.cc @@ -2528,7 +2528,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCTransportStatsWithCrypto) { rtp_transport_channel_stats.ssl_version_bytes = 0x0203; // 0x2F is TLS_RSA_WITH_AES_128_CBC_SHA according to IANA rtp_transport_channel_stats.ssl_cipher_suite = 0x2F; - rtp_transport_channel_stats.srtp_crypto_suite = rtc::SRTP_AES128_CM_SHA1_80; + rtp_transport_channel_stats.srtp_crypto_suite = rtc::kSrtpAes128CmSha1_80; pc_->SetTransportStats(kTransportName, {rtp_transport_channel_stats}); // Get stats diff --git a/pc/srtp_filter.cc b/pc/srtp_filter.cc index 2f8d06cbea..c48dfdb4cd 100644 --- a/pc/srtp_filter.cc +++ b/pc/srtp_filter.cc @@ -200,7 +200,7 @@ bool SrtpFilter::ApplySendParams(const CryptoParams& send_params) { } send_cipher_suite_ = rtc::SrtpCryptoSuiteFromName(send_params.cipher_suite); - if (send_cipher_suite_ == rtc::SRTP_INVALID_CRYPTO_SUITE) { + if (send_cipher_suite_ == rtc::kSrtpInvalidCryptoSuite) { RTC_LOG(LS_WARNING) << "Unknown crypto suite(s) received:" " send cipher_suite " << send_params.cipher_suite; @@ -231,7 +231,7 @@ bool SrtpFilter::ApplyRecvParams(const CryptoParams& recv_params) { } recv_cipher_suite_ = rtc::SrtpCryptoSuiteFromName(recv_params.cipher_suite); - if (recv_cipher_suite_ == rtc::SRTP_INVALID_CRYPTO_SUITE) { + if (recv_cipher_suite_ == rtc::kSrtpInvalidCryptoSuite) { RTC_LOG(LS_WARNING) << "Unknown crypto suite(s) received:" " recv cipher_suite " << recv_params.cipher_suite; diff --git a/pc/srtp_filter_unittest.cc b/pc/srtp_filter_unittest.cc index 9a5720614c..eadaad68af 100644 --- a/pc/srtp_filter_unittest.cc +++ b/pc/srtp_filter_unittest.cc @@ -122,9 +122,9 @@ TEST_F(SrtpFilterTest, TestGoodSetupMultipleCipherSuites) { std::vector answer(MakeVector(kTestCryptoParams2)); offer.push_back(kTestCryptoParams1); offer[1].tag = 2; - offer[1].cipher_suite = CS_AES_CM_128_HMAC_SHA1_32; + offer[1].cipher_suite = kCsAesCm128HmacSha1_32; answer[0].tag = 2; - answer[0].cipher_suite = CS_AES_CM_128_HMAC_SHA1_32; + answer[0].cipher_suite = kCsAesCm128HmacSha1_32; EXPECT_TRUE(f1_.SetOffer(offer, CS_LOCAL)); EXPECT_FALSE(f1_.IsActive()); EXPECT_TRUE(f1_.SetAnswer(answer, CS_REMOTE)); @@ -224,7 +224,7 @@ TEST_F(SrtpFilterTest, TestMultipleAnswerCipherSuites) { std::vector answer(MakeVector(kTestCryptoParams2)); answer.push_back(kTestCryptoParams2); answer[1].tag = 2; - answer[1].cipher_suite = CS_AES_CM_128_HMAC_SHA1_32; + answer[1].cipher_suite = kCsAesCm128HmacSha1_32; EXPECT_TRUE(f1_.SetOffer(MakeVector(kTestCryptoParams1), CS_LOCAL)); EXPECT_FALSE(f1_.SetAnswer(answer, CS_REMOTE)); EXPECT_FALSE(f1_.IsActive()); @@ -318,10 +318,9 @@ TEST_F(SrtpFilterTest, TestProtect_AES_CM_128_HMAC_SHA1_80) { std::vector answer(MakeVector(kTestCryptoParams2)); offer.push_back(kTestCryptoParams1); offer[1].tag = 2; - offer[1].cipher_suite = CS_AES_CM_128_HMAC_SHA1_32; + offer[1].cipher_suite = kCsAesCm128HmacSha1_32; TestSetParams(offer, answer); - VerifyCryptoParamsMatch(CS_AES_CM_128_HMAC_SHA1_80, - CS_AES_CM_128_HMAC_SHA1_80); + VerifyCryptoParamsMatch(kCsAesCm128HmacSha1_80, kCsAesCm128HmacSha1_80); } // Test that we can encrypt/decrypt after negotiating AES_CM_128_HMAC_SHA1_32. @@ -330,12 +329,11 @@ TEST_F(SrtpFilterTest, TestProtect_AES_CM_128_HMAC_SHA1_32) { std::vector answer(MakeVector(kTestCryptoParams2)); offer.push_back(kTestCryptoParams1); offer[1].tag = 2; - offer[1].cipher_suite = CS_AES_CM_128_HMAC_SHA1_32; + offer[1].cipher_suite = kCsAesCm128HmacSha1_32; answer[0].tag = 2; - answer[0].cipher_suite = CS_AES_CM_128_HMAC_SHA1_32; + answer[0].cipher_suite = kCsAesCm128HmacSha1_32; TestSetParams(offer, answer); - VerifyCryptoParamsMatch(CS_AES_CM_128_HMAC_SHA1_32, - CS_AES_CM_128_HMAC_SHA1_32); + VerifyCryptoParamsMatch(kCsAesCm128HmacSha1_32, kCsAesCm128HmacSha1_32); } // Test that we can change encryption parameters. @@ -344,14 +342,13 @@ TEST_F(SrtpFilterTest, TestChangeParameters) { std::vector answer(MakeVector(kTestCryptoParams2)); TestSetParams(offer, answer); - VerifyCryptoParamsMatch(CS_AES_CM_128_HMAC_SHA1_80, - CS_AES_CM_128_HMAC_SHA1_80); + VerifyCryptoParamsMatch(kCsAesCm128HmacSha1_80, kCsAesCm128HmacSha1_80); // Change the key parameters and cipher_suite. offer[0].key_params = kTestKeyParams3; - offer[0].cipher_suite = CS_AES_CM_128_HMAC_SHA1_32; + offer[0].cipher_suite = kCsAesCm128HmacSha1_32; answer[0].key_params = kTestKeyParams4; - answer[0].cipher_suite = CS_AES_CM_128_HMAC_SHA1_32; + answer[0].cipher_suite = kCsAesCm128HmacSha1_32; EXPECT_TRUE(f1_.SetOffer(offer, CS_LOCAL)); EXPECT_TRUE(f2_.SetOffer(offer, CS_REMOTE)); @@ -359,15 +356,13 @@ TEST_F(SrtpFilterTest, TestChangeParameters) { EXPECT_TRUE(f1_.IsActive()); // Test that the old keys are valid until the negotiation is complete. - VerifyCryptoParamsMatch(CS_AES_CM_128_HMAC_SHA1_80, - CS_AES_CM_128_HMAC_SHA1_80); + VerifyCryptoParamsMatch(kCsAesCm128HmacSha1_80, kCsAesCm128HmacSha1_80); // Complete the negotiation and test that we can still understand each other. EXPECT_TRUE(f2_.SetAnswer(answer, CS_LOCAL)); EXPECT_TRUE(f1_.SetAnswer(answer, CS_REMOTE)); - VerifyCryptoParamsMatch(CS_AES_CM_128_HMAC_SHA1_32, - CS_AES_CM_128_HMAC_SHA1_32); + VerifyCryptoParamsMatch(kCsAesCm128HmacSha1_32, kCsAesCm128HmacSha1_32); } // Test that we can send and receive provisional answers with crypto enabled. @@ -376,7 +371,7 @@ TEST_F(SrtpFilterTest, TestProvisionalAnswer) { std::vector offer(MakeVector(kTestCryptoParams1)); offer.push_back(kTestCryptoParams1); offer[1].tag = 2; - offer[1].cipher_suite = CS_AES_CM_128_HMAC_SHA1_32; + offer[1].cipher_suite = kCsAesCm128HmacSha1_32; std::vector answer(MakeVector(kTestCryptoParams2)); EXPECT_TRUE(f1_.SetOffer(offer, CS_LOCAL)); @@ -387,18 +382,16 @@ TEST_F(SrtpFilterTest, TestProvisionalAnswer) { EXPECT_TRUE(f1_.SetProvisionalAnswer(answer, CS_REMOTE)); EXPECT_TRUE(f1_.IsActive()); EXPECT_TRUE(f2_.IsActive()); - VerifyCryptoParamsMatch(CS_AES_CM_128_HMAC_SHA1_80, - CS_AES_CM_128_HMAC_SHA1_80); + VerifyCryptoParamsMatch(kCsAesCm128HmacSha1_80, kCsAesCm128HmacSha1_80); answer[0].key_params = kTestKeyParams4; answer[0].tag = 2; - answer[0].cipher_suite = CS_AES_CM_128_HMAC_SHA1_32; + answer[0].cipher_suite = kCsAesCm128HmacSha1_32; EXPECT_TRUE(f2_.SetAnswer(answer, CS_LOCAL)); EXPECT_TRUE(f1_.SetAnswer(answer, CS_REMOTE)); EXPECT_TRUE(f1_.IsActive()); EXPECT_TRUE(f2_.IsActive()); - VerifyCryptoParamsMatch(CS_AES_CM_128_HMAC_SHA1_32, - CS_AES_CM_128_HMAC_SHA1_32); + VerifyCryptoParamsMatch(kCsAesCm128HmacSha1_32, kCsAesCm128HmacSha1_32); } // Test that a provisional answer doesn't need to contain a crypto. @@ -420,8 +413,7 @@ TEST_F(SrtpFilterTest, TestProvisionalAnswerWithoutCrypto) { EXPECT_TRUE(f1_.SetAnswer(answer, CS_REMOTE)); EXPECT_TRUE(f1_.IsActive()); EXPECT_TRUE(f2_.IsActive()); - VerifyCryptoParamsMatch(CS_AES_CM_128_HMAC_SHA1_80, - CS_AES_CM_128_HMAC_SHA1_80); + VerifyCryptoParamsMatch(kCsAesCm128HmacSha1_80, kCsAesCm128HmacSha1_80); } // Test that if we get a new local offer after a provisional answer @@ -448,8 +440,7 @@ TEST_F(SrtpFilterTest, TestLocalOfferAfterProvisionalAnswerWithoutCrypto) { EXPECT_TRUE(f1_.SetAnswer(answer, CS_REMOTE)); EXPECT_TRUE(f1_.IsActive()); EXPECT_TRUE(f2_.IsActive()); - VerifyCryptoParamsMatch(CS_AES_CM_128_HMAC_SHA1_80, - CS_AES_CM_128_HMAC_SHA1_80); + VerifyCryptoParamsMatch(kCsAesCm128HmacSha1_80, kCsAesCm128HmacSha1_80); } // Test that we can disable encryption. @@ -458,8 +449,7 @@ TEST_F(SrtpFilterTest, TestDisableEncryption) { std::vector answer(MakeVector(kTestCryptoParams2)); TestSetParams(offer, answer); - VerifyCryptoParamsMatch(CS_AES_CM_128_HMAC_SHA1_80, - CS_AES_CM_128_HMAC_SHA1_80); + VerifyCryptoParamsMatch(kCsAesCm128HmacSha1_80, kCsAesCm128HmacSha1_80); offer.clear(); answer.clear(); @@ -469,8 +459,7 @@ TEST_F(SrtpFilterTest, TestDisableEncryption) { EXPECT_TRUE(f2_.IsActive()); // Test that the old keys are valid until the negotiation is complete. - VerifyCryptoParamsMatch(CS_AES_CM_128_HMAC_SHA1_80, - CS_AES_CM_128_HMAC_SHA1_80); + VerifyCryptoParamsMatch(kCsAesCm128HmacSha1_80, kCsAesCm128HmacSha1_80); // Complete the negotiation. EXPECT_TRUE(f2_.SetAnswer(answer, CS_LOCAL)); diff --git a/pc/srtp_session.h b/pc/srtp_session.h index 0396412481..89fab0daf2 100644 --- a/pc/srtp_session.h +++ b/pc/srtp_session.h @@ -129,7 +129,7 @@ class SrtpSession { // Overhead of the SRTP auth tag for RTP and RTCP in bytes. // Depends on the cipher suite used and is usually the same with the exception - // of the CS_AES_CM_128_HMAC_SHA1_32 cipher suite. The additional four bytes + // of the kCsAesCm128HmacSha1_32 cipher suite. The additional four bytes // required for RTCP protection are not included. int rtp_auth_tag_len_ = 0; int rtcp_auth_tag_len_ = 0; diff --git a/pc/srtp_session_unittest.cc b/pc/srtp_session_unittest.cc index d0f6ea6c84..c492c635dc 100644 --- a/pc/srtp_session_unittest.cc +++ b/pc/srtp_session_unittest.cc @@ -79,58 +79,58 @@ class SrtpSessionTest : public ::testing::Test { // Test that we can set up the session and keys properly. TEST_F(SrtpSessionTest, TestGoodSetup) { - EXPECT_TRUE(s1_.SetSend(SRTP_AES128_CM_SHA1_80, kTestKey1, kTestKeyLen, + EXPECT_TRUE(s1_.SetSend(kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen, kEncryptedHeaderExtensionIds)); - EXPECT_TRUE(s2_.SetRecv(SRTP_AES128_CM_SHA1_80, kTestKey1, kTestKeyLen, + EXPECT_TRUE(s2_.SetRecv(kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen, kEncryptedHeaderExtensionIds)); } // Test that we can't change the keys once set. TEST_F(SrtpSessionTest, TestBadSetup) { - EXPECT_TRUE(s1_.SetSend(SRTP_AES128_CM_SHA1_80, kTestKey1, kTestKeyLen, + EXPECT_TRUE(s1_.SetSend(kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen, kEncryptedHeaderExtensionIds)); - EXPECT_TRUE(s2_.SetRecv(SRTP_AES128_CM_SHA1_80, kTestKey1, kTestKeyLen, + EXPECT_TRUE(s2_.SetRecv(kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen, kEncryptedHeaderExtensionIds)); - EXPECT_FALSE(s1_.SetSend(SRTP_AES128_CM_SHA1_80, kTestKey2, kTestKeyLen, + EXPECT_FALSE(s1_.SetSend(kSrtpAes128CmSha1_80, kTestKey2, kTestKeyLen, kEncryptedHeaderExtensionIds)); - EXPECT_FALSE(s2_.SetRecv(SRTP_AES128_CM_SHA1_80, kTestKey2, kTestKeyLen, + EXPECT_FALSE(s2_.SetRecv(kSrtpAes128CmSha1_80, kTestKey2, kTestKeyLen, kEncryptedHeaderExtensionIds)); } // Test that we fail keys of the wrong length. TEST_F(SrtpSessionTest, TestKeysTooShort) { - EXPECT_FALSE(s1_.SetSend(SRTP_AES128_CM_SHA1_80, kTestKey1, 1, + EXPECT_FALSE(s1_.SetSend(kSrtpAes128CmSha1_80, kTestKey1, 1, kEncryptedHeaderExtensionIds)); - EXPECT_FALSE(s2_.SetRecv(SRTP_AES128_CM_SHA1_80, kTestKey1, 1, + EXPECT_FALSE(s2_.SetRecv(kSrtpAes128CmSha1_80, kTestKey1, 1, kEncryptedHeaderExtensionIds)); } // Test that we can encrypt and decrypt RTP/RTCP using AES_CM_128_HMAC_SHA1_80. TEST_F(SrtpSessionTest, TestProtect_AES_CM_128_HMAC_SHA1_80) { - EXPECT_TRUE(s1_.SetSend(SRTP_AES128_CM_SHA1_80, kTestKey1, kTestKeyLen, + EXPECT_TRUE(s1_.SetSend(kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen, kEncryptedHeaderExtensionIds)); - EXPECT_TRUE(s2_.SetRecv(SRTP_AES128_CM_SHA1_80, kTestKey1, kTestKeyLen, + EXPECT_TRUE(s2_.SetRecv(kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen, kEncryptedHeaderExtensionIds)); - TestProtectRtp(CS_AES_CM_128_HMAC_SHA1_80); - TestProtectRtcp(CS_AES_CM_128_HMAC_SHA1_80); - TestUnprotectRtp(CS_AES_CM_128_HMAC_SHA1_80); - TestUnprotectRtcp(CS_AES_CM_128_HMAC_SHA1_80); + TestProtectRtp(kCsAesCm128HmacSha1_80); + TestProtectRtcp(kCsAesCm128HmacSha1_80); + TestUnprotectRtp(kCsAesCm128HmacSha1_80); + TestUnprotectRtcp(kCsAesCm128HmacSha1_80); } // Test that we can encrypt and decrypt RTP/RTCP using AES_CM_128_HMAC_SHA1_32. TEST_F(SrtpSessionTest, TestProtect_AES_CM_128_HMAC_SHA1_32) { - EXPECT_TRUE(s1_.SetSend(SRTP_AES128_CM_SHA1_32, kTestKey1, kTestKeyLen, + EXPECT_TRUE(s1_.SetSend(kSrtpAes128CmSha1_32, kTestKey1, kTestKeyLen, kEncryptedHeaderExtensionIds)); - EXPECT_TRUE(s2_.SetRecv(SRTP_AES128_CM_SHA1_32, kTestKey1, kTestKeyLen, + EXPECT_TRUE(s2_.SetRecv(kSrtpAes128CmSha1_32, kTestKey1, kTestKeyLen, kEncryptedHeaderExtensionIds)); - TestProtectRtp(CS_AES_CM_128_HMAC_SHA1_32); - TestProtectRtcp(CS_AES_CM_128_HMAC_SHA1_32); - TestUnprotectRtp(CS_AES_CM_128_HMAC_SHA1_32); - TestUnprotectRtcp(CS_AES_CM_128_HMAC_SHA1_32); + TestProtectRtp(kCsAesCm128HmacSha1_32); + TestProtectRtcp(kCsAesCm128HmacSha1_32); + TestUnprotectRtp(kCsAesCm128HmacSha1_32); + TestUnprotectRtcp(kCsAesCm128HmacSha1_32); } TEST_F(SrtpSessionTest, TestGetSendStreamPacketIndex) { - EXPECT_TRUE(s1_.SetSend(SRTP_AES128_CM_SHA1_32, kTestKey1, kTestKeyLen, + EXPECT_TRUE(s1_.SetSend(kSrtpAes128CmSha1_32, kTestKey1, kTestKeyLen, kEncryptedHeaderExtensionIds)); int64_t index; int out_len = 0; @@ -144,12 +144,12 @@ TEST_F(SrtpSessionTest, TestGetSendStreamPacketIndex) { // Test that we fail to unprotect if someone tampers with the RTP/RTCP paylaods. TEST_F(SrtpSessionTest, TestTamperReject) { int out_len; - EXPECT_TRUE(s1_.SetSend(SRTP_AES128_CM_SHA1_80, kTestKey1, kTestKeyLen, + EXPECT_TRUE(s1_.SetSend(kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen, kEncryptedHeaderExtensionIds)); - EXPECT_TRUE(s2_.SetRecv(SRTP_AES128_CM_SHA1_80, kTestKey1, kTestKeyLen, + EXPECT_TRUE(s2_.SetRecv(kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen, kEncryptedHeaderExtensionIds)); - TestProtectRtp(CS_AES_CM_128_HMAC_SHA1_80); - TestProtectRtcp(CS_AES_CM_128_HMAC_SHA1_80); + TestProtectRtp(kCsAesCm128HmacSha1_80); + TestProtectRtcp(kCsAesCm128HmacSha1_80); rtp_packet_[0] = 0x12; rtcp_packet_[1] = 0x34; EXPECT_FALSE(s2_.UnprotectRtp(rtp_packet_, rtp_len_, &out_len)); @@ -165,9 +165,9 @@ TEST_F(SrtpSessionTest, TestTamperReject) { // Test that we fail to unprotect if the payloads are not authenticated. TEST_F(SrtpSessionTest, TestUnencryptReject) { int out_len; - EXPECT_TRUE(s1_.SetSend(SRTP_AES128_CM_SHA1_80, kTestKey1, kTestKeyLen, + EXPECT_TRUE(s1_.SetSend(kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen, kEncryptedHeaderExtensionIds)); - EXPECT_TRUE(s2_.SetRecv(SRTP_AES128_CM_SHA1_80, kTestKey1, kTestKeyLen, + EXPECT_TRUE(s2_.SetRecv(kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen, kEncryptedHeaderExtensionIds)); EXPECT_FALSE(s2_.UnprotectRtp(rtp_packet_, rtp_len_, &out_len)); EXPECT_METRIC_THAT( @@ -182,7 +182,7 @@ TEST_F(SrtpSessionTest, TestUnencryptReject) { // Test that we fail when using buffers that are too small. TEST_F(SrtpSessionTest, TestBuffersTooSmall) { int out_len; - EXPECT_TRUE(s1_.SetSend(SRTP_AES128_CM_SHA1_80, kTestKey1, kTestKeyLen, + EXPECT_TRUE(s1_.SetSend(kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen, kEncryptedHeaderExtensionIds)); EXPECT_FALSE(s1_.ProtectRtp(rtp_packet_, rtp_len_, sizeof(rtp_packet_) - 10, &out_len)); @@ -197,9 +197,9 @@ TEST_F(SrtpSessionTest, TestReplay) { static const uint16_t replay_window = 1024; int out_len; - EXPECT_TRUE(s1_.SetSend(SRTP_AES128_CM_SHA1_80, kTestKey1, kTestKeyLen, + EXPECT_TRUE(s1_.SetSend(kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen, kEncryptedHeaderExtensionIds)); - EXPECT_TRUE(s2_.SetRecv(SRTP_AES128_CM_SHA1_80, kTestKey1, kTestKeyLen, + EXPECT_TRUE(s2_.SetRecv(kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen, kEncryptedHeaderExtensionIds)); // Initial sequence number. diff --git a/pc/srtp_transport.cc b/pc/srtp_transport.cc index 47ba6d673f..230c1a347b 100644 --- a/pc/srtp_transport.cc +++ b/pc/srtp_transport.cc @@ -50,7 +50,7 @@ RTCError SrtpTransport::SetSrtpSendKey(const cricket::CryptoParams& params) { } send_cipher_suite_ = rtc::SrtpCryptoSuiteFromName(params.cipher_suite); - if (*send_cipher_suite_ == rtc::SRTP_INVALID_CRYPTO_SUITE) { + if (*send_cipher_suite_ == rtc::kSrtpInvalidCryptoSuite) { return RTCError(RTCErrorType::INVALID_PARAMETER, "Invalid SRTP crypto suite"); } @@ -90,7 +90,7 @@ RTCError SrtpTransport::SetSrtpReceiveKey(const cricket::CryptoParams& params) { } recv_cipher_suite_ = rtc::SrtpCryptoSuiteFromName(params.cipher_suite); - if (*recv_cipher_suite_ == rtc::SRTP_INVALID_CRYPTO_SUITE) { + if (*recv_cipher_suite_ == rtc::kSrtpInvalidCryptoSuite) { return RTCError(RTCErrorType::INVALID_PARAMETER, "Invalid SRTP crypto suite"); } diff --git a/pc/srtp_transport_unittest.cc b/pc/srtp_transport_unittest.cc index fa095bf399..cb8d836f24 100644 --- a/pc/srtp_transport_unittest.cc +++ b/pc/srtp_transport_unittest.cc @@ -29,10 +29,10 @@ #include "rtc_base/third_party/sigslot/sigslot.h" #include "test/gtest.h" +using rtc::kSrtpAeadAes128Gcm; using rtc::kTestKey1; using rtc::kTestKey2; using rtc::kTestKeyLen; -using rtc::SRTP_AEAD_AES_128_GCM; namespace webrtc { static const uint8_t kTestKeyGcm128_1[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ12"; @@ -94,10 +94,10 @@ class SrtpTransportTest : public ::testing::Test, public sigslot::has_slots<> { int overhead; EXPECT_TRUE(transport->GetSrtpOverhead(&overhead)); switch (rtc::SrtpCryptoSuiteFromName(cs)) { - case rtc::SRTP_AES128_CM_SHA1_32: + case rtc::kSrtpAes128CmSha1_32: EXPECT_EQ(32 / 8, overhead); // 32-bit tag. break; - case rtc::SRTP_AES128_CM_SHA1_80: + case rtc::kSrtpAes128CmSha1_80: EXPECT_EQ(80 / 8, overhead); // 80-bit tag. break; default: @@ -343,61 +343,61 @@ class SrtpTransportTestWithExternalAuth TEST_P(SrtpTransportTestWithExternalAuth, SendAndRecvPacket_AES_CM_128_HMAC_SHA1_80) { bool enable_external_auth = GetParam(); - TestSendRecvPacket(enable_external_auth, rtc::SRTP_AES128_CM_SHA1_80, - kTestKey1, kTestKeyLen, kTestKey2, kTestKeyLen, - rtc::CS_AES_CM_128_HMAC_SHA1_80); + TestSendRecvPacket(enable_external_auth, rtc::kSrtpAes128CmSha1_80, kTestKey1, + kTestKeyLen, kTestKey2, kTestKeyLen, + rtc::kCsAesCm128HmacSha1_80); } TEST_F(SrtpTransportTest, SendAndRecvPacketWithHeaderExtension_AES_CM_128_HMAC_SHA1_80) { - TestSendRecvEncryptedHeaderExtension(rtc::SRTP_AES128_CM_SHA1_80, kTestKey1, + TestSendRecvEncryptedHeaderExtension(rtc::kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen, kTestKey2, kTestKeyLen, - rtc::CS_AES_CM_128_HMAC_SHA1_80); + rtc::kCsAesCm128HmacSha1_80); } TEST_P(SrtpTransportTestWithExternalAuth, SendAndRecvPacket_AES_CM_128_HMAC_SHA1_32) { bool enable_external_auth = GetParam(); - TestSendRecvPacket(enable_external_auth, rtc::SRTP_AES128_CM_SHA1_32, - kTestKey1, kTestKeyLen, kTestKey2, kTestKeyLen, - rtc::CS_AES_CM_128_HMAC_SHA1_32); + TestSendRecvPacket(enable_external_auth, rtc::kSrtpAes128CmSha1_32, kTestKey1, + kTestKeyLen, kTestKey2, kTestKeyLen, + rtc::kCsAesCm128HmacSha1_32); } TEST_F(SrtpTransportTest, SendAndRecvPacketWithHeaderExtension_AES_CM_128_HMAC_SHA1_32) { - TestSendRecvEncryptedHeaderExtension(rtc::SRTP_AES128_CM_SHA1_32, kTestKey1, + TestSendRecvEncryptedHeaderExtension(rtc::kSrtpAes128CmSha1_32, kTestKey1, kTestKeyLen, kTestKey2, kTestKeyLen, - rtc::CS_AES_CM_128_HMAC_SHA1_32); + rtc::kCsAesCm128HmacSha1_32); } TEST_P(SrtpTransportTestWithExternalAuth, - SendAndRecvPacket_SRTP_AEAD_AES_128_GCM) { + SendAndRecvPacket_kSrtpAeadAes128Gcm) { bool enable_external_auth = GetParam(); - TestSendRecvPacket(enable_external_auth, rtc::SRTP_AEAD_AES_128_GCM, + TestSendRecvPacket(enable_external_auth, rtc::kSrtpAeadAes128Gcm, kTestKeyGcm128_1, kTestKeyGcm128Len, kTestKeyGcm128_2, - kTestKeyGcm128Len, rtc::CS_AEAD_AES_128_GCM); + kTestKeyGcm128Len, rtc::kCsAeadAes128Gcm); } TEST_F(SrtpTransportTest, - SendAndRecvPacketWithHeaderExtension_SRTP_AEAD_AES_128_GCM) { + SendAndRecvPacketWithHeaderExtension_kSrtpAeadAes128Gcm) { TestSendRecvEncryptedHeaderExtension( - rtc::SRTP_AEAD_AES_128_GCM, kTestKeyGcm128_1, kTestKeyGcm128Len, - kTestKeyGcm128_2, kTestKeyGcm128Len, rtc::CS_AEAD_AES_128_GCM); + rtc::kSrtpAeadAes128Gcm, kTestKeyGcm128_1, kTestKeyGcm128Len, + kTestKeyGcm128_2, kTestKeyGcm128Len, rtc::kCsAeadAes128Gcm); } TEST_P(SrtpTransportTestWithExternalAuth, - SendAndRecvPacket_SRTP_AEAD_AES_256_GCM) { + SendAndRecvPacket_kSrtpAeadAes256Gcm) { bool enable_external_auth = GetParam(); - TestSendRecvPacket(enable_external_auth, rtc::SRTP_AEAD_AES_256_GCM, + TestSendRecvPacket(enable_external_auth, rtc::kSrtpAeadAes256Gcm, kTestKeyGcm256_1, kTestKeyGcm256Len, kTestKeyGcm256_2, - kTestKeyGcm256Len, rtc::CS_AEAD_AES_256_GCM); + kTestKeyGcm256Len, rtc::kCsAeadAes256Gcm); } TEST_F(SrtpTransportTest, - SendAndRecvPacketWithHeaderExtension_SRTP_AEAD_AES_256_GCM) { + SendAndRecvPacketWithHeaderExtension_kSrtpAeadAes256Gcm) { TestSendRecvEncryptedHeaderExtension( - rtc::SRTP_AEAD_AES_256_GCM, kTestKeyGcm256_1, kTestKeyGcm256Len, - kTestKeyGcm256_2, kTestKeyGcm256Len, rtc::CS_AEAD_AES_256_GCM); + rtc::kSrtpAeadAes256Gcm, kTestKeyGcm256_1, kTestKeyGcm256Len, + kTestKeyGcm256_2, kTestKeyGcm256Len, rtc::kCsAeadAes256Gcm); } // Run all tests both with and without external auth enabled. @@ -409,11 +409,11 @@ INSTANTIATE_TEST_SUITE_P(ExternalAuth, TEST_F(SrtpTransportTest, TestSetParamsKeyTooShort) { std::vector extension_ids; EXPECT_FALSE(srtp_transport1_->SetRtpParams( - rtc::SRTP_AES128_CM_SHA1_80, kTestKey1, kTestKeyLen - 1, extension_ids, - rtc::SRTP_AES128_CM_SHA1_80, kTestKey1, kTestKeyLen - 1, extension_ids)); + rtc::kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen - 1, extension_ids, + rtc::kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen - 1, extension_ids)); EXPECT_FALSE(srtp_transport1_->SetRtcpParams( - rtc::SRTP_AES128_CM_SHA1_80, kTestKey1, kTestKeyLen - 1, extension_ids, - rtc::SRTP_AES128_CM_SHA1_80, kTestKey1, kTestKeyLen - 1, extension_ids)); + rtc::kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen - 1, extension_ids, + rtc::kSrtpAes128CmSha1_80, kTestKey1, kTestKeyLen - 1, extension_ids)); } } // namespace webrtc diff --git a/pc/stats_collector.cc b/pc/stats_collector.cc index eb2176ed38..c91566152a 100644 --- a/pc/stats_collector.cc +++ b/pc/stats_collector.cc @@ -977,14 +977,14 @@ void StatsCollector::ExtractSessionInfo_s(SessionStats& session_stats) { remote_cert_report_id); } int srtp_crypto_suite = channel_iter.srtp_crypto_suite; - if (srtp_crypto_suite != rtc::SRTP_INVALID_CRYPTO_SUITE && + if (srtp_crypto_suite != rtc::kSrtpInvalidCryptoSuite && rtc::SrtpCryptoSuiteToName(srtp_crypto_suite).length()) { channel_report->AddString( StatsReport::kStatsValueNameSrtpCipher, rtc::SrtpCryptoSuiteToName(srtp_crypto_suite)); } int ssl_cipher_suite = channel_iter.ssl_cipher_suite; - if (ssl_cipher_suite != rtc::TLS_NULL_WITH_NULL_NULL && + if (ssl_cipher_suite != rtc::kTlsNullWithNullNull && rtc::SSLStreamAdapter::SslCipherSuiteToName(ssl_cipher_suite) .length()) { channel_report->AddString( diff --git a/pc/stats_collector_unittest.cc b/pc/stats_collector_unittest.cc index c630c3af6c..a42ed86018 100644 --- a/pc/stats_collector_unittest.cc +++ b/pc/stats_collector_unittest.cc @@ -674,7 +674,7 @@ class StatsCollectorTest : public ::testing::Test { // Fake stats to process. TransportChannelStats channel_stats; channel_stats.component = 1; - channel_stats.srtp_crypto_suite = rtc::SRTP_AES128_CM_SHA1_80; + channel_stats.srtp_crypto_suite = rtc::kSrtpAes128CmSha1_80; channel_stats.ssl_cipher_suite = internal::TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA; pc->SetTransportStats(kTransportName, channel_stats); @@ -729,7 +729,7 @@ class StatsCollectorTest : public ::testing::Test { std::string srtp_crypto_suite = ExtractStatsValue(StatsReport::kStatsReportTypeComponent, reports, StatsReport::kStatsValueNameSrtpCipher); - EXPECT_EQ(rtc::SrtpCryptoSuiteToName(rtc::SRTP_AES128_CM_SHA1_80), + EXPECT_EQ(rtc::SrtpCryptoSuiteToName(rtc::kSrtpAes128CmSha1_80), srtp_crypto_suite); } }; diff --git a/pc/test/integration_test_helpers.h b/pc/test/integration_test_helpers.h index 9ec9b0e982..af59a83a9b 100644 --- a/pc/test/integration_test_helpers.h +++ b/pc/test/integration_test_helpers.h @@ -150,8 +150,8 @@ static const char kDataChannelLabel[] = "data_channel"; // SRTP cipher name negotiated by the tests. This must be updated if the // default changes. -static const int kDefaultSrtpCryptoSuite = rtc::SRTP_AES128_CM_SHA1_80; -static const int kDefaultSrtpCryptoSuiteGcm = rtc::SRTP_AEAD_AES_256_GCM; +static const int kDefaultSrtpCryptoSuite = rtc::kSrtpAes128CmSha1_80; +static const int kDefaultSrtpCryptoSuiteGcm = rtc::kSrtpAeadAes256Gcm; static const SocketAddress kDefaultLocalAddress("192.168.1.1", 0); diff --git a/pc/test/srtp_test_util.h b/pc/test/srtp_test_util.h index ed12e541bf..ae02310eba 100644 --- a/pc/test/srtp_test_util.h +++ b/pc/test/srtp_test_util.h @@ -15,25 +15,25 @@ namespace rtc { -extern const char CS_AES_CM_128_HMAC_SHA1_32[]; -extern const char CS_AEAD_AES_128_GCM[]; -extern const char CS_AEAD_AES_256_GCM[]; +extern const char kCsAesCm128HmacSha1_32[]; +extern const char kCsAeadAes128Gcm[]; +extern const char kCsAeadAes256Gcm[]; static const uint8_t kTestKey1[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234"; static const uint8_t kTestKey2[] = "4321ZYXWVUTSRQPONMLKJIHGFEDCBA"; static const int kTestKeyLen = 30; static int rtp_auth_tag_len(const std::string& cs) { - if (cs == CS_AES_CM_128_HMAC_SHA1_32) { + if (cs == kCsAesCm128HmacSha1_32) { return 4; - } else if (cs == CS_AEAD_AES_128_GCM || cs == CS_AEAD_AES_256_GCM) { + } else if (cs == kCsAeadAes128Gcm || cs == kCsAeadAes256Gcm) { return 16; } else { return 10; } } static int rtcp_auth_tag_len(const std::string& cs) { - if (cs == CS_AEAD_AES_128_GCM || cs == CS_AEAD_AES_256_GCM) { + if (cs == kCsAeadAes128Gcm || cs == kCsAeadAes256Gcm) { return 16; } else { return 10; diff --git a/pc/transport_stats.h b/pc/transport_stats.h index 173af91fba..2f43d45808 100644 --- a/pc/transport_stats.h +++ b/pc/transport_stats.h @@ -29,8 +29,8 @@ struct TransportChannelStats { int component = 0; int ssl_version_bytes = 0; - int srtp_crypto_suite = rtc::SRTP_INVALID_CRYPTO_SUITE; - int ssl_cipher_suite = rtc::TLS_NULL_WITH_NULL_NULL; + int srtp_crypto_suite = rtc::kSrtpInvalidCryptoSuite; + int ssl_cipher_suite = rtc::kTlsNullWithNullNull; webrtc::DtlsTransportState dtls_state = webrtc::DtlsTransportState::kNew; IceTransportStats ice_transport_stats; }; diff --git a/rtc_base/openssl_stream_adapter.cc b/rtc_base/openssl_stream_adapter.cc index aa0bc3d40c..d250853815 100644 --- a/rtc_base/openssl_stream_adapter.cc +++ b/rtc_base/openssl_stream_adapter.cc @@ -73,10 +73,10 @@ struct SslCipherMapEntry { // This isn't elegant, but it's better than an external reference constexpr SrtpCipherMapEntry kSrtpCipherMap[] = { - {"SRTP_AES128_CM_SHA1_80", SRTP_AES128_CM_SHA1_80}, - {"SRTP_AES128_CM_SHA1_32", SRTP_AES128_CM_SHA1_32}, - {"SRTP_AEAD_AES_128_GCM", SRTP_AEAD_AES_128_GCM}, - {"SRTP_AEAD_AES_256_GCM", SRTP_AEAD_AES_256_GCM}}; + {"SRTP_AES128_CM_SHA1_80", kSrtpAes128CmSha1_80}, + {"SRTP_AES128_CM_SHA1_32", kSrtpAes128CmSha1_32}, + {"SRTP_AEAD_AES_128_GCM", kSrtpAeadAes128Gcm}, + {"SRTP_AEAD_AES_256_GCM", kSrtpAeadAes256Gcm}}; #ifndef OPENSSL_IS_BORINGSSL // The "SSL_CIPHER_standard_name" function is only available in OpenSSL when diff --git a/rtc_base/ssl_stream_adapter.cc b/rtc_base/ssl_stream_adapter.cc index 5730af63d8..718c62d20f 100644 --- a/rtc_base/ssl_stream_adapter.cc +++ b/rtc_base/ssl_stream_adapter.cc @@ -19,57 +19,66 @@ namespace rtc { // TODO(guoweis): Move this to SDP layer and use int form internally. // webrtc:5043. +const char kCsAesCm128HmacSha1_80[] = "AES_CM_128_HMAC_SHA1_80"; +const char kCsAesCm128HmacSha1_32[] = "AES_CM_128_HMAC_SHA1_32"; +const char kCsAeadAes128Gcm[] = "AEAD_AES_128_GCM"; +const char kCsAeadAes256Gcm[] = "AEAD_AES_256_GCM"; + +// TODO(bugs.webrtc.org/12997): Start. +// Remove the following constants which violate the style guide and can +// potentially clash with OpenSSL macros. const char CS_AES_CM_128_HMAC_SHA1_80[] = "AES_CM_128_HMAC_SHA1_80"; const char CS_AES_CM_128_HMAC_SHA1_32[] = "AES_CM_128_HMAC_SHA1_32"; const char CS_AEAD_AES_128_GCM[] = "AEAD_AES_128_GCM"; const char CS_AEAD_AES_256_GCM[] = "AEAD_AES_256_GCM"; +// TODO(bugs.webrtc.org/12997): End. std::string SrtpCryptoSuiteToName(int crypto_suite) { switch (crypto_suite) { - case SRTP_AES128_CM_SHA1_32: - return CS_AES_CM_128_HMAC_SHA1_32; - case SRTP_AES128_CM_SHA1_80: - return CS_AES_CM_128_HMAC_SHA1_80; - case SRTP_AEAD_AES_128_GCM: - return CS_AEAD_AES_128_GCM; - case SRTP_AEAD_AES_256_GCM: - return CS_AEAD_AES_256_GCM; + case kSrtpAes128CmSha1_32: + return kCsAesCm128HmacSha1_32; + case kSrtpAes128CmSha1_80: + return kCsAesCm128HmacSha1_80; + case kSrtpAeadAes128Gcm: + return kCsAeadAes128Gcm; + case kSrtpAeadAes256Gcm: + return kCsAeadAes256Gcm; default: return std::string(); } } int SrtpCryptoSuiteFromName(const std::string& crypto_suite) { - if (crypto_suite == CS_AES_CM_128_HMAC_SHA1_32) - return SRTP_AES128_CM_SHA1_32; - if (crypto_suite == CS_AES_CM_128_HMAC_SHA1_80) - return SRTP_AES128_CM_SHA1_80; - if (crypto_suite == CS_AEAD_AES_128_GCM) - return SRTP_AEAD_AES_128_GCM; - if (crypto_suite == CS_AEAD_AES_256_GCM) - return SRTP_AEAD_AES_256_GCM; - return SRTP_INVALID_CRYPTO_SUITE; + if (crypto_suite == kCsAesCm128HmacSha1_32) + return kSrtpAes128CmSha1_32; + if (crypto_suite == kCsAesCm128HmacSha1_80) + return kSrtpAes128CmSha1_80; + if (crypto_suite == kCsAeadAes128Gcm) + return kSrtpAeadAes128Gcm; + if (crypto_suite == kCsAeadAes256Gcm) + return kSrtpAeadAes256Gcm; + return kSrtpInvalidCryptoSuite; } bool GetSrtpKeyAndSaltLengths(int crypto_suite, int* key_length, int* salt_length) { switch (crypto_suite) { - case SRTP_AES128_CM_SHA1_32: - case SRTP_AES128_CM_SHA1_80: + case kSrtpAes128CmSha1_32: + case kSrtpAes128CmSha1_80: // SRTP_AES128_CM_HMAC_SHA1_32 and SRTP_AES128_CM_HMAC_SHA1_80 are defined // in RFC 5764 to use a 128 bits key and 112 bits salt for the cipher. *key_length = 16; *salt_length = 14; break; - case SRTP_AEAD_AES_128_GCM: - // SRTP_AEAD_AES_128_GCM is defined in RFC 7714 to use a 128 bits key and + case kSrtpAeadAes128Gcm: + // kSrtpAeadAes128Gcm is defined in RFC 7714 to use a 128 bits key and // a 96 bits salt for the cipher. *key_length = 16; *salt_length = 12; break; - case SRTP_AEAD_AES_256_GCM: - // SRTP_AEAD_AES_256_GCM is defined in RFC 7714 to use a 256 bits key and + case kSrtpAeadAes256Gcm: + // kSrtpAeadAes256Gcm is defined in RFC 7714 to use a 256 bits key and // a 96 bits salt for the cipher. *key_length = 32; *salt_length = 12; @@ -81,13 +90,12 @@ bool GetSrtpKeyAndSaltLengths(int crypto_suite, } bool IsGcmCryptoSuite(int crypto_suite) { - return (crypto_suite == SRTP_AEAD_AES_256_GCM || - crypto_suite == SRTP_AEAD_AES_128_GCM); + return (crypto_suite == kSrtpAeadAes256Gcm || + crypto_suite == kSrtpAeadAes128Gcm); } bool IsGcmCryptoSuiteName(const std::string& crypto_suite) { - return (crypto_suite == CS_AEAD_AES_256_GCM || - crypto_suite == CS_AEAD_AES_128_GCM); + return (crypto_suite == kCsAeadAes256Gcm || crypto_suite == kCsAeadAes128Gcm); } std::unique_ptr SSLStreamAdapter::Create( diff --git a/rtc_base/ssl_stream_adapter.h b/rtc_base/ssl_stream_adapter.h index 6b44c76455..6a21c6bed4 100644 --- a/rtc_base/ssl_stream_adapter.h +++ b/rtc_base/ssl_stream_adapter.h @@ -26,11 +26,12 @@ namespace rtc { // Constants for SSL profile. -const int TLS_NULL_WITH_NULL_NULL = 0; -const int SSL_CIPHER_SUITE_MAX_VALUE = 0xFFFF; +constexpr int kTlsNullWithNullNull = 0; +constexpr int kSslCipherSuiteMaxValue = 0xFFFF; -// Constants for SRTP profiles. -const int SRTP_INVALID_CRYPTO_SUITE = 0; +// TODO(bugs.webrtc.org/12997): Start. +// Remove the following constants which violate the style guide and can +// potentially clash with OpenSSL macros. #ifndef SRTP_AES128_CM_SHA1_80 const int SRTP_AES128_CM_SHA1_80 = 0x0001; #endif @@ -43,8 +44,6 @@ const int SRTP_AEAD_AES_128_GCM = 0x0007; #ifndef SRTP_AEAD_AES_256_GCM const int SRTP_AEAD_AES_256_GCM = 0x0008; #endif -const int SRTP_CRYPTO_SUITE_MAX_VALUE = 0xFFFF; - // Names of SRTP profiles listed above. // 128-bit AES with 80-bit SHA-1 HMAC. extern const char CS_AES_CM_128_HMAC_SHA1_80[]; @@ -54,6 +53,25 @@ extern const char CS_AES_CM_128_HMAC_SHA1_32[]; extern const char CS_AEAD_AES_128_GCM[]; // 256-bit AES GCM with 16 byte AEAD auth tag. extern const char CS_AEAD_AES_256_GCM[]; +// TODO(bugs.webrtc.org/12997): End. + +// Constants for SRTP profiles. +constexpr int kSrtpInvalidCryptoSuite = 0; +constexpr int kSrtpAes128CmSha1_80 = 0x0001; +constexpr int kSrtpAes128CmSha1_32 = 0x0002; +constexpr int kSrtpAeadAes128Gcm = 0x0007; +constexpr int kSrtpAeadAes256Gcm = 0x0008; +constexpr int kSrtpCryptoSuiteMaxValue = 0xFFFF; + +// Names of SRTP profiles listed above. +// 128-bit AES with 80-bit SHA-1 HMAC. +extern const char kCsAesCm128HmacSha1_80[]; +// 128-bit AES with 32-bit SHA-1 HMAC. +extern const char kCsAesCm128HmacSha1_32[]; +// 128-bit AES GCM with 16 byte AEAD auth tag. +extern const char kCsAeadAes128Gcm[]; +// 256-bit AES GCM with 16 byte AEAD auth tag. +extern const char kCsAeadAes256Gcm[]; // Given the DTLS-SRTP protection profile ID, as defined in // https://tools.ietf.org/html/rfc4568#section-6.2 , return the SRTP profile diff --git a/rtc_base/ssl_stream_adapter_unittest.cc b/rtc_base/ssl_stream_adapter_unittest.cc index c580d835c5..1c6eee2802 100644 --- a/rtc_base/ssl_stream_adapter_unittest.cc +++ b/rtc_base/ssl_stream_adapter_unittest.cc @@ -1245,7 +1245,7 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSDelayedIdentityWithBogusDigest) { // Test DTLS-SRTP with all high ciphers TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpHigh) { std::vector high; - high.push_back(rtc::SRTP_AES128_CM_SHA1_80); + high.push_back(rtc::kSrtpAes128CmSha1_80); SetDtlsSrtpCryptoSuites(high, true); SetDtlsSrtpCryptoSuites(high, false); TestHandshake(); @@ -1256,13 +1256,13 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpHigh) { ASSERT_TRUE(GetDtlsSrtpCryptoSuite(false, &server_cipher)); ASSERT_EQ(client_cipher, server_cipher); - ASSERT_EQ(client_cipher, rtc::SRTP_AES128_CM_SHA1_80); + ASSERT_EQ(client_cipher, rtc::kSrtpAes128CmSha1_80); } // Test DTLS-SRTP with all low ciphers TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpLow) { std::vector low; - low.push_back(rtc::SRTP_AES128_CM_SHA1_32); + low.push_back(rtc::kSrtpAes128CmSha1_32); SetDtlsSrtpCryptoSuites(low, true); SetDtlsSrtpCryptoSuites(low, false); TestHandshake(); @@ -1273,15 +1273,15 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpLow) { ASSERT_TRUE(GetDtlsSrtpCryptoSuite(false, &server_cipher)); ASSERT_EQ(client_cipher, server_cipher); - ASSERT_EQ(client_cipher, rtc::SRTP_AES128_CM_SHA1_32); + ASSERT_EQ(client_cipher, rtc::kSrtpAes128CmSha1_32); } // Test DTLS-SRTP with a mismatch -- should not converge TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpHighLow) { std::vector high; - high.push_back(rtc::SRTP_AES128_CM_SHA1_80); + high.push_back(rtc::kSrtpAes128CmSha1_80); std::vector low; - low.push_back(rtc::SRTP_AES128_CM_SHA1_32); + low.push_back(rtc::kSrtpAes128CmSha1_32); SetDtlsSrtpCryptoSuites(high, true); SetDtlsSrtpCryptoSuites(low, false); TestHandshake(); @@ -1295,8 +1295,8 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpHighLow) { // Test DTLS-SRTP with each side being mixed -- should select high TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpMixed) { std::vector mixed; - mixed.push_back(rtc::SRTP_AES128_CM_SHA1_80); - mixed.push_back(rtc::SRTP_AES128_CM_SHA1_32); + mixed.push_back(rtc::kSrtpAes128CmSha1_80); + mixed.push_back(rtc::kSrtpAes128CmSha1_32); SetDtlsSrtpCryptoSuites(mixed, true); SetDtlsSrtpCryptoSuites(mixed, false); TestHandshake(); @@ -1307,13 +1307,13 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpMixed) { ASSERT_TRUE(GetDtlsSrtpCryptoSuite(false, &server_cipher)); ASSERT_EQ(client_cipher, server_cipher); - ASSERT_EQ(client_cipher, rtc::SRTP_AES128_CM_SHA1_80); + ASSERT_EQ(client_cipher, rtc::kSrtpAes128CmSha1_80); } // Test DTLS-SRTP with all GCM-128 ciphers. TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCM128) { std::vector gcm128; - gcm128.push_back(rtc::SRTP_AEAD_AES_128_GCM); + gcm128.push_back(rtc::kSrtpAeadAes128Gcm); SetDtlsSrtpCryptoSuites(gcm128, true); SetDtlsSrtpCryptoSuites(gcm128, false); TestHandshake(); @@ -1324,13 +1324,13 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCM128) { ASSERT_TRUE(GetDtlsSrtpCryptoSuite(false, &server_cipher)); ASSERT_EQ(client_cipher, server_cipher); - ASSERT_EQ(client_cipher, rtc::SRTP_AEAD_AES_128_GCM); + ASSERT_EQ(client_cipher, rtc::kSrtpAeadAes128Gcm); } // Test DTLS-SRTP with all GCM-256 ciphers. TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCM256) { std::vector gcm256; - gcm256.push_back(rtc::SRTP_AEAD_AES_256_GCM); + gcm256.push_back(rtc::kSrtpAeadAes256Gcm); SetDtlsSrtpCryptoSuites(gcm256, true); SetDtlsSrtpCryptoSuites(gcm256, false); TestHandshake(); @@ -1341,15 +1341,15 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCM256) { ASSERT_TRUE(GetDtlsSrtpCryptoSuite(false, &server_cipher)); ASSERT_EQ(client_cipher, server_cipher); - ASSERT_EQ(client_cipher, rtc::SRTP_AEAD_AES_256_GCM); + ASSERT_EQ(client_cipher, rtc::kSrtpAeadAes256Gcm); } // Test DTLS-SRTP with mixed GCM-128/-256 ciphers -- should not converge. TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCMMismatch) { std::vector gcm128; - gcm128.push_back(rtc::SRTP_AEAD_AES_128_GCM); + gcm128.push_back(rtc::kSrtpAeadAes128Gcm); std::vector gcm256; - gcm256.push_back(rtc::SRTP_AEAD_AES_256_GCM); + gcm256.push_back(rtc::kSrtpAeadAes256Gcm); SetDtlsSrtpCryptoSuites(gcm128, true); SetDtlsSrtpCryptoSuites(gcm256, false); TestHandshake(); @@ -1363,8 +1363,8 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCMMismatch) { // Test DTLS-SRTP with both GCM-128/-256 ciphers -- should select GCM-256. TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCMMixed) { std::vector gcmBoth; - gcmBoth.push_back(rtc::SRTP_AEAD_AES_256_GCM); - gcmBoth.push_back(rtc::SRTP_AEAD_AES_128_GCM); + gcmBoth.push_back(rtc::kSrtpAeadAes256Gcm); + gcmBoth.push_back(rtc::kSrtpAeadAes128Gcm); SetDtlsSrtpCryptoSuites(gcmBoth, true); SetDtlsSrtpCryptoSuites(gcmBoth, false); TestHandshake(); @@ -1375,7 +1375,7 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpGCMMixed) { ASSERT_TRUE(GetDtlsSrtpCryptoSuite(false, &server_cipher)); ASSERT_EQ(client_cipher, server_cipher); - ASSERT_EQ(client_cipher, rtc::SRTP_AEAD_AES_256_GCM); + ASSERT_EQ(client_cipher, rtc::kSrtpAeadAes256Gcm); } // Test SRTP cipher suite lengths. @@ -1383,26 +1383,26 @@ TEST_P(SSLStreamAdapterTestDTLS, TestDTLSSrtpKeyAndSaltLengths) { int key_len; int salt_len; - ASSERT_FALSE(rtc::GetSrtpKeyAndSaltLengths(rtc::SRTP_INVALID_CRYPTO_SUITE, + ASSERT_FALSE(rtc::GetSrtpKeyAndSaltLengths(rtc::kSrtpInvalidCryptoSuite, &key_len, &salt_len)); - ASSERT_TRUE(rtc::GetSrtpKeyAndSaltLengths(rtc::SRTP_AES128_CM_SHA1_32, - &key_len, &salt_len)); + ASSERT_TRUE(rtc::GetSrtpKeyAndSaltLengths(rtc::kSrtpAes128CmSha1_32, &key_len, + &salt_len)); ASSERT_EQ(128 / 8, key_len); ASSERT_EQ(112 / 8, salt_len); - ASSERT_TRUE(rtc::GetSrtpKeyAndSaltLengths(rtc::SRTP_AES128_CM_SHA1_80, - &key_len, &salt_len)); + ASSERT_TRUE(rtc::GetSrtpKeyAndSaltLengths(rtc::kSrtpAes128CmSha1_80, &key_len, + &salt_len)); ASSERT_EQ(128 / 8, key_len); ASSERT_EQ(112 / 8, salt_len); - ASSERT_TRUE(rtc::GetSrtpKeyAndSaltLengths(rtc::SRTP_AEAD_AES_128_GCM, - &key_len, &salt_len)); + ASSERT_TRUE(rtc::GetSrtpKeyAndSaltLengths(rtc::kSrtpAeadAes128Gcm, &key_len, + &salt_len)); ASSERT_EQ(128 / 8, key_len); ASSERT_EQ(96 / 8, salt_len); - ASSERT_TRUE(rtc::GetSrtpKeyAndSaltLengths(rtc::SRTP_AEAD_AES_256_GCM, - &key_len, &salt_len)); + ASSERT_TRUE(rtc::GetSrtpKeyAndSaltLengths(rtc::kSrtpAeadAes256Gcm, &key_len, + &salt_len)); ASSERT_EQ(256 / 8, key_len); ASSERT_EQ(96 / 8, salt_len); } diff --git a/sdk/android/api/org/webrtc/CryptoOptions.java b/sdk/android/api/org/webrtc/CryptoOptions.java index 77b9552aad..6e06bc6426 100644 --- a/sdk/android/api/org/webrtc/CryptoOptions.java +++ b/sdk/android/api/org/webrtc/CryptoOptions.java @@ -29,7 +29,7 @@ public final class Srtp { private final boolean enableGcmCryptoSuites; /** * If set to true, the (potentially insecure) crypto cipher - * SRTP_AES128_CM_SHA1_32 will be included in the list of supported ciphers + * kSrtpAes128CmSha1_32 will be included in the list of supported ciphers * during negotiation. It will only be used if both peers support it and no * other ciphers get preferred. */ diff --git a/sdk/objc/api/peerconnection/RTCCryptoOptions.h b/sdk/objc/api/peerconnection/RTCCryptoOptions.h index 759a45e037..7894c8d50c 100644 --- a/sdk/objc/api/peerconnection/RTCCryptoOptions.h +++ b/sdk/objc/api/peerconnection/RTCCryptoOptions.h @@ -28,7 +28,7 @@ RTC_OBJC_EXPORT @property(nonatomic, assign) BOOL srtpEnableGcmCryptoSuites; /** * If set to true, the (potentially insecure) crypto cipher - * SRTP_AES128_CM_SHA1_32 will be included in the list of supported ciphers + * kSrtpAes128CmSha1_32 will be included in the list of supported ciphers * during negotiation. It will only be used if both peers support it and no * other ciphers get preferred. */ From 0e61fdd27c3371b75dba81252511ce0becfa78a0 Mon Sep 17 00:00:00 2001 From: Artem Titov Date: Sun, 25 Jul 2021 21:50:14 +0200 Subject: [PATCH 0091/1565] Use backticks not vertical bars to denote variables in comments for /api Bug: webrtc:12338 Change-Id: Ib97b2c3d64dbd895f261ffa76a2e885bd934a87f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226940 Reviewed-by: Harald Alvestrand Commit-Queue: Artem Titov Cr-Commit-Position: refs/heads/master@{#34554} --- api/adaptation/resource.h | 2 +- api/async_dns_resolver.h | 10 +-- api/audio/audio_frame.cc | 2 +- api/audio/audio_frame.h | 6 +- api/audio/audio_frame_processor.h | 6 +- api/audio/audio_mixer.h | 6 +- api/audio_codecs/audio_decoder.h | 30 +++---- .../audio_decoder_factory_template.h | 4 +- api/audio_codecs/audio_encoder.h | 10 +-- .../audio_encoder_factory_template.h | 4 +- api/audio_codecs/audio_format.h | 2 +- .../opus/audio_encoder_opus_config.h | 8 +- api/call/bitrate_allocation.h | 2 +- api/candidate.cc | 2 +- api/candidate.h | 8 +- api/data_channel_interface.h | 12 +-- api/dtmf_sender_interface.h | 20 ++--- api/fec_controller.h | 2 +- api/frame_transformer_interface.h | 4 +- api/jsep.h | 14 +-- api/jsep_ice_candidate.h | 2 +- api/jsep_session_description.h | 2 +- api/media_stream_interface.h | 6 +- api/neteq/neteq.h | 26 +++--- api/neteq/neteq_controller.h | 18 ++-- api/neteq/neteq_controller_factory.h | 2 +- api/neteq/neteq_factory.h | 2 +- api/numerics/samples_stats_counter.h | 6 +- api/peer_connection_interface.h | 86 +++++++++---------- api/rtc_error.h | 2 +- api/rtc_event_log/rtc_event_log.h | 2 +- api/rtc_event_log_output.h | 2 +- api/rtp_packet_info.h | 8 +- api/rtp_parameters.h | 8 +- api/rtp_receiver_interface.h | 6 +- api/scoped_refptr.h | 10 +-- api/stats/rtc_stats.h | 42 ++++----- api/stats/rtc_stats_report.h | 14 +-- api/stats/rtcstats_objects.h | 20 ++--- api/stats_types.cc | 2 +- api/stats_types.h | 40 ++++----- api/task_queue/queued_task.h | 6 +- api/task_queue/task_queue_test.cc | 4 +- api/test/audio_quality_analyzer_interface.h | 4 +- api/test/audioproc_float.h | 14 +-- api/test/create_frame_generator.h | 6 +- ...connection_quality_test_frame_generator.cc | 2 +- ..._connection_quality_test_frame_generator.h | 2 +- ...eate_peerconnection_quality_test_fixture.h | 6 +- api/test/create_time_controller.h | 2 +- api/test/network_emulation/cross_traffic.h | 4 +- .../network_emulation_interfaces.h | 12 +-- api/test/network_emulation_manager.h | 32 +++---- .../peerconnection_quality_test_fixture.h | 66 +++++++------- api/test/stats_observer_interface.h | 2 +- api/test/time_controller.h | 14 +-- api/test/track_id_stream_info_map.h | 6 +- api/test/video_quality_analyzer_interface.h | 24 +++--- api/test/video_quality_test_fixture.h | 2 +- api/transport/bitrate_settings.h | 2 +- .../data_channel_transport_interface.h | 12 +-- .../sctp_transport_factory_interface.h | 2 +- api/transport/stun.h | 14 +-- api/turn_customizer.h | 2 +- api/video/color_space.cc | 4 +- api/video/encoded_frame.h | 2 +- api/video/encoded_image.h | 4 +- api/video/i010_buffer.h | 8 +- api/video/i420_buffer.h | 8 +- api/video/nv12_buffer.h | 4 +- api/video/video_bitrate_allocation.h | 4 +- api/video/video_frame.h | 2 +- api/video/video_frame_buffer.h | 4 +- api/video/video_source_interface.h | 6 +- api/video/video_stream_decoder_create.h | 2 +- api/video/video_stream_encoder_interface.h | 20 ++--- api/video/video_stream_encoder_observer.h | 2 +- api/video/video_timing.h | 2 +- ...oder_software_fallback_wrapper_unittest.cc | 2 +- ...oder_software_fallback_wrapper_unittest.cc | 2 +- api/video_codecs/video_decoder_factory.h | 2 +- api/video_codecs/video_encoder.h | 26 +++--- api/video_codecs/video_encoder_config.h | 6 +- api/video_codecs/video_encoder_factory.h | 4 +- ...video_encoder_software_fallback_wrapper.cc | 8 +- .../video_encoder_software_fallback_wrapper.h | 2 +- .../vp8_frame_buffer_controller.h | 22 ++--- api/video_track_source_proxy_factory.h | 4 +- api/voip/voip_base.h | 26 +++--- api/voip/voip_codec.h | 4 +- api/voip/voip_dtmf.h | 6 +- api/voip/voip_network.h | 4 +- api/voip/voip_statistics.h | 8 +- api/voip/voip_volume_control.h | 12 +-- 94 files changed, 455 insertions(+), 455 deletions(-) diff --git a/api/adaptation/resource.h b/api/adaptation/resource.h index 9b3968055f..7d7c70b3eb 100644 --- a/api/adaptation/resource.h +++ b/api/adaptation/resource.h @@ -57,7 +57,7 @@ class RTC_EXPORT Resource : public rtc::RefCountInterface { ~Resource() override; virtual std::string Name() const = 0; - // The |listener| may be informed of resource usage measurements on any task + // The `listener` may be informed of resource usage measurements on any task // queue, but not after this method is invoked with the null argument. virtual void SetResourceListener(ResourceListener* listener) = 0; }; diff --git a/api/async_dns_resolver.h b/api/async_dns_resolver.h index eabb41c11f..cbe921b012 100644 --- a/api/async_dns_resolver.h +++ b/api/async_dns_resolver.h @@ -41,10 +41,10 @@ namespace webrtc { class AsyncDnsResolverResult { public: virtual ~AsyncDnsResolverResult() = default; - // Returns true iff the address from |Start| was successfully resolved. - // If the address was successfully resolved, sets |addr| to a copy of the - // address from |Start| with the IP address set to the top most resolved - // address of |family| (|addr| will have both hostname and the resolved ip). + // Returns true iff the address from `Start` was successfully resolved. + // If the address was successfully resolved, sets `addr` to a copy of the + // address from `Start` with the IP address set to the top most resolved + // address of `family` (`addr` will have both hostname and the resolved ip). virtual bool GetResolvedAddress(int family, rtc::SocketAddress* addr) const = 0; // Returns error from resolver. @@ -55,7 +55,7 @@ class RTC_EXPORT AsyncDnsResolverInterface { public: virtual ~AsyncDnsResolverInterface() = default; - // Start address resolution of the hostname in |addr|. + // Start address resolution of the hostname in `addr`. virtual void Start(const rtc::SocketAddress& addr, std::function callback) = 0; virtual const AsyncDnsResolverResult& result() const = 0; diff --git a/api/audio/audio_frame.cc b/api/audio/audio_frame.cc index c6e5cf4dd6..0c39d51f11 100644 --- a/api/audio/audio_frame.cc +++ b/api/audio/audio_frame.cc @@ -52,7 +52,7 @@ void AudioFrame::Reset() { } void AudioFrame::ResetWithoutMuting() { - // TODO(wu): Zero is a valid value for |timestamp_|. We should initialize + // TODO(wu): Zero is a valid value for `timestamp_`. We should initialize // to an invalid value, or add a new member to indicate invalidity. timestamp_ = 0; elapsed_time_ms_ = -1; diff --git a/api/audio/audio_frame.h b/api/audio/audio_frame.h index 78539f57eb..726b9a98e3 100644 --- a/api/audio/audio_frame.h +++ b/api/audio/audio_frame.h @@ -139,7 +139,7 @@ class AudioFrame { int64_t profile_timestamp_ms_ = 0; // Information about packets used to assemble this audio frame. This is needed - // by |SourceTracker| when the frame is delivered to the RTCRtpReceiver's + // by `SourceTracker` when the frame is delivered to the RTCRtpReceiver's // MediaStreamTrack, in order to implement getContributingSources(). See: // https://w3c.github.io/webrtc-pc/#dom-rtcrtpreceiver-getcontributingsources // @@ -149,7 +149,7 @@ class AudioFrame { // sync buffer is the small sample-holding buffer located after the audio // decoder and before where samples are assembled into output frames. // - // |RtpPacketInfos| may also be empty if the audio samples did not come from + // `RtpPacketInfos` may also be empty if the audio samples did not come from // RTP packets. E.g. if the audio were locally generated by packet loss // concealment, comfort noise generation, etc. RtpPacketInfos packet_infos_; @@ -165,7 +165,7 @@ class AudioFrame { // Absolute capture timestamp when this audio frame was originally captured. // This is only valid for audio frames captured on this machine. The absolute - // capture timestamp of a received frame is found in |packet_infos_|. + // capture timestamp of a received frame is found in `packet_infos_`. // This timestamp MUST be based on the same clock as rtc::TimeMillis(). absl::optional absolute_capture_timestamp_ms_; diff --git a/api/audio/audio_frame_processor.h b/api/audio/audio_frame_processor.h index bc21d14858..cb65c4817e 100644 --- a/api/audio/audio_frame_processor.h +++ b/api/audio/audio_frame_processor.h @@ -28,12 +28,12 @@ class AudioFrameProcessor { // Processes the frame received from WebRTC, is called by WebRTC off the // realtime audio capturing path. AudioFrameProcessor must reply with - // processed frames by calling |sink_callback| if it was provided in SetSink() - // call. |sink_callback| can be called in the context of Process(). + // processed frames by calling `sink_callback` if it was provided in SetSink() + // call. `sink_callback` can be called in the context of Process(). virtual void Process(std::unique_ptr frame) = 0; // Atomically replaces the current sink with the new one. Before the - // first call to this function, or if the provided |sink_callback| is nullptr, + // first call to this function, or if the provided `sink_callback` is nullptr, // processed frames are simply discarded. virtual void SetSink(OnAudioFrameCallback sink_callback) = 0; }; diff --git a/api/audio/audio_mixer.h b/api/audio/audio_mixer.h index b290cfacf0..3483df22bc 100644 --- a/api/audio/audio_mixer.h +++ b/api/audio/audio_mixer.h @@ -35,9 +35,9 @@ class AudioMixer : public rtc::RefCountInterface { kError, // The audio_frame will not be used. }; - // Overwrites |audio_frame|. The data_ field is overwritten with + // Overwrites `audio_frame`. The data_ field is overwritten with // 10 ms of new audio (either 1 or 2 interleaved channels) at - // |sample_rate_hz|. All fields in |audio_frame| must be updated. + // `sample_rate_hz`. All fields in `audio_frame` must be updated. virtual AudioFrameInfo GetAudioFrameWithInfo(int sample_rate_hz, AudioFrame* audio_frame) = 0; @@ -66,7 +66,7 @@ class AudioMixer : public rtc::RefCountInterface { // should mix at a rate that doesn't cause quality loss of the // sources' audio. The mixing rate is one of the rates listed in // AudioProcessing::NativeRate. All fields in - // |audio_frame_for_mixing| must be updated. + // `audio_frame_for_mixing` must be updated. virtual void Mix(size_t number_of_channels, AudioFrame* audio_frame_for_mixing) = 0; diff --git a/api/audio_codecs/audio_decoder.h b/api/audio_codecs/audio_decoder.h index ce235946da..51d20c4982 100644 --- a/api/audio_codecs/audio_decoder.h +++ b/api/audio_codecs/audio_decoder.h @@ -53,8 +53,8 @@ class AudioDecoder { // Returns true if this packet contains DTX. virtual bool IsDtxPacket() const; - // Decodes this frame of audio and writes the result in |decoded|. - // |decoded| must be large enough to store as many samples as indicated by a + // Decodes this frame of audio and writes the result in `decoded`. + // `decoded` must be large enough to store as many samples as indicated by a // call to Duration() . On success, returns an absl::optional containing the // total number of samples across all channels, as well as whether the // decoder produced comfort noise or speech. On failure, returns an empty @@ -85,8 +85,8 @@ class AudioDecoder { // Let the decoder parse this payload and prepare zero or more decodable // frames. Each frame must be between 10 ms and 120 ms long. The caller must // ensure that the AudioDecoder object outlives any frame objects returned by - // this call. The decoder is free to swap or move the data from the |payload| - // buffer. |timestamp| is the input timestamp, in samples, corresponding to + // this call. The decoder is free to swap or move the data from the `payload` + // buffer. `timestamp` is the input timestamp, in samples, corresponding to // the start of the payload. virtual std::vector ParsePayload(rtc::Buffer&& payload, uint32_t timestamp); @@ -95,12 +95,12 @@ class AudioDecoder { // obsolete; callers should call ParsePayload instead. For now, subclasses // must still implement DecodeInternal. - // Decodes |encode_len| bytes from |encoded| and writes the result in - // |decoded|. The maximum bytes allowed to be written into |decoded| is - // |max_decoded_bytes|. Returns the total number of samples across all - // channels. If the decoder produced comfort noise, |speech_type| + // Decodes `encode_len` bytes from `encoded` and writes the result in + // `decoded`. The maximum bytes allowed to be written into `decoded` is + // `max_decoded_bytes`. Returns the total number of samples across all + // channels. If the decoder produced comfort noise, `speech_type` // is set to kComfortNoise, otherwise it is kSpeech. The desired output - // sample rate is provided in |sample_rate_hz|, which must be valid for the + // sample rate is provided in `sample_rate_hz`, which must be valid for the // codec at hand. int Decode(const uint8_t* encoded, size_t encoded_len, @@ -123,11 +123,11 @@ class AudioDecoder { // Calls the packet-loss concealment of the decoder to update the state after // one or several lost packets. The caller has to make sure that the - // memory allocated in |decoded| should accommodate |num_frames| frames. + // memory allocated in `decoded` should accommodate `num_frames` frames. virtual size_t DecodePlc(size_t num_frames, int16_t* decoded); // Asks the decoder to generate packet-loss concealment and append it to the - // end of |concealment_audio|. The concealment audio should be in + // end of `concealment_audio`. The concealment audio should be in // channel-interleaved format, with as many channels as the last decoded // packet produced. The implementation must produce at least // requested_samples_per_channel, or nothing at all. This is a signal to the @@ -146,19 +146,19 @@ class AudioDecoder { // Returns the last error code from the decoder. virtual int ErrorCode(); - // Returns the duration in samples-per-channel of the payload in |encoded| - // which is |encoded_len| bytes long. Returns kNotImplemented if no duration + // Returns the duration in samples-per-channel of the payload in `encoded` + // which is `encoded_len` bytes long. Returns kNotImplemented if no duration // estimate is available, or -1 in case of an error. virtual int PacketDuration(const uint8_t* encoded, size_t encoded_len) const; // Returns the duration in samples-per-channel of the redandant payload in - // |encoded| which is |encoded_len| bytes long. Returns kNotImplemented if no + // `encoded` which is `encoded_len` bytes long. Returns kNotImplemented if no // duration estimate is available, or -1 in case of an error. virtual int PacketDurationRedundant(const uint8_t* encoded, size_t encoded_len) const; // Detects whether a packet has forward error correction. The packet is - // comprised of the samples in |encoded| which is |encoded_len| bytes long. + // comprised of the samples in `encoded` which is `encoded_len` bytes long. // Returns true if the packet has FEC and false otherwise. virtual bool PacketHasFec(const uint8_t* encoded, size_t encoded_len) const; diff --git a/api/audio_codecs/audio_decoder_factory_template.h b/api/audio_codecs/audio_decoder_factory_template.h index 388668d4c6..976f9c62d7 100644 --- a/api/audio_codecs/audio_decoder_factory_template.h +++ b/api/audio_codecs/audio_decoder_factory_template.h @@ -89,8 +89,8 @@ class AudioDecoderFactoryT : public AudioDecoderFactory { // Each decoder type is given as a template argument to the function; it should // be a struct with the following static member functions: // -// // Converts |audio_format| to a ConfigType instance. Returns an empty -// // optional if |audio_format| doesn't correctly specify a decoder of our +// // Converts `audio_format` to a ConfigType instance. Returns an empty +// // optional if `audio_format` doesn't correctly specify a decoder of our // // type. // absl::optional SdpToConfig(const SdpAudioFormat& audio_format); // diff --git a/api/audio_codecs/audio_encoder.h b/api/audio_codecs/audio_encoder.h index 92e42cf107..047d23c3ae 100644 --- a/api/audio_codecs/audio_encoder.h +++ b/api/audio_codecs/audio_encoder.h @@ -95,13 +95,13 @@ class AudioEncoder { // This is the main struct for auxiliary encoding information. Each encoded // packet should be accompanied by one EncodedInfo struct, containing the - // total number of |encoded_bytes|, the |encoded_timestamp| and the - // |payload_type|. If the packet contains redundant encodings, the |redundant| + // total number of `encoded_bytes`, the `encoded_timestamp` and the + // `payload_type`. If the packet contains redundant encodings, the `redundant` // vector will be populated with EncodedInfoLeaf structs. Each struct in the // vector represents one encoding; the order of structs in the vector is the // same as the order in which the actual payloads are written to the byte // stream. When EncoderInfoLeaf structs are present in the vector, the main - // struct's |encoded_bytes| will be the sum of all the |encoded_bytes| in the + // struct's `encoded_bytes` will be the sum of all the `encoded_bytes` in the // vector. struct EncodedInfo : public EncodedInfoLeaf { EncodedInfo(); @@ -143,7 +143,7 @@ class AudioEncoder { // Accepts one 10 ms block of input audio (i.e., SampleRateHz() / 100 * // NumChannels() samples). Multi-channel audio must be sample-interleaved. - // The encoder appends zero or more bytes of output to |encoded| and returns + // The encoder appends zero or more bytes of output to `encoded` and returns // additional encoding information. Encode() checks some preconditions, calls // EncodeImpl() which does the actual work, and then checks some // postconditions. @@ -205,7 +205,7 @@ class AudioEncoder { virtual void DisableAudioNetworkAdaptor(); // Provides uplink packet loss fraction to this encoder to allow it to adapt. - // |uplink_packet_loss_fraction| is in the range [0.0, 1.0]. + // `uplink_packet_loss_fraction` is in the range [0.0, 1.0]. virtual void OnReceivedUplinkPacketLossFraction( float uplink_packet_loss_fraction); diff --git a/api/audio_codecs/audio_encoder_factory_template.h b/api/audio_codecs/audio_encoder_factory_template.h index cdc7defd25..4dc0672c46 100644 --- a/api/audio_codecs/audio_encoder_factory_template.h +++ b/api/audio_codecs/audio_encoder_factory_template.h @@ -103,8 +103,8 @@ class AudioEncoderFactoryT : public AudioEncoderFactory { // Each encoder type is given as a template argument to the function; it should // be a struct with the following static member functions: // -// // Converts |audio_format| to a ConfigType instance. Returns an empty -// // optional if |audio_format| doesn't correctly specify an encoder of our +// // Converts `audio_format` to a ConfigType instance. Returns an empty +// // optional if `audio_format` doesn't correctly specify an encoder of our // // type. // absl::optional SdpToConfig(const SdpAudioFormat& audio_format); // diff --git a/api/audio_codecs/audio_format.h b/api/audio_codecs/audio_format.h index 9f61729fdb..0cf67799b8 100644 --- a/api/audio_codecs/audio_format.h +++ b/api/audio_codecs/audio_format.h @@ -39,7 +39,7 @@ struct RTC_EXPORT SdpAudioFormat { Parameters&& param); ~SdpAudioFormat(); - // Returns true if this format is compatible with |o|. In SDP terminology: + // Returns true if this format is compatible with `o`. In SDP terminology: // would it represent the same codec between an offer and an answer? As // opposed to operator==, this method disregards codec parameters. bool Matches(const SdpAudioFormat& o) const; diff --git a/api/audio_codecs/opus/audio_encoder_opus_config.h b/api/audio_codecs/opus/audio_encoder_opus_config.h index 3c412b7a30..d5d7256c70 100644 --- a/api/audio_codecs/opus/audio_encoder_opus_config.h +++ b/api/audio_codecs/opus/audio_encoder_opus_config.h @@ -49,10 +49,10 @@ struct RTC_EXPORT AudioEncoderOpusConfig { bool cbr_enabled; int max_playback_rate_hz; - // |complexity| is used when the bitrate goes above - // |complexity_threshold_bps| + |complexity_threshold_window_bps|; - // |low_rate_complexity| is used when the bitrate falls below - // |complexity_threshold_bps| - |complexity_threshold_window_bps|. In the + // `complexity` is used when the bitrate goes above + // `complexity_threshold_bps` + `complexity_threshold_window_bps`; + // `low_rate_complexity` is used when the bitrate falls below + // `complexity_threshold_bps` - `complexity_threshold_window_bps`. In the // interval in the middle, we keep using the most recent of the two // complexity settings. int complexity; diff --git a/api/call/bitrate_allocation.h b/api/call/bitrate_allocation.h index 13c7f74b3a..4b4e5e7ae1 100644 --- a/api/call/bitrate_allocation.h +++ b/api/call/bitrate_allocation.h @@ -32,7 +32,7 @@ struct BitrateAllocationUpdate { double packet_loss_ratio = 0; // Predicted round trip time. TimeDelta round_trip_time = TimeDelta::PlusInfinity(); - // |bwe_period| is deprecated, use |stable_target_bitrate| allocation instead. + // `bwe_period` is deprecated, use `stable_target_bitrate` allocation instead. TimeDelta bwe_period = TimeDelta::PlusInfinity(); // Congestion window pushback bitrate reduction fraction. Used in // VideoStreamEncoder to reduce the bitrate by the given fraction diff --git a/api/candidate.cc b/api/candidate.cc index d5fe3a0672..ad65121bde 100644 --- a/api/candidate.cc +++ b/api/candidate.cc @@ -92,7 +92,7 @@ uint32_t Candidate::GetPriority(uint32_t type_preference, // (2^8)*(local preference) + // (2^0)*(256 - component ID) - // |local_preference| length is 2 bytes, 0-65535 inclusive. + // `local_preference` length is 2 bytes, 0-65535 inclusive. // In our implemenation we will partion local_preference into // 0 1 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 diff --git a/api/candidate.h b/api/candidate.h index 745205575b..c9447bbf6c 100644 --- a/api/candidate.h +++ b/api/candidate.h @@ -112,7 +112,7 @@ class RTC_EXPORT Candidate { uint32_t generation() const { return generation_; } void set_generation(uint32_t generation) { generation_ = generation; } - // |network_cost| measures the cost/penalty of using this candidate. A network + // `network_cost` measures the cost/penalty of using this candidate. A network // cost of 0 indicates this candidate can be used freely. A value of // rtc::kNetworkCostMax indicates it should be used only as the last resort. void set_network_cost(uint16_t network_cost) { @@ -167,9 +167,9 @@ class RTC_EXPORT Candidate { bool operator!=(const Candidate& o) const; // Returns a sanitized copy configured by the given booleans. If - // |use_host_address| is true, the returned copy has its IP removed from - // |address()|, which leads |address()| to be a hostname address. If - // |filter_related_address|, the returned copy has its related address reset + // `use_host_address` is true, the returned copy has its IP removed from + // `address()`, which leads `address()` to be a hostname address. If + // `filter_related_address`, the returned copy has its related address reset // to the wildcard address (i.e. 0.0.0.0 for IPv4 and :: for IPv6). Note that // setting both booleans to false returns an identical copy to the original // candidate. diff --git a/api/data_channel_interface.h b/api/data_channel_interface.h index 56bb6c98fb..99ea551c2d 100644 --- a/api/data_channel_interface.h +++ b/api/data_channel_interface.h @@ -42,14 +42,14 @@ struct DataChannelInit { // The max period of time in milliseconds in which retransmissions will be // sent. After this time, no more retransmissions will be sent. // - // Cannot be set along with |maxRetransmits|. - // This is called |maxPacketLifeTime| in the WebRTC JS API. + // Cannot be set along with `maxRetransmits`. + // This is called `maxPacketLifeTime` in the WebRTC JS API. // Negative values are ignored, and positive values are clamped to [0-65535] absl::optional maxRetransmitTime; // The max number of retransmissions. // - // Cannot be set along with |maxRetransmitTime|. + // Cannot be set along with `maxRetransmitTime`. // Negative values are ignored, and positive values are clamped to [0-65535] absl::optional maxRetransmits; @@ -57,7 +57,7 @@ struct DataChannelInit { std::string protocol; // True if the channel has been externally negotiated and we do not send an - // in-band signalling in the form of an "open" message. If this is true, |id| + // in-band signalling in the form of an "open" message. If this is true, `id` // below must be set; otherwise it should be unset and will be negotiated // in-band. bool negotiated = false; @@ -70,7 +70,7 @@ struct DataChannelInit { }; // At the JavaScript level, data can be passed in as a string or a blob, so -// this structure's |binary| flag tells whether the data should be interpreted +// this structure's `binary` flag tells whether the data should be interpreted // as binary or text. struct DataBuffer { DataBuffer(const rtc::CopyOnWriteBuffer& data, bool binary) @@ -180,7 +180,7 @@ class RTC_EXPORT DataChannelInterface : public rtc::RefCountInterface { // https://tools.ietf.org/html/draft-ietf-rtcweb-data-channel-13#section-6.7 virtual void Close() = 0; - // Sends |data| to the remote peer. If the data can't be sent at the SCTP + // Sends `data` to the remote peer. If the data can't be sent at the SCTP // level (due to congestion control), it's buffered at the data channel level, // up to a maximum of 16MB. If Send is called while this buffer is full, the // data channel will be closed abruptly. diff --git a/api/dtmf_sender_interface.h b/api/dtmf_sender_interface.h index 7c0e2ce7c3..d63e66bbf7 100644 --- a/api/dtmf_sender_interface.h +++ b/api/dtmf_sender_interface.h @@ -23,8 +23,8 @@ namespace webrtc { // DtmfSender. class DtmfSenderObserverInterface { public: - // Triggered when DTMF |tone| is sent. - // If |tone| is empty that means the DtmfSender has sent out all the given + // Triggered when DTMF `tone` is sent. + // If `tone` is empty that means the DtmfSender has sent out all the given // tones. // The callback includes the state of the tone buffer at the time when // the tone finished playing. @@ -58,7 +58,7 @@ class DtmfSenderInterface : public rtc::RefCountInterface { // able to send packets, and a "telephone-event" codec must be negotiated. virtual bool CanInsertDtmf() = 0; - // Queues a task that sends the DTMF |tones|. The |tones| parameter is treated + // Queues a task that sends the DTMF `tones`. The `tones` parameter is treated // as a series of characters. The characters 0 through 9, A through D, #, and // * generate the associated DTMF tones. The characters a to d are equivalent // to A to D. The character ',' indicates a delay of 2 seconds before @@ -66,18 +66,18 @@ class DtmfSenderInterface : public rtc::RefCountInterface { // // Unrecognized characters are ignored. // - // The |duration| parameter indicates the duration in ms to use for each - // character passed in the |tones| parameter. The duration cannot be more + // The `duration` parameter indicates the duration in ms to use for each + // character passed in the `tones` parameter. The duration cannot be more // than 6000 or less than 70. // - // The |inter_tone_gap| parameter indicates the gap between tones in ms. The - // |inter_tone_gap| must be at least 50 ms but should be as short as + // The `inter_tone_gap` parameter indicates the gap between tones in ms. The + // `inter_tone_gap` must be at least 50 ms but should be as short as // possible. // - // The |comma_delay| parameter indicates the delay after the ',' - // character. InsertDtmf specifies |comma_delay| as an argument + // The `comma_delay` parameter indicates the delay after the ',' + // character. InsertDtmf specifies `comma_delay` as an argument // with a default value of 2 seconds as per the WebRTC spec. This parameter - // allows users to comply with legacy WebRTC clients. The |comma_delay| + // allows users to comply with legacy WebRTC clients. The `comma_delay` // must be at least 50 ms. // // If InsertDtmf is called on the same object while an existing task for this diff --git a/api/fec_controller.h b/api/fec_controller.h index 3e5f7bb216..f3d7a8aa26 100644 --- a/api/fec_controller.h +++ b/api/fec_controller.h @@ -38,7 +38,7 @@ class VCMProtectionCallback { // FecController calculates how much of the allocated network // capacity that can be used by an encoder and how much that // is needed for redundant packets such as FEC and NACK. It uses an -// implementation of |VCMProtectionCallback| to set new FEC parameters and get +// implementation of `VCMProtectionCallback` to set new FEC parameters and get // the bitrate currently used for FEC and NACK. // Usage: // Setup by calling SetProtectionMethod and SetEncodingData. diff --git a/api/frame_transformer_interface.h b/api/frame_transformer_interface.h index 2cfe6edb88..ab56f04750 100644 --- a/api/frame_transformer_interface.h +++ b/api/frame_transformer_interface.h @@ -30,7 +30,7 @@ class TransformableFrameInterface { // method call. virtual rtc::ArrayView GetData() const = 0; - // Copies |data| into the owned frame payload data. + // Copies `data` into the owned frame payload data. virtual void SetData(rtc::ArrayView data) = 0; virtual uint32_t GetTimestamp() const = 0; @@ -78,7 +78,7 @@ class TransformedFrameCallback : public rtc::RefCountInterface { // the TransformedFrameCallback interface (see above). class FrameTransformerInterface : public rtc::RefCountInterface { public: - // Transforms |frame| using the implementing class' processing logic. + // Transforms `frame` using the implementing class' processing logic. virtual void Transform( std::unique_ptr transformable_frame) = 0; diff --git a/api/jsep.h b/api/jsep.h index b56cf1d15b..3348d7b239 100644 --- a/api/jsep.h +++ b/api/jsep.h @@ -73,7 +73,7 @@ class RTC_EXPORT IceCandidateInterface { // Creates a IceCandidateInterface based on SDP string. // Returns null if the sdp string can't be parsed. -// |error| may be null. +// `error` may be null. RTC_EXPORT IceCandidateInterface* CreateIceCandidate(const std::string& sdp_mid, int sdp_mline_index, const std::string& sdp, @@ -91,7 +91,7 @@ class IceCandidateCollection { public: virtual ~IceCandidateCollection() {} virtual size_t count() const = 0; - // Returns true if an equivalent |candidate| exist in the collection. + // Returns true if an equivalent `candidate` exist in the collection. virtual bool HasCandidate(const IceCandidateInterface* candidate) const = 0; virtual const IceCandidateInterface* at(size_t index) const = 0; }; @@ -158,7 +158,7 @@ class RTC_EXPORT SessionDescriptionInterface { virtual SdpType GetType() const; // kOffer/kPrAnswer/kAnswer - // TODO(steveanton): Remove this in favor of |GetType| that returns SdpType. + // TODO(steveanton): Remove this in favor of `GetType` that returns SdpType. virtual std::string type() const = 0; // Adds the specified candidate to the description. @@ -190,7 +190,7 @@ class RTC_EXPORT SessionDescriptionInterface { // Creates a SessionDescriptionInterface based on the SDP string and the type. // Returns null if the sdp string can't be parsed or the type is unsupported. -// |error| may be null. +// `error` may be null. // TODO(steveanton): This function is deprecated. Please use the functions below // which take an SdpType enum instead. Remove this once it is no longer used. RTC_EXPORT SessionDescriptionInterface* CreateSessionDescription( @@ -200,8 +200,8 @@ RTC_EXPORT SessionDescriptionInterface* CreateSessionDescription( // Creates a SessionDescriptionInterface based on the SDP string and the type. // Returns null if the SDP string cannot be parsed. -// If using the signature with |error_out|, details of the parsing error may be -// written to |error_out| if it is not null. +// If using the signature with `error_out`, details of the parsing error may be +// written to `error_out` if it is not null. RTC_EXPORT std::unique_ptr CreateSessionDescription(SdpType type, const std::string& sdp); RTC_EXPORT std::unique_ptr @@ -221,7 +221,7 @@ std::unique_ptr CreateSessionDescription( class RTC_EXPORT CreateSessionDescriptionObserver : public rtc::RefCountInterface { public: - // This callback transfers the ownership of the |desc|. + // This callback transfers the ownership of the `desc`. // TODO(deadbeef): Make this take an std::unique_ptr<> to avoid confusion // around ownership. virtual void OnSuccess(SessionDescriptionInterface* desc) = 0; diff --git a/api/jsep_ice_candidate.h b/api/jsep_ice_candidate.h index 1a4247cb07..40e2783457 100644 --- a/api/jsep_ice_candidate.h +++ b/api/jsep_ice_candidate.h @@ -37,7 +37,7 @@ class RTC_EXPORT JsepIceCandidate : public IceCandidateInterface { JsepIceCandidate(const JsepIceCandidate&) = delete; JsepIceCandidate& operator=(const JsepIceCandidate&) = delete; ~JsepIceCandidate() override; - // |err| may be null. + // `err` may be null. bool Initialize(const std::string& sdp, SdpParseError* err); void SetCandidate(const cricket::Candidate& candidate) { candidate_ = candidate; diff --git a/api/jsep_session_description.h b/api/jsep_session_description.h index 70ac9398a6..a4300eba98 100644 --- a/api/jsep_session_description.h +++ b/api/jsep_session_description.h @@ -43,7 +43,7 @@ class JsepSessionDescription : public SessionDescriptionInterface { absl::string_view session_version); virtual ~JsepSessionDescription(); - // Takes ownership of |description|. + // Takes ownership of `description`. bool Initialize(std::unique_ptr description, const std::string& session_id, const std::string& session_version); diff --git a/api/media_stream_interface.h b/api/media_stream_interface.h index 8892ee5a0b..874b4dbf70 100644 --- a/api/media_stream_interface.h +++ b/api/media_stream_interface.h @@ -200,7 +200,7 @@ class AudioTrackSinkInterface { RTC_NOTREACHED() << "This method must be overridden, or not used."; } - // In this method, |absolute_capture_timestamp_ms|, when available, is + // In this method, `absolute_capture_timestamp_ms`, when available, is // supposed to deliver the timestamp when this audio frame was originally // captured. This timestamp MUST be based on the same clock as // rtc::TimeMillis(). @@ -240,7 +240,7 @@ class RTC_EXPORT AudioSourceInterface : public MediaSourceInterface { // TODO(deadbeef): Makes all the interfaces pure virtual after they're // implemented in chromium. - // Sets the volume of the source. |volume| is in the range of [0, 10]. + // Sets the volume of the source. `volume` is in the range of [0, 10]. // TODO(tommi): This method should be on the track and ideally volume should // be applied in the track in a way that does not affect clones of the track. virtual void SetVolume(double volume) {} @@ -268,7 +268,7 @@ class AudioProcessorInterface : public rtc::RefCountInterface { AudioProcessingStats apm_statistics; }; - // Get audio processor statistics. The |has_remote_tracks| argument should be + // Get audio processor statistics. The `has_remote_tracks` argument should be // set if there are active remote tracks (this would usually be true during // a call). If there are no remote tracks some of the stats will not be set by // the AudioProcessor, because they only make sense if there is at least one diff --git a/api/neteq/neteq.h b/api/neteq/neteq.h index 81340f16f8..dbfa0718e4 100644 --- a/api/neteq/neteq.h +++ b/api/neteq/neteq.h @@ -183,7 +183,7 @@ class NetEq { SdpAudioFormat sdp_format; }; - // Creates a new NetEq object, with parameters set in |config|. The |config| + // Creates a new NetEq object, with parameters set in `config`. The `config` // object will only have to be valid for the duration of the call to this // method. static NetEq* Create( @@ -205,15 +205,15 @@ class NetEq { virtual void InsertEmptyPacket(const RTPHeader& rtp_header) = 0; // Instructs NetEq to deliver 10 ms of audio data. The data is written to - // |audio_frame|. All data in |audio_frame| is wiped; |data_|, |speech_type_|, - // |num_channels_|, |sample_rate_hz_|, |samples_per_channel_|, and - // |vad_activity_| are updated upon success. If an error is returned, some + // `audio_frame`. All data in `audio_frame` is wiped; `data_`, `speech_type_`, + // `num_channels_`, `sample_rate_hz_`, `samples_per_channel_`, and + // `vad_activity_` are updated upon success. If an error is returned, some // fields may not have been updated, or may contain inconsistent values. - // If muted state is enabled (through Config::enable_muted_state), |muted| + // If muted state is enabled (through Config::enable_muted_state), `muted` // may be set to true after a prolonged expand period. When this happens, the - // |data_| in |audio_frame| is not written, but should be interpreted as being + // `data_` in `audio_frame` is not written, but should be interpreted as being // all zeros. For testing purposes, an override can be supplied in the - // |action_override| argument, which will cause NetEq to take this action + // `action_override` argument, which will cause NetEq to take this action // next, instead of the action it would normally choose. An optional output // argument for fetching the current sample rate can be provided, which // will return the same value as last_output_sample_rate_hz() but will avoid @@ -228,12 +228,12 @@ class NetEq { // Replaces the current set of decoders with the given one. virtual void SetCodecs(const std::map& codecs) = 0; - // Associates |rtp_payload_type| with the given codec, which NetEq will + // Associates `rtp_payload_type` with the given codec, which NetEq will // instantiate when it needs it. Returns true iff successful. virtual bool RegisterPayloadType(int rtp_payload_type, const SdpAudioFormat& audio_format) = 0; - // Removes |rtp_payload_type| from the codec database. Returns 0 on success, + // Removes `rtp_payload_type` from the codec database. Returns 0 on success, // -1 on failure. Removing a payload type that is not registered is ok and // will not result in an error. virtual int RemovePayloadType(uint8_t rtp_payload_type) = 0; @@ -250,12 +250,12 @@ class NetEq { // Sets a maximum delay in milliseconds for packet buffer. The latency will // not exceed the given value, even required delay (given the channel // conditions) is higher. Calling this method has the same effect as setting - // the |max_delay_ms| value in the NetEq::Config struct. + // the `max_delay_ms` value in the NetEq::Config struct. virtual bool SetMaximumDelay(int delay_ms) = 0; // Sets a base minimum delay in milliseconds for packet buffer. The minimum - // delay which is set via |SetMinimumDelay| can't be lower than base minimum - // delay. Calling this method is similar to setting the |min_delay_ms| value + // delay which is set via `SetMinimumDelay` can't be lower than base minimum + // delay. Calling this method is similar to setting the `min_delay_ms` value // in the NetEq::Config struct. Returns true if the base minimum is // successfully applied, otherwise false is returned. virtual bool SetBaseMinimumDelayMs(int delay_ms) = 0; @@ -272,7 +272,7 @@ class NetEq { // The packet buffer part of the delay is not updated during DTX/CNG periods. virtual int FilteredCurrentDelayMs() const = 0; - // Writes the current network statistics to |stats|. The statistics are reset + // Writes the current network statistics to `stats`. The statistics are reset // after the call. virtual int NetworkStatistics(NetEqNetworkStatistics* stats) = 0; diff --git a/api/neteq/neteq_controller.h b/api/neteq/neteq_controller.h index 4c49a0c24a..2f203f4344 100644 --- a/api/neteq/neteq_controller.h +++ b/api/neteq/neteq_controller.h @@ -115,13 +115,13 @@ class NetEqController { virtual void SoftReset() = 0; // Given info about the latest received packet, and current jitter buffer - // status, returns the operation. |target_timestamp| and |expand_mutefactor| - // are provided for reference. |last_packet_samples| is the number of samples + // status, returns the operation. `target_timestamp` and `expand_mutefactor` + // are provided for reference. `last_packet_samples` is the number of samples // obtained from the last decoded frame. If there is a packet available, it - // should be supplied in |packet|. The mode resulting from the last call to - // NetEqImpl::GetAudio is supplied in |last_mode|. If there is a DTMF event to - // play, |play_dtmf| should be set to true. The output variable - // |reset_decoder| will be set to true if a reset is required; otherwise it is + // should be supplied in `packet`. The mode resulting from the last call to + // NetEqImpl::GetAudio is supplied in `last_mode`. If there is a DTMF event to + // play, `play_dtmf` should be set to true. The output variable + // `reset_decoder` will be set to true if a reset is required; otherwise it is // left unchanged (i.e., it can remain true if it was true before the call). virtual NetEq::Operation GetDecision(const NetEqStatus& status, bool* reset_decoder) = 0; @@ -144,11 +144,11 @@ class NetEqController { virtual bool SetBaseMinimumDelay(int delay_ms) = 0; virtual int GetBaseMinimumDelay() const = 0; - // These methods test the |cng_state_| for different conditions. + // These methods test the `cng_state_` for different conditions. virtual bool CngRfc3389On() const = 0; virtual bool CngOff() const = 0; - // Resets the |cng_state_| to kCngOff. + // Resets the `cng_state_` to kCngOff. virtual void SetCngOff() = 0; // Reports back to DecisionLogic whether the decision to do expand remains or @@ -157,7 +157,7 @@ class NetEqController { // sync buffer. virtual void ExpandDecision(NetEq::Operation operation) = 0; - // Adds |value| to |sample_memory_|. + // Adds `value` to `sample_memory_`. virtual void AddSampleMemory(int32_t value) = 0; // Returns the target buffer level in ms. diff --git a/api/neteq/neteq_controller_factory.h b/api/neteq/neteq_controller_factory.h index 6478fce568..9aba8a21a7 100644 --- a/api/neteq/neteq_controller_factory.h +++ b/api/neteq/neteq_controller_factory.h @@ -23,7 +23,7 @@ class NetEqControllerFactory { public: virtual ~NetEqControllerFactory() = default; - // Creates a new NetEqController object, with parameters set in |config|. + // Creates a new NetEqController object, with parameters set in `config`. virtual std::unique_ptr CreateNetEqController( const NetEqController::Config& config) const = 0; }; diff --git a/api/neteq/neteq_factory.h b/api/neteq/neteq_factory.h index 65cf9eb2e4..526a1282f5 100644 --- a/api/neteq/neteq_factory.h +++ b/api/neteq/neteq_factory.h @@ -24,7 +24,7 @@ class NetEqFactory { public: virtual ~NetEqFactory() = default; - // Creates a new NetEq object, with parameters set in |config|. The |config| + // Creates a new NetEq object, with parameters set in `config`. The `config` // object will only have to be valid for the duration of the call to this // method. virtual std::unique_ptr CreateNetEq( diff --git a/api/numerics/samples_stats_counter.h b/api/numerics/samples_stats_counter.h index 283c1e4ed2..16d5d2a891 100644 --- a/api/numerics/samples_stats_counter.h +++ b/api/numerics/samples_stats_counter.h @@ -82,7 +82,7 @@ class SamplesStatsCounter { // additions were done. This function may not be called if there are no // samples. // - // |percentile| has to be in [0; 1]. 0 percentile is the min in the array and + // `percentile` has to be in [0; 1]. 0 percentile is the min in the array and // 1 percentile is the max in the array. double GetPercentile(double percentile); // Returns array view with all samples added into counter. There are no @@ -105,14 +105,14 @@ class SamplesStatsCounter { bool sorted_ = false; }; -// Multiply all sample values on |value| and return new SamplesStatsCounter +// Multiply all sample values on `value` and return new SamplesStatsCounter // with resulted samples. Doesn't change origin SamplesStatsCounter. SamplesStatsCounter operator*(const SamplesStatsCounter& counter, double value); inline SamplesStatsCounter operator*(double value, const SamplesStatsCounter& counter) { return counter * value; } -// Divide all sample values on |value| and return new SamplesStatsCounter with +// Divide all sample values on `value` and return new SamplesStatsCounter with // resulted samples. Doesn't change origin SamplesStatsCounter. SamplesStatsCounter operator/(const SamplesStatsCounter& counter, double value); diff --git a/api/peer_connection_interface.h b/api/peer_connection_interface.h index 5499b7d87c..b9350ac9e1 100644 --- a/api/peer_connection_interface.h +++ b/api/peer_connection_interface.h @@ -235,9 +235,9 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { std::string username; std::string password; TlsCertPolicy tls_cert_policy = kTlsCertPolicySecure; - // If the URIs in |urls| only contain IP addresses, this field can be used + // If the URIs in `urls` only contain IP addresses, this field can be used // to indicate the hostname, which may be necessary for TLS (using the SNI - // extension). If |urls| itself contains the hostname, this isn't + // extension). If `urls` itself contains the hostname, this isn't // necessary. std::string hostname; // List of protocols to be used in the TLS ALPN extension. @@ -526,7 +526,7 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { // re-determining was removed in ICEbis (ICE v2). bool redetermine_role_on_ice_restart = true; - // This flag is only effective when |continual_gathering_policy| is + // This flag is only effective when `continual_gathering_policy` is // GATHER_CONTINUALLY. // // If true, after the ICE transport type is changed such that new types of @@ -712,8 +712,8 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { }; // Used by GetStats to decide which stats to include in the stats reports. - // |kStatsOutputLevelStandard| includes the standard stats for Javascript API; - // |kStatsOutputLevelDebug| includes both the standard stats and additional + // `kStatsOutputLevelStandard` includes the standard stats for Javascript API; + // `kStatsOutputLevelDebug` includes both the standard stats and additional // stats for debugging purposes. enum StatsOutputLevel { kStatsOutputLevelStandard, @@ -754,10 +754,10 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { // Add a new MediaStreamTrack to be sent on this PeerConnection, and return // the newly created RtpSender. The RtpSender will be associated with the - // streams specified in the |stream_ids| list. + // streams specified in the `stream_ids` list. // // Errors: - // - INVALID_PARAMETER: |track| is null, has a kind other than audio or video, + // - INVALID_PARAMETER: `track` is null, has a kind other than audio or video, // or a sender already exists for the track. // - INVALID_STATE: The PeerConnection is closed. virtual RTCErrorOr> AddTrack( @@ -774,7 +774,7 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { // corresponding RtpTransceiver direction as no longer sending. // // Errors: - // - INVALID_PARAMETER: |sender| is null or (Plan B only) the sender is not + // - INVALID_PARAMETER: `sender` is null or (Plan B only) the sender is not // associated with this PeerConnection. // - INVALID_STATE: PeerConnection is closed. // TODO(bugs.webrtc.org/9534): Rename to RemoveTrack once the other signature @@ -786,7 +786,7 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { // transceivers. Adding a transceiver will cause future calls to CreateOffer // to add a media description for the corresponding transceiver. // - // The initial value of |mid| in the returned transceiver is null. Setting a + // The initial value of `mid` in the returned transceiver is null. Setting a // new session description may change it to a non-null value. // // https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addtransceiver @@ -805,7 +805,7 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { // of the transceiver (and sender/receiver) will be derived from the kind of // the track. // Errors: - // - INVALID_PARAMETER: |track| is null. + // - INVALID_PARAMETER: `track` is null. virtual RTCErrorOr> AddTransceiver(rtc::scoped_refptr track) = 0; virtual RTCErrorOr> @@ -815,7 +815,7 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { // Adds a transceiver with the given kind. Can either be MEDIA_TYPE_AUDIO or // MEDIA_TYPE_VIDEO. // Errors: - // - INVALID_PARAMETER: |media_type| is not MEDIA_TYPE_AUDIO or + // - INVALID_PARAMETER: `media_type` is not MEDIA_TYPE_AUDIO or // MEDIA_TYPE_VIDEO. virtual RTCErrorOr> AddTransceiver(cricket::MediaType media_type) = 0; @@ -830,9 +830,9 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { // The standard way to do this would be through "addTransceiver", but we // don't support that API yet. // - // |kind| must be "audio" or "video". + // `kind` must be "audio" or "video". // - // |stream_id| is used to populate the msid attribute; if empty, one will + // `stream_id` is used to populate the msid attribute; if empty, one will // be generated automatically. // // This method is not supported with kUnifiedPlan semantics. Please use @@ -986,7 +986,7 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { // returned by CreateOffer() or CreateAnswer() or else the operation should // fail. Our implementation however allows some amount of "SDP munging", but // please note that this is HIGHLY DISCOURAGED. If you do not intent to munge - // SDP, the method below that doesn't take |desc| as an argument will create + // SDP, the method below that doesn't take `desc` as an argument will create // the offer or answer for you. // // The observer is invoked as soon as the operation completes, which could be @@ -1044,10 +1044,10 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { virtual PeerConnectionInterface::RTCConfiguration GetConfiguration() = 0; - // Sets the PeerConnection's global configuration to |config|. + // Sets the PeerConnection's global configuration to `config`. // - // The members of |config| that may be changed are |type|, |servers|, - // |ice_candidate_pool_size| and |prune_turn_ports| (though the candidate + // The members of `config` that may be changed are `type`, `servers`, + // `ice_candidate_pool_size` and `prune_turn_ports` (though the candidate // pool size can't be changed after the first call to SetLocalDescription). // Note that this means the BUNDLE and RTCP-multiplexing policies cannot be // changed with this method. @@ -1055,14 +1055,14 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { // Any changes to STUN/TURN servers or ICE candidate policy will affect the // next gathering phase, and cause the next call to createOffer to generate // new ICE credentials, as described in JSEP. This also occurs when - // |prune_turn_ports| changes, for the same reasoning. + // `prune_turn_ports` changes, for the same reasoning. // - // If an error occurs, returns false and populates |error| if non-null: - // - INVALID_MODIFICATION if |config| contains a modified parameter other + // If an error occurs, returns false and populates `error` if non-null: + // - INVALID_MODIFICATION if `config` contains a modified parameter other // than one of the parameters listed above. - // - INVALID_RANGE if |ice_candidate_pool_size| is out of range. + // - INVALID_RANGE if `ice_candidate_pool_size` is out of range. // - SYNTAX_ERROR if parsing an ICE server URL failed. - // - INVALID_PARAMETER if a TURN server is missing |username| or |password|. + // - INVALID_PARAMETER if a TURN server is missing `username` or `password`. // - INTERNAL_ERROR if an unexpected error occurred. // // TODO(nisse): Make this pure virtual once all Chrome subclasses of @@ -1071,9 +1071,9 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { const PeerConnectionInterface::RTCConfiguration& config); // Provides a remote candidate to the ICE Agent. - // A copy of the |candidate| will be created and added to the remote + // A copy of the `candidate` will be created and added to the remote // description. So the caller of this method still has the ownership of the - // |candidate|. + // `candidate`. // TODO(hbos): The spec mandates chaining this operation onto the operations // chain; deprecate and remove this version in favor of the callback-based // signature. @@ -1096,13 +1096,13 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { // this PeerConnection. Other limitations might affect these limits and // are respected (for example "b=AS" in SDP). // - // Setting |current_bitrate_bps| will reset the current bitrate estimate + // Setting `current_bitrate_bps` will reset the current bitrate estimate // to the provided value. virtual RTCError SetBitrate(const BitrateSettings& bitrate) = 0; // Enable/disable playout of received audio streams. Enabled by default. Note // that even if playout is enabled, streams will only be played out if the - // appropriate SDP is also applied. Setting |playout| to false will stop + // appropriate SDP is also applied. Setting `playout` to false will stop // playout of the underlying audio device but starts a task which will poll // for audio data every 10ms to ensure that audio processing happens and the // audio statistics are updated. @@ -1157,13 +1157,13 @@ class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface { virtual void AddAdaptationResource(rtc::scoped_refptr resource) {} // Start RtcEventLog using an existing output-sink. Takes ownership of - // |output| and passes it on to Call, which will take the ownership. If the + // `output` and passes it on to Call, which will take the ownership. If the // operation fails the output will be closed and deallocated. The event log - // will send serialized events to the output object every |output_period_ms|. + // will send serialized events to the output object every `output_period_ms`. // Applications using the event log should generally make their own trade-off // regarding the output period. A long period is generally more efficient, // with potential drawbacks being more bursty thread usage, and more events - // lost in case the application crashes. If the |output_period_ms| argument is + // lost in case the application crashes. If the `output_period_ms` argument is // omitted, webrtc selects a default deemed to be workable in most cases. virtual bool StartRtcEventLog(std::unique_ptr output, int64_t output_period_ms) = 0; @@ -1222,7 +1222,7 @@ class PeerConnectionObserver { // Used to fire spec-compliant onnegotiationneeded events, which should only // fire when the Operations Chain is empty. The observer is responsible for // queuing a task (e.g. Chromium: jump to main thread) to maybe fire the - // event. The event identified using |event_id| must only fire if + // event. The event identified using `event_id` must only fire if // PeerConnection::ShouldFireNegotiationNeededEvent() returns true since it is // possible for the event to become invalidated by operations subsequently // chained. @@ -1256,7 +1256,7 @@ class PeerConnectionObserver { // Gathering of an ICE candidate failed. // See https://w3c.github.io/webrtc-pc/#event-icecandidateerror - // |host_candidate| is a stringified socket address. + // `host_candidate` is a stringified socket address. virtual void OnIceCandidateError(const std::string& host_candidate, const std::string& url, int error_code, @@ -1393,7 +1393,7 @@ struct RTC_EXPORT PeerConnectionFactoryDependencies final { network_state_predictor_factory; std::unique_ptr network_controller_factory; // This will only be used if CreatePeerConnection is called without a - // |port_allocator|, causing the default allocator and network manager to be + // `port_allocator`, causing the default allocator and network manager to be // used. std::unique_ptr network_monitor_factory; std::unique_ptr neteq_factory; @@ -1467,12 +1467,12 @@ class RTC_EXPORT PeerConnectionFactoryInterface const PeerConnectionInterface::RTCConfiguration& configuration, PeerConnectionDependencies dependencies); - // Deprecated; |allocator| and |cert_generator| may be null, in which case + // Deprecated; `allocator` and `cert_generator` may be null, in which case // default implementations will be used. // - // |observer| must not be null. + // `observer` must not be null. // - // Note that this method does not take ownership of |observer|; it's the + // Note that this method does not take ownership of `observer`; it's the // responsibility of the caller to delete it. It can be safely deleted after // Close has been called on the returned PeerConnection, which ensures no // more observer callbacks will be invoked. @@ -1483,13 +1483,13 @@ class RTC_EXPORT PeerConnectionFactoryInterface std::unique_ptr cert_generator, PeerConnectionObserver* observer); - // Returns the capabilities of an RTP sender of type |kind|. + // Returns the capabilities of an RTP sender of type `kind`. // If for some reason you pass in MEDIA_TYPE_DATA, returns an empty structure. // TODO(orphis): Make pure virtual when all subclasses implement it. virtual RtpCapabilities GetRtpSenderCapabilities( cricket::MediaType kind) const; - // Returns the capabilities of an RTP receiver of type |kind|. + // Returns the capabilities of an RTP receiver of type `kind`. // If for some reason you pass in MEDIA_TYPE_DATA, returns an empty structure. // TODO(orphis): Make pure virtual when all subclasses implement it. virtual RtpCapabilities GetRtpReceiverCapabilities( @@ -1499,22 +1499,22 @@ class RTC_EXPORT PeerConnectionFactoryInterface const std::string& stream_id) = 0; // Creates an AudioSourceInterface. - // |options| decides audio processing settings. + // `options` decides audio processing settings. virtual rtc::scoped_refptr CreateAudioSource( const cricket::AudioOptions& options) = 0; - // Creates a new local VideoTrack. The same |source| can be used in several + // Creates a new local VideoTrack. The same `source` can be used in several // tracks. virtual rtc::scoped_refptr CreateVideoTrack( const std::string& label, VideoTrackSourceInterface* source) = 0; - // Creates an new AudioTrack. At the moment |source| can be null. + // Creates an new AudioTrack. At the moment `source` can be null. virtual rtc::scoped_refptr CreateAudioTrack( const std::string& label, AudioSourceInterface* source) = 0; - // Starts AEC dump using existing file. Takes ownership of |file| and passes + // Starts AEC dump using existing file. Takes ownership of `file` and passes // it on to VoiceEngine (via other objects) immediately, which will take // the ownerhip. If the operation fails, the file will be closed. // A maximum file size in bytes can be specified. When the file size limit is @@ -1549,8 +1549,8 @@ class RTC_EXPORT PeerConnectionFactoryInterface // video-specific interfaces, and omit the corresponding modules from its // build. // -// If |network_thread| or |worker_thread| are null, the PeerConnectionFactory -// will create the necessary thread internally. If |signaling_thread| is null, +// If `network_thread` or `worker_thread` are null, the PeerConnectionFactory +// will create the necessary thread internally. If `signaling_thread` is null, // the PeerConnectionFactory will use the thread on which this method is called // as the signaling thread, wrapping it in an rtc::Thread object if needed. RTC_EXPORT rtc::scoped_refptr diff --git a/api/rtc_error.h b/api/rtc_error.h index 7cfd89ab75..8ca2249762 100644 --- a/api/rtc_error.h +++ b/api/rtc_error.h @@ -176,7 +176,7 @@ inline std::ostream& operator<<( // no-presubmit-check TODO(webrtc:8982) #endif // WEBRTC_UNIT_TEST // Helper macro that can be used by implementations to create an error with a -// message and log it. |message| should be a string literal or movable +// message and log it. `message` should be a string literal or movable // std::string. #define LOG_AND_RETURN_ERROR_EX(type, message, severity) \ { \ diff --git a/api/rtc_event_log/rtc_event_log.h b/api/rtc_event_log/rtc_event_log.h index cebaf84e40..86613ddd85 100644 --- a/api/rtc_event_log/rtc_event_log.h +++ b/api/rtc_event_log/rtc_event_log.h @@ -42,7 +42,7 @@ class RtcEventLog { // which it would be permissible to read and/or modify it. virtual void StopLogging() = 0; - // Stops logging to file and calls |callback| when the file has been closed. + // Stops logging to file and calls `callback` when the file has been closed. // Note that it is not safe to call any other members, including the // destructor, until the callback has been called. // TODO(srte): Remove default implementation when it's safe to do so. diff --git a/api/rtc_event_log_output.h b/api/rtc_event_log_output.h index 92fb9e855b..cd16b27501 100644 --- a/api/rtc_event_log_output.h +++ b/api/rtc_event_log_output.h @@ -29,7 +29,7 @@ class RtcEventLogOutput { // Write encoded events to an output. Returns true if the output was // successfully written in its entirety. Otherwise, no guarantee is given // about how much data was written, if any. The output sink becomes inactive - // after the first time |false| is returned. Write() may not be called on + // after the first time `false` is returned. Write() may not be called on // an inactive output sink. virtual bool Write(const std::string& output) = 0; diff --git a/api/rtp_packet_info.h b/api/rtp_packet_info.h index 605620d638..13d3a3922a 100644 --- a/api/rtp_packet_info.h +++ b/api/rtp_packet_info.h @@ -23,9 +23,9 @@ namespace webrtc { // -// Structure to hold information about a received |RtpPacket|. It is primarily +// Structure to hold information about a received `RtpPacket`. It is primarily // used to carry per-packet information from when a packet is received until -// the information is passed to |SourceTracker|. +// the information is passed to `SourceTracker`. // class RTC_EXPORT RtpPacketInfo { public: @@ -102,8 +102,8 @@ class RTC_EXPORT RtpPacketInfo { // Fields from the Absolute Capture Time header extension: // http://www.webrtc.org/experiments/rtp-hdrext/abs-capture-time - // To not be confused with |local_capture_clock_offset_|, the - // |estimated_capture_clock_offset| in |absolute_capture_time_| should + // To not be confused with `local_capture_clock_offset_`, the + // `estimated_capture_clock_offset` in `absolute_capture_time_` should // represent the clock offset between a remote sender and the capturer, and // thus equals to the corresponding values in the received RTP packets, // subjected to possible interpolations. diff --git a/api/rtp_parameters.h b/api/rtp_parameters.h index a098bad6b0..71ae9843d1 100644 --- a/api/rtp_parameters.h +++ b/api/rtp_parameters.h @@ -126,7 +126,7 @@ struct RTC_EXPORT RtpCodecCapability { RtpCodecCapability(); ~RtpCodecCapability(); - // Build MIME "type/subtype" string from |name| and |kind|. + // Build MIME "type/subtype" string from `name` and `kind`. std::string mime_type() const { return MediaTypeToString(kind) + "/" + name; } // Used to identify the codec. Equivalent to MIME subtype. @@ -537,7 +537,7 @@ struct RTC_EXPORT RtpCodecParameters { RtpCodecParameters(const RtpCodecParameters&); ~RtpCodecParameters(); - // Build MIME "type/subtype" string from |name| and |kind|. + // Build MIME "type/subtype" string from `name` and `kind`. std::string mime_type() const { return MediaTypeToString(kind) + "/" + name; } // Used to identify the codec. Equivalent to MIME subtype. @@ -562,7 +562,7 @@ struct RTC_EXPORT RtpCodecParameters { absl::optional num_channels; // The maximum packetization time to be used by an RtpSender. - // If |ptime| is also set, this will be ignored. + // If `ptime` is also set, this will be ignored. // TODO(deadbeef): Not implemented. absl::optional max_ptime; @@ -607,7 +607,7 @@ struct RTC_EXPORT RtpCapabilities { // Supported Forward Error Correction (FEC) mechanisms. Note that the RED, // ulpfec and flexfec codecs used by these mechanisms will still appear in - // |codecs|. + // `codecs`. std::vector fec; bool operator==(const RtpCapabilities& o) const { diff --git a/api/rtp_receiver_interface.h b/api/rtp_receiver_interface.h index 327c9f2fee..e4ec9b5986 100644 --- a/api/rtp_receiver_interface.h +++ b/api/rtp_receiver_interface.h @@ -54,7 +54,7 @@ class RTC_EXPORT RtpReceiverInterface : public rtc::RefCountInterface { // TODO(https://bugs.webrtc.org/907849) remove default implementation virtual rtc::scoped_refptr dtls_transport() const; - // The list of streams that |track| is associated with. This is the same as + // The list of streams that `track` is associated with. This is the same as // the [[AssociatedRemoteMediaStreams]] internal slot in the spec. // https://w3c.github.io/webrtc-pc/#dfn-associatedremotemediastreams // TODO(hbos): Make pure virtual as soon as Chromium's mock implements this. @@ -84,8 +84,8 @@ class RTC_EXPORT RtpReceiverInterface : public rtc::RefCountInterface { virtual void SetObserver(RtpReceiverObserverInterface* observer) = 0; // Sets the jitter buffer minimum delay until media playout. Actual observed - // delay may differ depending on the congestion control. |delay_seconds| is a - // positive value including 0.0 measured in seconds. |nullopt| means default + // delay may differ depending on the congestion control. `delay_seconds` is a + // positive value including 0.0 measured in seconds. `nullopt` means default // value must be used. virtual void SetJitterBufferMinimumDelay( absl::optional delay_seconds) = 0; diff --git a/api/scoped_refptr.h b/api/scoped_refptr.h index 4e3f0ebfc8..5b3a08541e 100644 --- a/api/scoped_refptr.h +++ b/api/scoped_refptr.h @@ -24,13 +24,13 @@ // void some_function() { // scoped_refptr foo = new MyFoo(); // foo->Method(param); -// // |foo| is released when this function returns +// // `foo` is released when this function returns // } // // void some_other_function() { // scoped_refptr foo = new MyFoo(); // ... -// foo = nullptr; // explicitly releases |foo| +// foo = nullptr; // explicitly releases `foo` // ... // if (foo) // foo->Method(param); @@ -45,10 +45,10 @@ // scoped_refptr b; // // b.swap(a); -// // now, |b| references the MyFoo object, and |a| references null. +// // now, `b` references the MyFoo object, and `a` references null. // } // -// To make both |a| and |b| in the above example reference the same MyFoo +// To make both `a` and `b` in the above example reference the same MyFoo // object, simply use the assignment operator: // // { @@ -56,7 +56,7 @@ // scoped_refptr b; // // b = a; -// // now, |a| and |b| each own a reference to the same MyFoo object. +// // now, `a` and `b` each own a reference to the same MyFoo object. // } // diff --git a/api/stats/rtc_stats.h b/api/stats/rtc_stats.h index 9290e803fa..8ad39b4e23 100644 --- a/api/stats/rtc_stats.h +++ b/api/stats/rtc_stats.h @@ -35,7 +35,7 @@ class RTCStatsMemberInterface; // static const char kType[]; // It is used as a unique class identifier and a string representation of the // class type, see https://w3c.github.io/webrtc-stats/#rtcstatstype-str*. -// Use the |WEBRTC_RTCSTATS_IMPL| macro when implementing subclasses, see macro +// Use the `WEBRTC_RTCSTATS_IMPL` macro when implementing subclasses, see macro // for details. // // Derived classes list their dictionary members, RTCStatsMember, as public @@ -47,7 +47,7 @@ class RTCStatsMemberInterface; // foo.baz->push_back("hello world"); // uint32_t x = *foo.bar; // -// Pointers to all the members are available with |Members|, allowing iteration: +// Pointers to all the members are available with `Members`, allowing iteration: // // for (const RTCStatsMemberInterface* member : foo.Members()) { // printf("%s = %s\n", member->name(), member->ValueToString().c_str()); @@ -65,11 +65,11 @@ class RTC_EXPORT RTCStats { const std::string& id() const { return id_; } // Time relative to the UNIX epoch (Jan 1, 1970, UTC), in microseconds. int64_t timestamp_us() const { return timestamp_us_; } - // Returns the static member variable |kType| of the implementing class. + // Returns the static member variable `kType` of the implementing class. virtual const char* type() const = 0; - // Returns a vector of pointers to all the |RTCStatsMemberInterface| members + // Returns a vector of pointers to all the `RTCStatsMemberInterface` members // of this class. This allows for iteration of members. For a given class, - // |Members| always returns the same members in the same order. + // `Members` always returns the same members in the same order. std::vector Members() const; // Checks if the two stats objects are of the same type and have the same // member values. Timestamps are not compared. These operators are exposed for @@ -81,8 +81,8 @@ class RTC_EXPORT RTCStats { // object, listing all of its members (names and values). std::string ToJson() const; - // Downcasts the stats object to an |RTCStats| subclass |T|. DCHECKs that the - // object is of type |T|. + // Downcasts the stats object to an `RTCStats` subclass `T`. DCHECKs that the + // object is of type `T`. template const T& cast_to() const { RTC_DCHECK_EQ(type(), T::kType); @@ -90,8 +90,8 @@ class RTC_EXPORT RTCStats { } protected: - // Gets a vector of all members of this |RTCStats| object, including members - // derived from parent classes. |additional_capacity| is how many more members + // Gets a vector of all members of this `RTCStats` object, including members + // derived from parent classes. `additional_capacity` is how many more members // shall be reserved in the vector (so that subclasses can allocate a vector // with room for both parent and child members without it having to resize). virtual std::vector @@ -101,21 +101,21 @@ class RTC_EXPORT RTCStats { int64_t timestamp_us_; }; -// All |RTCStats| classes should use these macros. -// |WEBRTC_RTCSTATS_DECL| is placed in a public section of the class definition. -// |WEBRTC_RTCSTATS_IMPL| is placed outside the class definition (in a .cc). +// All `RTCStats` classes should use these macros. +// `WEBRTC_RTCSTATS_DECL` is placed in a public section of the class definition. +// `WEBRTC_RTCSTATS_IMPL` is placed outside the class definition (in a .cc). // -// These macros declare (in _DECL) and define (in _IMPL) the static |kType| and -// overrides methods as required by subclasses of |RTCStats|: |copy|, |type| and -// |MembersOfThisObjectAndAncestors|. The |...| argument is a list of addresses +// These macros declare (in _DECL) and define (in _IMPL) the static `kType` and +// overrides methods as required by subclasses of `RTCStats`: `copy`, `type` and +// `MembersOfThisObjectAndAncestors`. The |...| argument is a list of addresses // to each member defined in the implementing class. The list must have at least // one member. // // (Since class names need to be known to implement these methods this cannot be -// part of the base |RTCStats|. While these methods could be implemented using +// part of the base `RTCStats`. While these methods could be implemented using // templates, that would only work for immediate subclasses. Subclasses of // subclasses also have to override these methods, resulting in boilerplate -// code. Using a macro avoids this and works for any |RTCStats| class, including +// code. Using a macro avoids this and works for any `RTCStats` class, including // grandchildren.) // // Sample usage: @@ -215,10 +215,10 @@ enum class NonStandardGroupId { kRtcStatsRelativePacketArrivalDelay, }; -// Interface for |RTCStats| members, which have a name and a value of a type -// defined in a subclass. Only the types listed in |Type| are supported, these +// Interface for `RTCStats` members, which have a name and a value of a type +// defined in a subclass. Only the types listed in `Type` are supported, these // are implemented by |RTCStatsMember|. The value of a member may be -// undefined, the value can only be read if |is_defined|. +// undefined, the value can only be read if `is_defined`. class RTCStatsMemberInterface { public: // Member value types. @@ -284,7 +284,7 @@ class RTCStatsMemberInterface { bool is_defined_; }; -// Template implementation of |RTCStatsMemberInterface|. +// Template implementation of `RTCStatsMemberInterface`. // The supported types are the ones described by // |RTCStatsMemberInterface::Type|. template diff --git a/api/stats/rtc_stats_report.h b/api/stats/rtc_stats_report.h index 0fe5ce91f9..a26db86c77 100644 --- a/api/stats/rtc_stats_report.h +++ b/api/stats/rtc_stats_report.h @@ -30,7 +30,7 @@ namespace webrtc { // A collection of stats. -// This is accessible as a map from |RTCStats::id| to |RTCStats|. +// This is accessible as a map from `RTCStats::id` to `RTCStats`. class RTC_EXPORT RTCStatsReport final : public rtc::RefCountedNonVirtual { public: @@ -71,8 +71,8 @@ class RTC_EXPORT RTCStatsReport final const RTCStats* Get(const std::string& id) const; size_t size() const { return stats_.size(); } - // Gets the stat object of type |T| by ID, where |T| is any class descending - // from |RTCStats|. + // Gets the stat object of type `T` by ID, where `T` is any class descending + // from `RTCStats`. // Returns null if there is no stats object for the given ID or it is the // wrong type. template @@ -85,17 +85,17 @@ class RTC_EXPORT RTCStatsReport final } // Removes the stats object from the report, returning ownership of it or null - // if there is no object with |id|. + // if there is no object with `id`. std::unique_ptr Take(const std::string& id); - // Takes ownership of all the stats in |other|, leaving it empty. + // Takes ownership of all the stats in `other`, leaving it empty. void TakeMembersFrom(rtc::scoped_refptr other); // Stats iterators. Stats are ordered lexicographically on |RTCStats::id|. ConstIterator begin() const; ConstIterator end() const; - // Gets the subset of stats that are of type |T|, where |T| is any class - // descending from |RTCStats|. + // Gets the subset of stats that are of type `T`, where `T` is any class + // descending from `RTCStats`. template std::vector GetStatsOfType() const { std::vector stats_of_type; diff --git a/api/stats/rtcstats_objects.h b/api/stats/rtcstats_objects.h index 6995db8093..b18ef97a60 100644 --- a/api/stats/rtcstats_objects.h +++ b/api/stats/rtcstats_objects.h @@ -197,7 +197,7 @@ class RTC_EXPORT RTCIceCandidatePairStats final : public RTCStats { }; // https://w3c.github.io/webrtc-stats/#icecandidate-dict* -// TODO(hbos): |RTCStatsCollector| only collects candidates that are part of +// TODO(hbos): `RTCStatsCollector` only collects candidates that are part of // ice candidate pairs, but there could be candidates not paired with anything. // crbug.com/632723 // TODO(qingsi): Add the stats of STUN binding requests (keepalives) and collect @@ -221,7 +221,7 @@ class RTC_EXPORT RTCIceCandidateStats : public RTCStats { // TODO(hbos): Support enum types? "RTCStatsMember"? RTCStatsMember candidate_type; RTCStatsMember priority; - // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/632723 + // TODO(hbos): Not collected by `RTCStatsCollector`. crbug.com/632723 RTCStatsMember url; protected: @@ -232,8 +232,8 @@ class RTC_EXPORT RTCIceCandidateStats : public RTCStats { }; // In the spec both local and remote varieties are of type RTCIceCandidateStats. -// But here we define them as subclasses of |RTCIceCandidateStats| because the -// |kType| need to be different ("RTCStatsType type") in the local/remote case. +// But here we define them as subclasses of `RTCIceCandidateStats` because the +// `kType` need to be different ("RTCStatsType type") in the local/remote case. // https://w3c.github.io/webrtc-stats/#rtcstatstype-str* // This forces us to have to override copy() and type(). class RTC_EXPORT RTCLocalIceCandidateStats final : public RTCIceCandidateStats { @@ -289,28 +289,28 @@ class RTC_EXPORT RTCMediaStreamTrackStats final : public RTCStats { RTCStatsMember media_source_id; RTCStatsMember remote_source; RTCStatsMember ended; - // TODO(hbos): |RTCStatsCollector| does not return stats for detached tracks. + // TODO(hbos): `RTCStatsCollector` does not return stats for detached tracks. // crbug.com/659137 RTCStatsMember detached; - // See |RTCMediaStreamTrackKind| for valid values. + // See `RTCMediaStreamTrackKind` for valid values. RTCStatsMember kind; RTCStatsMember jitter_buffer_delay; RTCStatsMember jitter_buffer_emitted_count; // Video-only members RTCStatsMember frame_width; RTCStatsMember frame_height; - // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 + // TODO(hbos): Not collected by `RTCStatsCollector`. crbug.com/659137 RTCStatsMember frames_per_second; RTCStatsMember frames_sent; RTCStatsMember huge_frames_sent; RTCStatsMember frames_received; RTCStatsMember frames_decoded; RTCStatsMember frames_dropped; - // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 + // TODO(hbos): Not collected by `RTCStatsCollector`. crbug.com/659137 RTCStatsMember frames_corrupted; - // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 + // TODO(hbos): Not collected by `RTCStatsCollector`. crbug.com/659137 RTCStatsMember partial_frames_lost; - // TODO(hbos): Not collected by |RTCStatsCollector|. crbug.com/659137 + // TODO(hbos): Not collected by `RTCStatsCollector`. crbug.com/659137 RTCStatsMember full_frames_lost; // Audio-only members RTCStatsMember audio_level; // Receive-only diff --git a/api/stats_types.cc b/api/stats_types.cc index 6fdc7e85a5..6e62bba7cc 100644 --- a/api/stats_types.cc +++ b/api/stats_types.cc @@ -835,7 +835,7 @@ StatsReport* StatsCollection::ReplaceOrAddNew(const StatsReport::Id& id) { return InsertNew(id); } -// Looks for a report with the given |id|. If one is not found, null +// Looks for a report with the given `id`. If one is not found, null // will be returned. StatsReport* StatsCollection::Find(const StatsReport::Id& id) { RTC_DCHECK(thread_checker_.IsCurrent()); diff --git a/api/stats_types.h b/api/stats_types.h index d032462da6..6745d14836 100644 --- a/api/stats_types.h +++ b/api/stats_types.h @@ -39,58 +39,58 @@ class RTC_EXPORT StatsReport { enum StatsType { // StatsReport types. - // A StatsReport of |type| = "googSession" contains overall information + // A StatsReport of `type` = "googSession" contains overall information // about the thing libjingle calls a session (which may contain one // or more RTP sessions. kStatsReportTypeSession, - // A StatsReport of |type| = "googTransport" contains information + // A StatsReport of `type` = "googTransport" contains information // about a libjingle "transport". kStatsReportTypeTransport, - // A StatsReport of |type| = "googComponent" contains information + // A StatsReport of `type` = "googComponent" contains information // about a libjingle "channel" (typically, RTP or RTCP for a transport). // This is intended to be the same thing as an ICE "Component". kStatsReportTypeComponent, - // A StatsReport of |type| = "googCandidatePair" contains information + // A StatsReport of `type` = "googCandidatePair" contains information // about a libjingle "connection" - a single source/destination port pair. // This is intended to be the same thing as an ICE "candidate pair". kStatsReportTypeCandidatePair, - // A StatsReport of |type| = "VideoBWE" is statistics for video Bandwidth - // Estimation, which is global per-session. The |id| field is "bweforvideo" + // A StatsReport of `type` = "VideoBWE" is statistics for video Bandwidth + // Estimation, which is global per-session. The `id` field is "bweforvideo" // (will probably change in the future). kStatsReportTypeBwe, - // A StatsReport of |type| = "ssrc" is statistics for a specific rtp stream. - // The |id| field is the SSRC in decimal form of the rtp stream. + // A StatsReport of `type` = "ssrc" is statistics for a specific rtp stream. + // The `id` field is the SSRC in decimal form of the rtp stream. kStatsReportTypeSsrc, - // A StatsReport of |type| = "remoteSsrc" is statistics for a specific + // A StatsReport of `type` = "remoteSsrc" is statistics for a specific // rtp stream, generated by the remote end of the connection. kStatsReportTypeRemoteSsrc, - // A StatsReport of |type| = "googTrack" is statistics for a specific media - // track. The |id| field is the track id. + // A StatsReport of `type` = "googTrack" is statistics for a specific media + // track. The `id` field is the track id. kStatsReportTypeTrack, - // A StatsReport of |type| = "localcandidate" or "remotecandidate" is + // A StatsReport of `type` = "localcandidate" or "remotecandidate" is // attributes on a specific ICE Candidate. It links to its connection pair // by candidate id. The string value is taken from // http://w3c.github.io/webrtc-stats/#rtcstatstype-enum*. kStatsReportTypeIceLocalCandidate, kStatsReportTypeIceRemoteCandidate, - // A StatsReport of |type| = "googCertificate" contains an SSL certificate - // transmitted by one of the endpoints of this connection. The |id| is + // A StatsReport of `type` = "googCertificate" contains an SSL certificate + // transmitted by one of the endpoints of this connection. The `id` is // controlled by the fingerprint, and is used to identify the certificate in // the Channel stats (as "googLocalCertificateId" or // "googRemoteCertificateId") and in any child certificates (as // "googIssuerId"). kStatsReportTypeCertificate, - // A StatsReport of |type| = "datachannel" with statistics for a + // A StatsReport of `type` = "datachannel" with statistics for a // particular DataChannel. kStatsReportTypeDataChannel, }; @@ -331,7 +331,7 @@ class RTC_EXPORT StatsReport { bool bool_val() const; const Id& id_val() const; - // Returns the string representation of |name|. + // Returns the string representation of `name`. const char* display_name() const; // Converts the native value to a string representation of the value. @@ -339,7 +339,7 @@ class RTC_EXPORT StatsReport { Type type() const { return type_; } - // TODO(tommi): Move |name| and |display_name| out of the Value struct. + // TODO(tommi): Move `name` and `display_name` out of the Value struct. const StatsValueName name; private: @@ -364,7 +364,7 @@ class RTC_EXPORT StatsReport { typedef rtc::scoped_refptr ValuePtr; typedef std::map Values; - // Ownership of |id| is passed to |this|. + // Ownership of `id` is passed to `this`. explicit StatsReport(const Id& id); ~StatsReport(); @@ -434,13 +434,13 @@ class StatsCollection { const_iterator end() const; size_t size() const; - // Creates a new report object with |id| that does not already + // Creates a new report object with `id` that does not already // exist in the list of reports. StatsReport* InsertNew(const StatsReport::Id& id); StatsReport* FindOrAddNew(const StatsReport::Id& id); StatsReport* ReplaceOrAddNew(const StatsReport::Id& id); - // Looks for a report with the given |id|. If one is not found, null + // Looks for a report with the given `id`. If one is not found, null // will be returned. StatsReport* Find(const StatsReport::Id& id); diff --git a/api/task_queue/queued_task.h b/api/task_queue/queued_task.h index 5748628d7b..27a5eda5a5 100644 --- a/api/task_queue/queued_task.h +++ b/api/task_queue/queued_task.h @@ -20,9 +20,9 @@ class QueuedTask { virtual ~QueuedTask() = default; // Main routine that will run when the task is executed on the desired queue. - // The task should return |true| to indicate that it should be deleted or - // |false| to indicate that the queue should consider ownership of the task - // having been transferred. Returning |false| can be useful if a task has + // The task should return `true` to indicate that it should be deleted or + // `false` to indicate that the queue should consider ownership of the task + // having been transferred. Returning `false` can be useful if a task has // re-posted itself to a different queue or is otherwise being re-used. virtual bool Run() = 0; }; diff --git a/api/task_queue/task_queue_test.cc b/api/task_queue/task_queue_test.cc index 0d411d2d9c..3458edb159 100644 --- a/api/task_queue/task_queue_test.cc +++ b/api/task_queue/task_queue_test.cc @@ -37,7 +37,7 @@ TEST_P(TaskQueueTest, PostAndCheckCurrent) { rtc::Event event; auto queue = CreateTaskQueue(factory, "PostAndCheckCurrent"); - // We're not running a task, so |queue| shouldn't be current. + // We're not running a task, so `queue` shouldn't be current. // Note that because rtc::Thread also supports the TQ interface and // TestMainImpl::Init wraps the main test thread (bugs.webrtc.org/9714), that // means that TaskQueueBase::Current() will still return a valid value. @@ -190,7 +190,7 @@ TEST_P(TaskQueueTest, PostAndReuse) { } TEST_P(TaskQueueTest, PostALot) { - // Waits until DecrementCount called |count| times. Thread safe. + // Waits until DecrementCount called `count` times. Thread safe. class BlockingCounter { public: explicit BlockingCounter(int initial_count) : count_(initial_count) {} diff --git a/api/test/audio_quality_analyzer_interface.h b/api/test/audio_quality_analyzer_interface.h index c1044795d1..2eb7817445 100644 --- a/api/test/audio_quality_analyzer_interface.h +++ b/api/test/audio_quality_analyzer_interface.h @@ -25,9 +25,9 @@ class AudioQualityAnalyzerInterface : public StatsObserverInterface { ~AudioQualityAnalyzerInterface() override = default; // Will be called by the framework before the test. - // |test_case_name| is name of test case, that should be used to report all + // `test_case_name` is name of test case, that should be used to report all // audio metrics. - // |analyzer_helper| is a pointer to a class that will allow track_id to + // `analyzer_helper` is a pointer to a class that will allow track_id to // stream_id matching. The caller is responsible for ensuring the // AnalyzerHelper outlives the instance of the AudioQualityAnalyzerInterface. virtual void Start(std::string test_case_name, diff --git a/api/test/audioproc_float.h b/api/test/audioproc_float.h index fec2ad11fa..1ef1c9828f 100644 --- a/api/test/audioproc_float.h +++ b/api/test/audioproc_float.h @@ -23,12 +23,12 @@ namespace test { // utility can be used to simulate the audioprocessing module using a recording // (either an AEC dump or wav files), and generate the output as a wav file. // Any audio_processing object specified in the input is used for the -// simulation. The optional |audio_processing| object provides the +// simulation. The optional `audio_processing` object provides the // AudioProcessing instance that is used during the simulation. Note that when // the audio_processing object is specified all functionality that relies on // using the AudioProcessingBuilder is deactivated, since the AudioProcessing // object is already created and the builder is not used in the simulation. It -// is needed to pass the command line flags as |argc| and |argv|, so these can +// is needed to pass the command line flags as `argc` and `argv`, so these can // be interpreted properly by the utility. To see a list of all supported // command line flags, run the executable with the '--help' flag. int AudioprocFloat(rtc::scoped_refptr audio_processing, @@ -38,10 +38,10 @@ int AudioprocFloat(rtc::scoped_refptr audio_processing, // This is an interface for the audio processing simulation utility. This // utility can be used to simulate the audioprocessing module using a recording // (either an AEC dump or wav files), and generate the output as a wav file. -// The |ap_builder| object will be used to create the AudioProcessing instance -// that is used during the simulation. The |ap_builder| supports setting of +// The `ap_builder` object will be used to create the AudioProcessing instance +// that is used during the simulation. The `ap_builder` supports setting of // injectable components, which will be passed on to the created AudioProcessing -// instance. It is needed to pass the command line flags as |argc| and |argv|, +// instance. It is needed to pass the command line flags as `argc` and `argv`, // so these can be interpreted properly by the utility. // To get a fully-working audioproc_f utility, all that is needed is to write a // main function, create an AudioProcessingBuilder, optionally set custom @@ -56,9 +56,9 @@ int AudioprocFloat(std::unique_ptr ap_builder, // Interface for the audio processing simulation utility, which is similar to // the one above, but which adds the option of receiving the input as a string // and returning the output as an array. The first three arguments fulfill the -// same purpose as above. Pass the |input_aecdump| to provide the content of an +// same purpose as above. Pass the `input_aecdump` to provide the content of an // AEC dump file as a string. After the simulation is completed, -// |processed_capture_samples| will contain the the samples processed on the +// `processed_capture_samples` will contain the the samples processed on the // capture side. int AudioprocFloat(std::unique_ptr ap_builder, int argc, diff --git a/api/test/create_frame_generator.h b/api/test/create_frame_generator.h index 151414506c..cd4fcccd69 100644 --- a/api/test/create_frame_generator.h +++ b/api/test/create_frame_generator.h @@ -24,8 +24,8 @@ namespace test { // Creates a frame generator that produces frames with small squares that // move randomly towards the lower right corner. -// |type| has the default value FrameGeneratorInterface::OutputType::I420. -// |num_squares| has the default value 10. +// `type` has the default value FrameGeneratorInterface::OutputType::I420. +// `num_squares` has the default value 10. std::unique_ptr CreateSquareFrameGenerator( int width, int height, @@ -66,7 +66,7 @@ CreateScrollingInputFromYuvFilesFrameGenerator( // Creates a frame generator that produces randomly generated slides. It fills // the frames with randomly sized and colored squares. -// |frame_repeat_count| determines how many times each slide is shown. +// `frame_repeat_count` determines how many times each slide is shown. std::unique_ptr CreateSlideFrameGenerator(int width, int height, int frame_repeat_count); diff --git a/api/test/create_peer_connection_quality_test_frame_generator.cc b/api/test/create_peer_connection_quality_test_frame_generator.cc index 7f0ba20c85..29eb41ca42 100644 --- a/api/test/create_peer_connection_quality_test_frame_generator.cc +++ b/api/test/create_peer_connection_quality_test_frame_generator.cc @@ -30,7 +30,7 @@ void ValidateScreenShareConfig(const VideoConfig& video_config, const ScreenShareConfig& screen_share_config) { if (screen_share_config.slides_yuv_file_names.empty()) { if (screen_share_config.scrolling_params) { - // If we have scrolling params, then its |source_width| and |source_heigh| + // If we have scrolling params, then its `source_width` and `source_heigh` // will be used as width and height of video input, so we have to validate // it against width and height of default input. RTC_CHECK_EQ(screen_share_config.scrolling_params->source_width, diff --git a/api/test/create_peer_connection_quality_test_frame_generator.h b/api/test/create_peer_connection_quality_test_frame_generator.h index ff87331204..ab3f65aa57 100644 --- a/api/test/create_peer_connection_quality_test_frame_generator.h +++ b/api/test/create_peer_connection_quality_test_frame_generator.h @@ -21,7 +21,7 @@ namespace webrtc { namespace webrtc_pc_e2e { // Creates a frame generator that produces frames with small squares that move -// randomly towards the lower right corner. |type| has the default value +// randomly towards the lower right corner. `type` has the default value // FrameGeneratorInterface::OutputType::I420. video_config specifies frame // weight and height. std::unique_ptr CreateSquareFrameGenerator( diff --git a/api/test/create_peerconnection_quality_test_fixture.h b/api/test/create_peerconnection_quality_test_fixture.h index 95b9ced5d2..a0b0d08dd4 100644 --- a/api/test/create_peerconnection_quality_test_fixture.h +++ b/api/test/create_peerconnection_quality_test_fixture.h @@ -25,10 +25,10 @@ namespace webrtc_pc_e2e { // Create test fixture to establish test call between Alice and Bob. // During the test Alice will be caller and Bob will answer the call. -// |test_case_name| is a name of test case, that will be used for all metrics +// `test_case_name` is a name of test case, that will be used for all metrics // reporting. -// |time_controller| is used to manage all rtc::Thread's and TaskQueue -// instances. Instance of |time_controller| have to outlive created fixture. +// `time_controller` is used to manage all rtc::Thread's and TaskQueue +// instances. Instance of `time_controller` have to outlive created fixture. // Returns a non-null PeerConnectionE2EQualityTestFixture instance. std::unique_ptr CreatePeerConnectionE2EQualityTestFixture( diff --git a/api/test/create_time_controller.h b/api/test/create_time_controller.h index 1b6896f2b4..e7bc9cb465 100644 --- a/api/test/create_time_controller.h +++ b/api/test/create_time_controller.h @@ -17,7 +17,7 @@ namespace webrtc { -// Creates a time coltroller that wraps |alarm|. +// Creates a time coltroller that wraps `alarm`. std::unique_ptr CreateTimeController( ControlledAlarmClock* alarm); diff --git a/api/test/network_emulation/cross_traffic.h b/api/test/network_emulation/cross_traffic.h index 85343e44d2..737a93c2fd 100644 --- a/api/test/network_emulation/cross_traffic.h +++ b/api/test/network_emulation/cross_traffic.h @@ -27,12 +27,12 @@ class CrossTrafficRoute { public: virtual ~CrossTrafficRoute() = default; - // Triggers sending of dummy packets with size |packet_size| bytes. + // Triggers sending of dummy packets with size `packet_size` bytes. virtual void TriggerPacketBurst(size_t num_packets, size_t packet_size) = 0; // Sends a packet over the nodes. The content of the packet is unspecified; // only the size metter for the emulation purposes. virtual void SendPacket(size_t packet_size) = 0; - // Sends a packet over the nodes and runs |action| when it has been delivered. + // Sends a packet over the nodes and runs `action` when it has been delivered. virtual void NetworkDelayedAction(size_t packet_size, std::function action) = 0; }; diff --git a/api/test/network_emulation/network_emulation_interfaces.h b/api/test/network_emulation/network_emulation_interfaces.h index c8e6ed053e..735689c734 100644 --- a/api/test/network_emulation/network_emulation_interfaces.h +++ b/api/test/network_emulation/network_emulation_interfaces.h @@ -204,9 +204,9 @@ class EmulatedNetworkStats { class EmulatedEndpoint : public EmulatedNetworkReceiverInterface { public: // Send packet into network. - // |from| will be used to set source address for the packet in destination + // `from` will be used to set source address for the packet in destination // socket. - // |to| will be used for routing verification and picking right socket by port + // `to` will be used for routing verification and picking right socket by port // on destination endpoint. virtual void SendPacket(const rtc::SocketAddress& from, const rtc::SocketAddress& to, @@ -214,12 +214,12 @@ class EmulatedEndpoint : public EmulatedNetworkReceiverInterface { uint16_t application_overhead = 0) = 0; // Binds receiver to this endpoint to send and receive data. - // |desired_port| is a port that should be used. If it is equal to 0, + // `desired_port` is a port that should be used. If it is equal to 0, // endpoint will pick the first available port starting from - // |kFirstEphemeralPort|. + // `kFirstEphemeralPort`. // // Returns the port, that should be used (it will be equals to desired, if - // |desired_port| != 0 and is free or will be the one, selected by endpoint) + // `desired_port` != 0 and is free or will be the one, selected by endpoint) // or absl::nullopt if desired_port in used. Also fails if there are no more // free ports to bind to. // @@ -256,7 +256,7 @@ class EmulatedEndpoint : public EmulatedNetworkReceiverInterface { // they are guranteed to be delivered eventually, even on lossy networks. class TcpMessageRoute { public: - // Sends a TCP message of the given |size| over the route, |on_received| is + // Sends a TCP message of the given `size` over the route, `on_received` is // called when the message has been delivered. Note that the connection // parameters are reset iff there's no currently pending message on the route. virtual void SendMessage(size_t size, std::function on_received) = 0; diff --git a/api/test/network_emulation_manager.h b/api/test/network_emulation_manager.h index ec51b290e0..9fe4ad5eaf 100644 --- a/api/test/network_emulation_manager.h +++ b/api/test/network_emulation_manager.h @@ -130,7 +130,7 @@ class EmulatedNetworkManagerInterface { virtual std::vector endpoints() const = 0; // Passes summarized network stats for endpoints for this manager into - // specified |stats_callback|. Callback will be executed on network emulation + // specified `stats_callback`. Callback will be executed on network emulation // internal task queue. virtual void GetStats( std::function)> stats_callback) @@ -180,13 +180,13 @@ class NetworkEmulationManager { // Creates an emulated network node, which represents single network in // the emulated network layer. Uses default implementation on network behavior - // which can be configured with |config|. |random_seed| can be provided to + // which can be configured with `config`. `random_seed` can be provided to // alter randomization behavior. virtual EmulatedNetworkNode* CreateEmulatedNode( BuiltInNetworkBehaviorConfig config, uint64_t random_seed = 1) = 0; // Creates an emulated network node, which represents single network in - // the emulated network layer. |network_behavior| determines how created node + // the emulated network layer. `network_behavior` determines how created node // will forward incoming packets to the next receiver. virtual EmulatedNetworkNode* CreateEmulatedNode( std::unique_ptr network_behavior) = 0; @@ -205,8 +205,8 @@ class NetworkEmulationManager { // Creates a route between endpoints going through specified network nodes. // This route is single direction only and describe how traffic that was - // sent by network interface |from| have to be delivered to the network - // interface |to|. Return object can be used to remove created route. The + // sent by network interface `from` have to be delivered to the network + // interface `to`. Return object can be used to remove created route. The // route must contains at least one network node inside it. // // Assume that E{0-9} are endpoints and N{0-9} are network nodes, then @@ -228,7 +228,7 @@ class NetworkEmulationManager { const std::vector& via_nodes, EmulatedEndpoint* to) = 0; - // Creates a route over the given |via_nodes| creating the required endpoints + // Creates a route over the given `via_nodes` creating the required endpoints // in the process. The returned EmulatedRoute pointer can be used in other // calls as a transport route for message or cross traffic. virtual EmulatedRoute* CreateRoute( @@ -239,7 +239,7 @@ class NetworkEmulationManager { // packet's destination IP. // // This route is single direction only and describe how traffic that was - // sent by network interface |from| have to be delivered in case if routing + // sent by network interface `from` have to be delivered in case if routing // was unspecified. Return object can be used to remove created route. The // route must contains at least one network node inside it. // @@ -269,29 +269,29 @@ class NetworkEmulationManager { // packets being dropped. virtual void ClearRoute(EmulatedRoute* route) = 0; - // Creates a simulated TCP connection using |send_route| for traffic and - // |ret_route| for feedback. This can be used to emulate HTTP cross traffic + // Creates a simulated TCP connection using `send_route` for traffic and + // `ret_route` for feedback. This can be used to emulate HTTP cross traffic // and to implement realistic reliable signaling over lossy networks. // TODO(srte): Handle clearing of the routes involved. virtual TcpMessageRoute* CreateTcpRoute(EmulatedRoute* send_route, EmulatedRoute* ret_route) = 0; - // Creates a route over the given |via_nodes|. Returns an object that can be + // Creates a route over the given `via_nodes`. Returns an object that can be // used to emulate network load with cross traffic over the created route. virtual CrossTrafficRoute* CreateCrossTrafficRoute( const std::vector& via_nodes) = 0; - // Starts generating cross traffic using given |generator|. Takes ownership + // Starts generating cross traffic using given `generator`. Takes ownership // over the generator. virtual CrossTrafficGenerator* StartCrossTraffic( std::unique_ptr generator) = 0; - // Stops generating cross traffic that was started using given |generator|. - // The |generator| shouldn't be used after and the reference may be invalid. + // Stops generating cross traffic that was started using given `generator`. + // The `generator` shouldn't be used after and the reference may be invalid. virtual void StopCrossTraffic(CrossTrafficGenerator* generator) = 0; // Creates EmulatedNetworkManagerInterface which can be used then to inject - // network emulation layer into PeerConnection. |endpoints| - are available + // network emulation layer into PeerConnection. `endpoints` - are available // network interfaces for PeerConnection. If endpoint is enabled, it will be // immediately available for PeerConnection, otherwise user will be able to // enable endpoint later to make it available for PeerConnection. @@ -299,8 +299,8 @@ class NetworkEmulationManager { CreateEmulatedNetworkManagerInterface( const std::vector& endpoints) = 0; - // Passes summarized network stats for specified |endpoints| into specified - // |stats_callback|. Callback will be executed on network emulation + // Passes summarized network stats for specified `endpoints` into specified + // `stats_callback`. Callback will be executed on network emulation // internal task queue. virtual void GetStats( rtc::ArrayView endpoints, diff --git a/api/test/peerconnection_quality_test_fixture.h b/api/test/peerconnection_quality_test_fixture.h index ea230f0ad0..7aedd2def4 100644 --- a/api/test/peerconnection_quality_test_fixture.h +++ b/api/test/peerconnection_quality_test_fixture.h @@ -67,17 +67,17 @@ class PeerConnectionE2EQualityTestFixture { // bottom right corner of the picture. // // In such case source dimensions must be greater or equal to the sliding - // window dimensions. So |source_width| and |source_height| are the dimensions - // of the source frame, while |VideoConfig::width| and |VideoConfig::height| + // window dimensions. So `source_width` and `source_height` are the dimensions + // of the source frame, while `VideoConfig::width` and `VideoConfig::height` // are the dimensions of the sliding window. // - // Because |source_width| and |source_height| are dimensions of the source + // Because `source_width` and `source_height` are dimensions of the source // frame, they have to be width and height of videos from - // |ScreenShareConfig::slides_yuv_file_names|. + // `ScreenShareConfig::slides_yuv_file_names`. // // Because scrolling have to be done on single slide it also requires, that - // |duration| must be less or equal to - // |ScreenShareConfig::slide_change_interval|. + // `duration` must be less or equal to + // `ScreenShareConfig::slide_change_interval`. struct ScrollingParams { ScrollingParams(TimeDelta duration, size_t source_width, @@ -110,16 +110,16 @@ class PeerConnectionE2EQualityTestFixture { // will be applied in such case. bool generate_slides = false; // If present scrolling will be applied. Please read extra requirement on - // |slides_yuv_file_names| for scrolling. + // `slides_yuv_file_names` for scrolling. absl::optional scrolling_params; // Contains list of yuv files with slides. // // If empty, default set of slides will be used. In such case - // |VideoConfig::width| must be equal to |kDefaultSlidesWidth| and - // |VideoConfig::height| must be equal to |kDefaultSlidesHeight| or if - // |scrolling_params| are specified, then |ScrollingParams::source_width| - // must be equal to |kDefaultSlidesWidth| and - // |ScrollingParams::source_height| must be equal to |kDefaultSlidesHeight|. + // `VideoConfig::width` must be equal to `kDefaultSlidesWidth` and + // `VideoConfig::height` must be equal to `kDefaultSlidesHeight` or if + // `scrolling_params` are specified, then `ScrollingParams::source_width` + // must be equal to `kDefaultSlidesWidth` and + // `ScrollingParams::source_height` must be equal to `kDefaultSlidesHeight`. std::vector slides_yuv_file_names; }; @@ -128,7 +128,7 @@ class PeerConnectionE2EQualityTestFixture { // SVC support is limited: // During SVC testing there is no SFU, so framework will try to emulate SFU // behavior in regular p2p call. Because of it there are such limitations: - // * if |target_spatial_index| is not equal to the highest spatial layer + // * if `target_spatial_index` is not equal to the highest spatial layer // then no packet/frame drops are allowed. // // If there will be any drops, that will affect requested layer, then @@ -154,11 +154,11 @@ class PeerConnectionE2EQualityTestFixture { // Specifies spatial index of the video stream to analyze. // There are 2 cases: // 1. simulcast encoder is used: - // in such case |target_spatial_index| will specify the index of + // in such case `target_spatial_index` will specify the index of // simulcast stream, that should be analyzed. Other streams will be // dropped. // 2. SVC encoder is used: - // in such case |target_spatial_index| will specify the top interesting + // in such case `target_spatial_index` will specify the top interesting // spatial layer and all layers below, including target one will be // processed. All layers above target one will be dropped. // If not specified than whatever stream will be received will be analyzed. @@ -166,8 +166,8 @@ class PeerConnectionE2EQualityTestFixture { // network. absl::optional target_spatial_index; - // Encoding parameters per simulcast layer. If not empty, |encoding_params| - // size have to be equal to |simulcast_streams_count|. Will be used to set + // Encoding parameters per simulcast layer. If not empty, `encoding_params` + // size have to be equal to `simulcast_streams_count`. Will be used to set // transceiver send encoding params for simulcast layers. Applicable only // for codecs that support simulcast (ex. Vp8) and will be ignored // otherwise. RtpEncodingParameters::rid may be changed by fixture @@ -220,7 +220,7 @@ class PeerConnectionE2EQualityTestFixture { // was captured during the test for this video stream on sender side. // It is useful when generator is used as input. absl::optional input_dump_file_name; - // Used only if |input_dump_file_name| is set. Specifies the module for the + // Used only if `input_dump_file_name` is set. Specifies the module for the // video frames to be dumped. Modulo equals X means every Xth frame will be // written to the dump file. The value must be greater than 0. int input_dump_sampling_modulo = 1; @@ -229,7 +229,7 @@ class PeerConnectionE2EQualityTestFixture { // output files will be appended with indexes. The produced files contains // what was rendered for this video stream on receiver side. absl::optional output_dump_file_name; - // Used only if |output_dump_file_name| is set. Specifies the module for the + // Used only if `output_dump_file_name` is set. Specifies the module for the // video frames to be dumped. Modulo equals X means every Xth frame will be // written to the dump file. The value must be greater than 0. int output_dump_sampling_modulo = 1; @@ -282,9 +282,9 @@ class PeerConnectionE2EQualityTestFixture { std::string name = cricket::kVp8CodecName; // Map of parameters, that have to be specified on SDP codec. Each parameter // is described by key and value. Codec parameters will match the specified - // map if and only if for each key from |required_params| there will be + // map if and only if for each key from `required_params` there will be // a parameter with name equal to this key and parameter value will be equal - // to the value from |required_params| for this key. + // to the value from `required_params` for this key. // If empty then only name will be used to match the codec. std::map required_params; }; @@ -351,7 +351,7 @@ class PeerConnectionE2EQualityTestFixture { CapturingDeviceIndex capturing_device_index) = 0; // Set the list of video codecs used by the peer during the test. These // codecs will be negotiated in SDP during offer/answer exchange. The order - // of these codecs during negotiation will be the same as in |video_codecs|. + // of these codecs during negotiation will be the same as in `video_codecs`. // Codecs have to be available in codecs list provided by peer connection to // be negotiated. If some of specified codecs won't be found, the test will // crash. @@ -416,9 +416,9 @@ class PeerConnectionE2EQualityTestFixture { // Invoked by framework after peer connection factory and peer connection // itself will be created but before offer/answer exchange will be started. - // |test_case_name| is name of test case, that should be used to report all + // `test_case_name` is name of test case, that should be used to report all // metrics. - // |reporter_helper| is a pointer to a class that will allow track_id to + // `reporter_helper` is a pointer to a class that will allow track_id to // stream_id matching. The caller is responsible for ensuring the // TrackIdStreamInfoMap will be valid from Start() to // StopAndReportResults(). @@ -433,14 +433,14 @@ class PeerConnectionE2EQualityTestFixture { virtual ~PeerConnectionE2EQualityTestFixture() = default; // Add activity that will be executed on the best effort at least after - // |target_time_since_start| after call will be set up (after offer/answer + // `target_time_since_start` after call will be set up (after offer/answer // exchange, ICE gathering will be done and ICE candidates will passed to - // remote side). |func| param is amount of time spent from the call set up. + // remote side). `func` param is amount of time spent from the call set up. virtual void ExecuteAt(TimeDelta target_time_since_start, std::function func) = 0; - // Add activity that will be executed every |interval| with first execution - // on the best effort at least after |initial_delay_since_start| after call - // will be set up (after all participants will be connected). |func| param is + // Add activity that will be executed every `interval` with first execution + // on the best effort at least after `initial_delay_since_start` after call + // will be set up (after all participants will be connected). `func` param is // amount of time spent from the call set up. virtual void ExecuteEvery(TimeDelta initial_delay_since_start, TimeDelta interval, @@ -452,15 +452,15 @@ class PeerConnectionE2EQualityTestFixture { // Add a new peer to the call and return an object through which caller // can configure peer's behavior. - // |network_thread| will be used as network thread for peer's peer connection - // |network_manager| will be used to provide network interfaces for peer's + // `network_thread` will be used as network thread for peer's peer connection + // `network_manager` will be used to provide network interfaces for peer's // peer connection. - // |configurer| function will be used to configure peer in the call. + // `configurer` function will be used to configure peer in the call. virtual void AddPeer(rtc::Thread* network_thread, rtc::NetworkManager* network_manager, rtc::FunctionView configurer) = 0; // Runs the media quality test, which includes setting up the call with - // configured participants, running it according to provided |run_params| and + // configured participants, running it according to provided `run_params` and // terminating it properly at the end. During call duration media quality // metrics are gathered, which are then reported to stdout and (if configured) // to the json/protobuf output file through the WebRTC perf test results diff --git a/api/test/stats_observer_interface.h b/api/test/stats_observer_interface.h index ea4d6c23db..58d8f52d77 100644 --- a/api/test/stats_observer_interface.h +++ b/api/test/stats_observer_interface.h @@ -23,7 +23,7 @@ class StatsObserverInterface { virtual ~StatsObserverInterface() = default; // Method called when stats reports are available for the PeerConnection - // identified by |pc_label|. + // identified by `pc_label`. virtual void OnStatsReports( absl::string_view pc_label, const rtc::scoped_refptr& report) = 0; diff --git a/api/test/time_controller.h b/api/test/time_controller.h index bd3192ddf2..17aa0db80f 100644 --- a/api/test/time_controller.h +++ b/api/test/time_controller.h @@ -44,7 +44,7 @@ class TimeController { // Creates a process thread. virtual std::unique_ptr CreateProcessThread( const char* thread_name) = 0; - // Creates an rtc::Thread instance. If |socket_server| is nullptr, a default + // Creates an rtc::Thread instance. If `socket_server` is nullptr, a default // noop socket server is created. // Returned thread is not null and started. virtual std::unique_ptr CreateThread( @@ -55,12 +55,12 @@ class TimeController { // thread. virtual rtc::Thread* GetMainThread() = 0; // Allow task queues and process threads created by this instance to execute - // for the given |duration|. + // for the given `duration`. virtual void AdvanceTime(TimeDelta duration) = 0; // Waits until condition() == true, polling condition() in small time // intervals. - // Returns true if condition() was evaluated to true before |max_duration| + // Returns true if condition() was evaluated to true before `max_duration` // elapsed and false otherwise. bool Wait(const std::function& condition, TimeDelta max_duration = TimeDelta::Seconds(5)); @@ -75,17 +75,17 @@ class ControlledAlarmClock { // Gets a clock that tells the alarm clock's notion of time. virtual Clock* GetClock() = 0; - // Schedules the alarm to fire at |deadline|. - // An alarm clock only supports one deadline. Calls to |ScheduleAlarmAt| with + // Schedules the alarm to fire at `deadline`. + // An alarm clock only supports one deadline. Calls to `ScheduleAlarmAt` with // an earlier deadline will reset the alarm to fire earlier.Calls to - // |ScheduleAlarmAt| with a later deadline are ignored. Returns true if the + // `ScheduleAlarmAt` with a later deadline are ignored. Returns true if the // deadline changed, false otherwise. virtual bool ScheduleAlarmAt(Timestamp deadline) = 0; // Sets the callback that should be run when the alarm fires. virtual void SetCallback(std::function callback) = 0; - // Waits for |duration| to pass, according to the alarm clock. + // Waits for `duration` to pass, according to the alarm clock. virtual void Sleep(TimeDelta duration) = 0; }; diff --git a/api/test/track_id_stream_info_map.h b/api/test/track_id_stream_info_map.h index bb73cfd997..0f8e43e20e 100644 --- a/api/test/track_id_stream_info_map.h +++ b/api/test/track_id_stream_info_map.h @@ -16,7 +16,7 @@ namespace webrtc { namespace webrtc_pc_e2e { -// Instances of |TrackIdStreamInfoMap| provide bookkeeping capabilities that +// Instances of `TrackIdStreamInfoMap` provide bookkeeping capabilities that // are useful to associate stats reports track_ids to the remote stream info. class TrackIdStreamInfoMap { public: @@ -26,12 +26,12 @@ class TrackIdStreamInfoMap { // StatsObserverInterface::OnStatsReports is invoked. // Returns a reference to a stream label owned by the TrackIdStreamInfoMap. - // Precondition: |track_id| must be already mapped to stream label. + // Precondition: `track_id` must be already mapped to stream label. virtual absl::string_view GetStreamLabelFromTrackId( absl::string_view track_id) const = 0; // Returns a reference to a sync group name owned by the TrackIdStreamInfoMap. - // Precondition: |track_id| must be already mapped to sync group. + // Precondition: `track_id` must be already mapped to sync group. virtual absl::string_view GetSyncGroupLabelFromTrackId( absl::string_view track_id) const = 0; }; diff --git a/api/test/video_quality_analyzer_interface.h b/api/test/video_quality_analyzer_interface.h index 4488e5abf4..c8c7094c25 100644 --- a/api/test/video_quality_analyzer_interface.h +++ b/api/test/video_quality_analyzer_interface.h @@ -72,9 +72,9 @@ class VideoQualityAnalyzerInterface : public StatsObserverInterface { ~VideoQualityAnalyzerInterface() override = default; // Will be called by framework before test. - // |test_case_name| is name of test case, that should be used to report all + // `test_case_name` is name of test case, that should be used to report all // video metrics. - // |threads_count| is number of threads that analyzer can use for heavy + // `threads_count` is number of threads that analyzer can use for heavy // calculations. Analyzer can perform simple calculations on the calling // thread in each method, but should remember, that it is the same thread, // that is used in video pipeline. @@ -83,57 +83,57 @@ class VideoQualityAnalyzerInterface : public StatsObserverInterface { int max_threads_count) {} // Will be called when frame was generated from the input stream. - // |peer_name| is name of the peer on which side frame was captured. + // `peer_name` is name of the peer on which side frame was captured. // Returns frame id, that will be set by framework to the frame. virtual uint16_t OnFrameCaptured(absl::string_view peer_name, const std::string& stream_label, const VideoFrame& frame) = 0; // Will be called before calling the encoder. - // |peer_name| is name of the peer on which side frame came to encoder. + // `peer_name` is name of the peer on which side frame came to encoder. virtual void OnFramePreEncode(absl::string_view peer_name, const VideoFrame& frame) {} // Will be called for each EncodedImage received from encoder. Single // VideoFrame can produce multiple EncodedImages. Each encoded image will // have id from VideoFrame. - // |peer_name| is name of the peer on which side frame was encoded. + // `peer_name` is name of the peer on which side frame was encoded. virtual void OnFrameEncoded(absl::string_view peer_name, uint16_t frame_id, const EncodedImage& encoded_image, const EncoderStats& stats) {} // Will be called for each frame dropped by encoder. - // |peer_name| is name of the peer on which side frame drop was detected. + // `peer_name` is name of the peer on which side frame drop was detected. virtual void OnFrameDropped(absl::string_view peer_name, EncodedImageCallback::DropReason reason) {} // Will be called before calling the decoder. - // |peer_name| is name of the peer on which side frame was received. + // `peer_name` is name of the peer on which side frame was received. virtual void OnFramePreDecode(absl::string_view peer_name, uint16_t frame_id, const EncodedImage& encoded_image) {} // Will be called after decoding the frame. - // |peer_name| is name of the peer on which side frame was decoded. + // `peer_name` is name of the peer on which side frame was decoded. virtual void OnFrameDecoded(absl::string_view peer_name, const VideoFrame& frame, const DecoderStats& stats) {} // Will be called when frame will be obtained from PeerConnection stack. - // |peer_name| is name of the peer on which side frame was rendered. + // `peer_name` is name of the peer on which side frame was rendered. virtual void OnFrameRendered(absl::string_view peer_name, const VideoFrame& frame) {} // Will be called if encoder return not WEBRTC_VIDEO_CODEC_OK. // All available codes are listed in // modules/video_coding/include/video_error_codes.h - // |peer_name| is name of the peer on which side error acquired. + // `peer_name` is name of the peer on which side error acquired. virtual void OnEncoderError(absl::string_view peer_name, const VideoFrame& frame, int32_t error_code) {} // Will be called if decoder return not WEBRTC_VIDEO_CODEC_OK. // All available codes are listed in // modules/video_coding/include/video_error_codes.h - // |peer_name| is name of the peer on which side error acquired. + // `peer_name` is name of the peer on which side error acquired. virtual void OnDecoderError(absl::string_view peer_name, uint16_t frame_id, int32_t error_code) {} // Will be called every time new stats reports are available for the - // Peer Connection identified by |pc_label|. + // Peer Connection identified by `pc_label`. void OnStatsReports( absl::string_view pc_label, const rtc::scoped_refptr& report) override {} diff --git a/api/test/video_quality_test_fixture.h b/api/test/video_quality_test_fixture.h index 92c398aa54..08ae12b816 100644 --- a/api/test/video_quality_test_fixture.h +++ b/api/test/video_quality_test_fixture.h @@ -98,7 +98,7 @@ class VideoQualityTestFixtureInterface { InterLayerPredMode inter_layer_pred = InterLayerPredMode::kOn; // If empty, bitrates are generated in VP9Impl automatically. std::vector spatial_layers; - // If set, default parameters will be used instead of |streams|. + // If set, default parameters will be used instead of `streams`. bool infer_streams = false; } ss[2]; struct Logging { diff --git a/api/transport/bitrate_settings.h b/api/transport/bitrate_settings.h index b6c022dd11..562309a46c 100644 --- a/api/transport/bitrate_settings.h +++ b/api/transport/bitrate_settings.h @@ -18,7 +18,7 @@ namespace webrtc { -// Configuration of send bitrate. The |start_bitrate_bps| value is +// Configuration of send bitrate. The `start_bitrate_bps` value is // used for multiple purposes, both as a prior in the bandwidth // estimator, and for initial configuration of the encoder. We may // want to create separate apis for those, and use a smaller struct diff --git a/api/transport/data_channel_transport_interface.h b/api/transport/data_channel_transport_interface.h index 2b2f5d2e6d..52c852235b 100644 --- a/api/transport/data_channel_transport_interface.h +++ b/api/transport/data_channel_transport_interface.h @@ -48,14 +48,14 @@ struct SendDataParams { // retransmitted by the transport before it is dropped. // Setting this value to zero disables retransmission. // Valid values are in the range [0-UINT16_MAX]. - // |max_rtx_count| and |max_rtx_ms| may not be set simultaneously. + // `max_rtx_count` and `max_rtx_ms` may not be set simultaneously. absl::optional max_rtx_count; // If set, the maximum number of milliseconds for which the transport // may retransmit this message before it is dropped. // Setting this value to zero disables retransmission. // Valid values are in the range [0-UINT16_MAX]. - // |max_rtx_count| and |max_rtx_ms| may not be set simultaneously. + // `max_rtx_count` and `max_rtx_ms` may not be set simultaneously. absl::optional max_rtx_ms; }; @@ -96,18 +96,18 @@ class DataChannelTransportInterface { public: virtual ~DataChannelTransportInterface() = default; - // Opens a data |channel_id| for sending. May return an error if the - // specified |channel_id| is unusable. Must be called before |SendData|. + // Opens a data `channel_id` for sending. May return an error if the + // specified `channel_id` is unusable. Must be called before `SendData`. virtual RTCError OpenChannel(int channel_id) = 0; // Sends a data buffer to the remote endpoint using the given send parameters. - // |buffer| may not be larger than 256 KiB. Returns an error if the send + // `buffer` may not be larger than 256 KiB. Returns an error if the send // fails. virtual RTCError SendData(int channel_id, const SendDataParams& params, const rtc::CopyOnWriteBuffer& buffer) = 0; - // Closes |channel_id| gracefully. Returns an error if |channel_id| is not + // Closes `channel_id` gracefully. Returns an error if `channel_id` is not // open. Data sent after the closing procedure begins will not be // transmitted. The channel becomes closed after pending data is transmitted. virtual RTCError CloseChannel(int channel_id) = 0; diff --git a/api/transport/sctp_transport_factory_interface.h b/api/transport/sctp_transport_factory_interface.h index 912be3a374..4fc8af5bad 100644 --- a/api/transport/sctp_transport_factory_interface.h +++ b/api/transport/sctp_transport_factory_interface.h @@ -32,7 +32,7 @@ class SctpTransportFactoryInterface { public: virtual ~SctpTransportFactoryInterface() = default; - // Create an SCTP transport using |channel| for the underlying transport. + // Create an SCTP transport using `channel` for the underlying transport. virtual std::unique_ptr CreateSctpTransport( rtc::PacketTransportInternal* channel) = 0; }; diff --git a/api/transport/stun.h b/api/transport/stun.h index 682a17a945..32a8a433f5 100644 --- a/api/transport/stun.h +++ b/api/transport/stun.h @@ -254,11 +254,11 @@ class StunMessage { // This is used for testing. void SetStunMagicCookie(uint32_t val); - // Contruct a copy of |this|. + // Contruct a copy of `this`. std::unique_ptr Clone() const; - // Check if the attributes of this StunMessage equals those of |other| - // for all attributes that |attribute_type_mask| return true + // Check if the attributes of this StunMessage equals those of `other` + // for all attributes that `attribute_type_mask` return true bool EqualAttributes(const StunMessage* other, std::function attribute_type_mask) const; @@ -570,11 +570,11 @@ class StunUInt16ListAttribute : public StunAttribute { std::string StunMethodToString(int msg_type); // Returns the (successful) response type for the given request type. -// Returns -1 if |request_type| is not a valid request type. +// Returns -1 if `request_type` is not a valid request type. int GetStunSuccessResponseType(int request_type); // Returns the error response type for the given request type. -// Returns -1 if |request_type| is not a valid request type. +// Returns -1 if `request_type` is not a valid request type. int GetStunErrorResponseType(int request_type); // Returns whether a given message is a request type. @@ -595,13 +595,13 @@ bool ComputeStunCredentialHash(const std::string& username, const std::string& password, std::string* hash); -// Make a copy af |attribute| and return a new StunAttribute. +// Make a copy af `attribute` and return a new StunAttribute. // This is useful if you don't care about what kind of attribute you // are handling. // // The implementation copies by calling Write() followed by Read(). // -// If |tmp_buffer| is supplied this buffer will be used, otherwise +// If `tmp_buffer` is supplied this buffer will be used, otherwise // a buffer will created in the method. std::unique_ptr CopyStunAttribute( const StunAttribute& attribute, diff --git a/api/turn_customizer.h b/api/turn_customizer.h index f0bf0d9a35..50e406516e 100644 --- a/api/turn_customizer.h +++ b/api/turn_customizer.h @@ -29,7 +29,7 @@ class TurnCustomizer { cricket::StunMessage* message) = 0; // TURN can send data using channel data messages or Send indication. - // This method should return false if |data| should be sent using + // This method should return false if `data` should be sent using // a Send indication instead of a ChannelData message, even if a // channel is bound. virtual bool AllowChannelData(cricket::PortInterface* port, diff --git a/api/video/color_space.cc b/api/video/color_space.cc index 710bb432ab..a0cd32edb2 100644 --- a/api/video/color_space.cc +++ b/api/video/color_space.cc @@ -12,7 +12,7 @@ namespace webrtc { namespace { -// Try to convert |enum_value| into the enum class T. |enum_bitmask| is created +// Try to convert `enum_value` into the enum class T. `enum_bitmask` is created // by the funciton below. Returns true if conversion was successful, false // otherwise. template @@ -43,7 +43,7 @@ constexpr int MakeMask(const int index, const int length, T (&values)[N]) { } // Create a bitmask where each bit corresponds to one potential enum value. -// |values| should be an array listing all possible enum values. The bit is set +// `values` should be an array listing all possible enum values. The bit is set // to one if the corresponding enum exists. Only works for enums with values // less than 64. template diff --git a/api/video/encoded_frame.h b/api/video/encoded_frame.h index 5f046327fa..3ef26caf6e 100644 --- a/api/video/encoded_frame.h +++ b/api/video/encoded_frame.h @@ -46,7 +46,7 @@ class EncodedFrame : public webrtc::VCMEncodedFrame { int64_t Id() const { return id_; } // TODO(philipel): Add simple modify/access functions to prevent adding too - // many |references|. + // many `references`. size_t num_references = 0; int64_t references[kMaxFrameReferences]; // Is this subframe the last one in the superframe (In RTP stream that would diff --git a/api/video/encoded_image.h b/api/video/encoded_image.h index dae4e3a60a..987645b569 100644 --- a/api/video/encoded_image.h +++ b/api/video/encoded_image.h @@ -98,7 +98,7 @@ class RTC_EXPORT EncodedImage { } // These methods can be used to set/get size of subframe with spatial index - // |spatial_index| on encoded frames that consist of multiple spatial layers. + // `spatial_index` on encoded frames that consist of multiple spatial layers. absl::optional SpatialLayerFrameSize(int spatial_index) const; void SetSpatialLayerFrameSize(int spatial_index, size_t size_bytes); @@ -195,7 +195,7 @@ class RTC_EXPORT EncodedImage { // carries the webrtc::VideoFrame id field from the sender to the receiver. absl::optional video_frame_tracking_id_; // Information about packets used to assemble this video frame. This is needed - // by |SourceTracker| when the frame is delivered to the RTCRtpReceiver's + // by `SourceTracker` when the frame is delivered to the RTCRtpReceiver's // MediaStreamTrack, in order to implement getContributingSources(). See: // https://w3c.github.io/webrtc-pc/#dom-rtcrtpreceiver-getcontributingsources RtpPacketInfos packet_infos_; diff --git a/api/video/i010_buffer.h b/api/video/i010_buffer.h index 6299927231..776797521b 100644 --- a/api/video/i010_buffer.h +++ b/api/video/i010_buffer.h @@ -34,7 +34,7 @@ class I010Buffer : public I010BufferInterface { // Convert and put I420 buffer into a new buffer. static rtc::scoped_refptr Copy(const I420BufferInterface& buffer); - // Return a rotated copy of |src|. + // Return a rotated copy of `src`. static rtc::scoped_refptr Rotate(const I010BufferInterface& src, VideoRotation rotation); @@ -55,15 +55,15 @@ class I010Buffer : public I010BufferInterface { uint16_t* MutableDataU(); uint16_t* MutableDataV(); - // Scale the cropped area of |src| to the size of |this| buffer, and - // write the result into |this|. + // Scale the cropped area of `src` to the size of `this` buffer, and + // write the result into `this`. void CropAndScaleFrom(const I010BufferInterface& src, int offset_x, int offset_y, int crop_width, int crop_height); - // Scale all of |src| to the size of |this| buffer, with no cropping. + // Scale all of `src` to the size of `this` buffer, with no cropping. void ScaleFrom(const I010BufferInterface& src); // Pastes whole picture to canvas at (offset_row, offset_col). diff --git a/api/video/i420_buffer.h b/api/video/i420_buffer.h index 251eb93d30..b60df09aba 100644 --- a/api/video/i420_buffer.h +++ b/api/video/i420_buffer.h @@ -49,7 +49,7 @@ class RTC_EXPORT I420Buffer : public I420BufferInterface { const uint8_t* data_v, int stride_v); - // Returns a rotated copy of |src|. + // Returns a rotated copy of `src`. static rtc::scoped_refptr Rotate(const I420BufferInterface& src, VideoRotation rotation); // Deprecated. @@ -83,8 +83,8 @@ class RTC_EXPORT I420Buffer : public I420BufferInterface { uint8_t* MutableDataU(); uint8_t* MutableDataV(); - // Scale the cropped area of |src| to the size of |this| buffer, and - // write the result into |this|. + // Scale the cropped area of `src` to the size of `this` buffer, and + // write the result into `this`. void CropAndScaleFrom(const I420BufferInterface& src, int offset_x, int offset_y, @@ -95,7 +95,7 @@ class RTC_EXPORT I420Buffer : public I420BufferInterface { // aspect ratio without distorting the image. void CropAndScaleFrom(const I420BufferInterface& src); - // Scale all of |src| to the size of |this| buffer, with no cropping. + // Scale all of `src` to the size of `this` buffer, with no cropping. void ScaleFrom(const I420BufferInterface& src); // Pastes whole picture to canvas at (offset_row, offset_col). diff --git a/api/video/nv12_buffer.h b/api/video/nv12_buffer.h index cb989e84b0..7baef2aeba 100644 --- a/api/video/nv12_buffer.h +++ b/api/video/nv12_buffer.h @@ -56,8 +56,8 @@ class RTC_EXPORT NV12Buffer : public NV12BufferInterface { // are resolved in a better way. Or in the mean time, use SetBlack. void InitializeData(); - // Scale the cropped area of |src| to the size of |this| buffer, and - // write the result into |this|. + // Scale the cropped area of `src` to the size of `this` buffer, and + // write the result into `this`. void CropAndScaleFrom(const NV12BufferInterface& src, int offset_x, int offset_y, diff --git a/api/video/video_bitrate_allocation.h b/api/video/video_bitrate_allocation.h index 56c0f64da3..4feffa2e66 100644 --- a/api/video/video_bitrate_allocation.h +++ b/api/video/video_bitrate_allocation.h @@ -50,8 +50,8 @@ class RTC_EXPORT VideoBitrateAllocation { // Get the sum of all the temporal layer for a specific spatial layer. uint32_t GetSpatialLayerSum(size_t spatial_index) const; - // Sum of bitrates of temporal layers, from layer 0 to |temporal_index| - // inclusive, of specified spatial layer |spatial_index|. Bitrates of lower + // Sum of bitrates of temporal layers, from layer 0 to `temporal_index` + // inclusive, of specified spatial layer `spatial_index`. Bitrates of lower // spatial layers are not included. uint32_t GetTemporalLayerSum(size_t spatial_index, size_t temporal_index) const; diff --git a/api/video/video_frame.h b/api/video/video_frame.h index e073fd5e42..512055d770 100644 --- a/api/video/video_frame.h +++ b/api/video/video_frame.h @@ -272,7 +272,7 @@ class RTC_EXPORT VideoFrame { // update_rect() will return a rectangle corresponding to the entire frame. absl::optional update_rect_; // Information about packets used to assemble this video frame. This is needed - // by |SourceTracker| when the frame is delivered to the RTCRtpReceiver's + // by `SourceTracker` when the frame is delivered to the RTCRtpReceiver's // MediaStreamTrack, in order to implement getContributingSources(). See: // https://w3c.github.io/webrtc-pc/#dom-rtcrtpreceiver-getcontributingsources RtpPacketInfos packet_infos_; diff --git a/api/video/video_frame_buffer.h b/api/video/video_frame_buffer.h index 3e41a9b2ca..3e12c75a45 100644 --- a/api/video/video_frame_buffer.h +++ b/api/video/video_frame_buffer.h @@ -84,8 +84,8 @@ class RTC_EXPORT VideoFrameBuffer : public rtc::RefCountInterface { // A format specific scale function. Default implementation works by // converting to I420. But more efficient implementations may override it, // especially for kNative. - // First, the image is cropped to |crop_width| and |crop_height| and then - // scaled to |scaled_width| and |scaled_height|. + // First, the image is cropped to `crop_width` and `crop_height` and then + // scaled to `scaled_width` and `scaled_height`. virtual rtc::scoped_refptr CropAndScale(int offset_x, int offset_y, int crop_width, diff --git a/api/video/video_source_interface.h b/api/video/video_source_interface.h index 8b5823fc27..d66a235da0 100644 --- a/api/video/video_source_interface.h +++ b/api/video/video_source_interface.h @@ -54,7 +54,7 @@ struct RTC_EXPORT VideoSinkWants { int max_framerate_fps = std::numeric_limits::max(); // Tells the source that the sink wants width and height of the video frames - // to be divisible by |resolution_alignment|. + // to be divisible by `resolution_alignment`. // For example: With I420, this value would be a multiple of 2. // Note that this field is unrelated to any horizontal or vertical stride // requirements the encoder has on the incoming video frame buffers. @@ -71,13 +71,13 @@ struct RTC_EXPORT VideoSinkWants { // to scaleResolutionDownBy or turning off simulcast or SVC layers. // // For example, we may capture at 720p and due to adaptation (e.g. applying - // |max_pixel_count| constraints) create webrtc::VideoFrames of size 480p, but + // `max_pixel_count` constraints) create webrtc::VideoFrames of size 480p, but // if we do scaleResolutionDownBy:2 then the only resolution we end up // encoding is 240p. In this case we still need to provide webrtc::VideoFrames // of size 480p but we can optimize internal buffers for 240p, avoiding // downsampling to 480p if possible. // - // Note that the |resolutions| can change while frames are in flight and + // Note that the `resolutions` can change while frames are in flight and // should only be used as a hint when constructing the webrtc::VideoFrame. std::vector resolutions; }; diff --git a/api/video/video_stream_decoder_create.h b/api/video/video_stream_decoder_create.h index 4958dc1084..9c898ec610 100644 --- a/api/video/video_stream_decoder_create.h +++ b/api/video/video_stream_decoder_create.h @@ -20,7 +20,7 @@ #include "api/video_codecs/sdp_video_format.h" namespace webrtc { -// The |decoder_settings| parameter is a map between: +// The `decoder_settings` parameter is a map between: // --> <