diff --git a/media/engine/webrtcvideoengine_unittest.cc b/media/engine/webrtcvideoengine_unittest.cc index 7b1eb4a583..2f3a2d2060 100644 --- a/media/engine/webrtcvideoengine_unittest.cc +++ b/media/engine/webrtcvideoengine_unittest.cc @@ -183,7 +183,7 @@ class WebRtcVideoEngineTest : public ::testing::Test { protected: // Find the index of the codec in the engine with the given name. The codec // must be present. - int GetEngineCodecIndex(const std::string& name) const; + size_t GetEngineCodecIndex(const std::string& name) const; // Find the codec in the engine with the given name. The codec must be // present. @@ -569,7 +569,8 @@ TEST_F(WebRtcVideoEngineTest, PropagatesInputFrameTimestamp) { EXPECT_TRUE(channel->RemoveSendStream(kSsrc)); } -int WebRtcVideoEngineTest::GetEngineCodecIndex(const std::string& name) const { +size_t WebRtcVideoEngineTest::GetEngineCodecIndex( + const std::string& name) const { const std::vector codecs = engine_.codecs(); for (size_t i = 0; i < codecs.size(); ++i) { const cricket::VideoCodec engine_codec = codecs[i]; @@ -812,8 +813,8 @@ TEST_F(WebRtcVideoEngineTest, ReportSupportedExternalCodecs) { encoder_factory_->AddSupportedVideoCodecType(kFakeExternalCodecName); // The external codec should appear after the internal codec in the vector. - const int vp8_index = GetEngineCodecIndex("VP8"); - const int fake_external_codec_index = + const size_t vp8_index = GetEngineCodecIndex("VP8"); + const size_t fake_external_codec_index = GetEngineCodecIndex(kFakeExternalCodecName); EXPECT_LT(vp8_index, fake_external_codec_index); } @@ -836,8 +837,8 @@ TEST_F(WebRtcVideoEngineTest, ReportSupportedExternalCodecsWithAddedCodec) { // Check that both fake codecs are present and that the second fake codec // appears after the first fake codec. - const int fake_codec_index1 = GetEngineCodecIndex(kFakeExternalCodecName1); - const int fake_codec_index2 = GetEngineCodecIndex(kFakeExternalCodecName2); + const size_t fake_codec_index1 = GetEngineCodecIndex(kFakeExternalCodecName1); + const size_t fake_codec_index2 = GetEngineCodecIndex(kFakeExternalCodecName2); EXPECT_LT(fake_codec_index1, fake_codec_index2); } diff --git a/modules/congestion_controller/acknowledged_bitrate_estimator.cc b/modules/congestion_controller/acknowledged_bitrate_estimator.cc index c0161ea0d9..1e75ee6e92 100644 --- a/modules/congestion_controller/acknowledged_bitrate_estimator.cc +++ b/modules/congestion_controller/acknowledged_bitrate_estimator.cc @@ -13,6 +13,7 @@ #include #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" +#include "rtc_base/numerics/safe_conversions.h" #include "rtc_base/ptr_util.h" namespace webrtc { @@ -38,7 +39,8 @@ void AcknowledgedBitrateEstimator::IncomingPacketFeedbackVector( for (const auto& packet : packet_feedback_vector) { if (IsInSendTimeHistory(packet)) { MaybeExpectFastRateChange(packet.send_time_ms); - bitrate_estimator_->Update(packet.arrival_time_ms, packet.payload_size); + bitrate_estimator_->Update(packet.arrival_time_ms, + rtc::dchecked_cast(packet.payload_size)); } } } diff --git a/modules/congestion_controller/probe_bitrate_estimator.cc b/modules/congestion_controller/probe_bitrate_estimator.cc index 1a438829b1..8c754d789c 100644 --- a/modules/congestion_controller/probe_bitrate_estimator.cc +++ b/modules/congestion_controller/probe_bitrate_estimator.cc @@ -17,6 +17,7 @@ #include "logging/rtc_event_log/rtc_event_log.h" #include "rtc_base/checks.h" #include "rtc_base/logging.h" +#include "rtc_base/numerics/safe_conversions.h" #include "rtc_base/ptr_util.h" namespace { @@ -65,7 +66,8 @@ int ProbeBitrateEstimator::HandleProbeAndEstimateBitrate( EraseOldClusters(packet_feedback.arrival_time_ms - kMaxClusterHistoryMs); - int payload_size_bits = packet_feedback.payload_size * 8; + int payload_size_bits = rtc::dchecked_cast( + packet_feedback.payload_size * 8); AggregatedCluster* cluster = &clusters_[cluster_id]; if (packet_feedback.send_time_ms < cluster->first_send_ms) { diff --git a/modules/congestion_controller/send_side_congestion_controller.cc b/modules/congestion_controller/send_side_congestion_controller.cc index ccca692712..2aeed51a01 100644 --- a/modules/congestion_controller/send_side_congestion_controller.cc +++ b/modules/congestion_controller/send_side_congestion_controller.cc @@ -22,6 +22,7 @@ #include "rtc_base/checks.h" #include "rtc_base/format_macros.h" #include "rtc_base/logging.h" +#include "rtc_base/numerics/safe_conversions.h" #include "rtc_base/ptr_util.h" #include "rtc_base/rate_limiter.h" #include "rtc_base/socket.h" @@ -258,7 +259,7 @@ void SendSideCongestionController::SignalNetworkState(NetworkState state) { void SendSideCongestionController::SetTransportOverhead( size_t transport_overhead_bytes_per_packet) { transport_feedback_adapter_.SetTransportOverhead( - transport_overhead_bytes_per_packet); + rtc::dchecked_cast(transport_overhead_bytes_per_packet)); } void SendSideCongestionController::OnSentPacket( diff --git a/p2p/base/relayserver.cc b/p2p/base/relayserver.cc index a147904467..9bb53ad45a 100644 --- a/p2p/base/relayserver.cc +++ b/p2p/base/relayserver.cc @@ -21,6 +21,7 @@ #include "rtc_base/checks.h" #include "rtc_base/helpers.h" #include "rtc_base/logging.h" +#include "rtc_base/numerics/safe_conversions.h" #include "rtc_base/socketadapters.h" namespace cricket { @@ -429,7 +430,8 @@ void RelayServer::HandleStunAllocate( response.AddAttribute(std::move(magic_cookie_attr)); RTC_DCHECK_GT(external_sockets_.size(), 0); - size_t index = random_.Rand(external_sockets_.size() - 1); + size_t index = random_.Rand(rtc::dchecked_cast( + external_sockets_.size() - 1)); rtc::SocketAddress ext_addr = external_sockets_[index]->GetLocalAddress(); diff --git a/tools_webrtc/mb/mb_config.pyl b/tools_webrtc/mb/mb_config.pyl index 4ee4d5cf15..0231874472 100644 --- a/tools_webrtc/mb/mb_config.pyl +++ b/tools_webrtc/mb/mb_config.pyl @@ -64,17 +64,18 @@ 'Android32 Builder MIPS (dbg)': 'android_debug_static_bot_mipsel', # Windows - 'Win32 Debug': 'debug_bot_x86', - 'Win32 Release': 'release_bot_x86', - 'Win64 Debug': 'debug_bot_x64', - 'Win64 Release': 'release_bot_x64', + 'Win32 Debug': 'win_msvc_debug_bot_x86', + 'Win32 Release': 'win_msvc_release_bot_x86', + 'Win64 Debug': 'win_msvc_debug_bot_x64', + 'Win64 Release': 'win_msvc_release_bot_x64', 'Win32 Debug (Clang)': 'win_clang_debug_bot_x86', 'Win32 Release (Clang)': 'win_clang_release_bot_x86', 'Win64 Debug (Clang)': 'win_clang_debug_bot_x64', 'Win64 Release (Clang)': 'win_clang_release_bot_x64', 'Win32 ASan': 'win_asan_clang_release_bot_x86', - 'Win32 Release (MSVC)': 'win_msvc_release_bot_x86', 'Win32 Release [large tests]': 'release_bot_x86', + # TODO(bugs.webrtc.org/757293): remove this duplicate: + 'Win32 Release (MSVC)': 'win_msvc_release_bot_x86', }, 'client.webrtc.branches': { # iOS @@ -200,20 +201,21 @@ 'win_compile_rel': 'release_bot_x86', 'win_compile_x64_dbg': 'debug_bot_x64', 'win_compile_x64_rel': 'release_bot_x64', - 'win_dbg': 'debug_bot_x86', - 'win_rel': 'release_bot_x86', - 'win_x64_dbg': 'debug_bot_x64', - 'win_x64_rel': 'release_bot_x64', + 'win_dbg': 'win_msvc_debug_bot_x86', + 'win_rel': 'win_msvc_release_bot_x86', + 'win_x64_dbg': 'win_msvc_debug_bot_x64', + 'win_x64_rel': 'win_msvc_release_bot_x64', 'win_clang_dbg': 'win_clang_debug_bot_x86', 'win_clang_rel': 'win_clang_release_bot_x86', 'win_x64_clang_dbg': 'win_clang_debug_bot_x64', 'win_x64_clang_rel': 'win_clang_release_bot_x64', 'win_asan': 'win_asan_clang_release_bot_x86', - 'win_msvc_rel': 'win_msvc_release_bot_x86', 'win_baremetal': 'release_bot_x86', 'win_experimental': 'release_bot_x86', 'win_x64_win8': 'debug_bot_x64', 'win_x64_win10': 'debug_bot_x64', + # TODO(bugs.webrtc.org/757293): remove this duplicate: + 'win_msvc_rel': 'win_msvc_release_bot_x86', } }, @@ -304,9 +306,18 @@ 'win_clang_release_bot_x64': [ 'gn', 'clang', 'openh264_release_bot', 'x64', ], + 'win_msvc_debug_bot_x86': [ + 'gn', 'no_clang', 'openh264_debug_bot', 'x86', + ], 'win_msvc_release_bot_x86': [ 'gn', 'no_clang', 'openh264_release_bot', 'x86', ], + 'win_msvc_debug_bot_x64': [ + 'gn', 'no_clang', 'openh264_debug_bot', 'x64', + ], + 'win_msvc_release_bot_x64': [ + 'gn', 'no_clang', 'openh264_release_bot', 'x64', + ], 'win_asan_clang_release_bot_x86': [ 'gn', 'asan', 'clang', 'full_symbols', 'openh264_release_bot', 'x86', 'win_fastlink', @@ -378,6 +389,7 @@ 'gn_args': 'is_asan=true', }, + # is_clang=true by default, this is only to guard from upstream changes. 'clang': { 'gn_args': 'is_clang=true', }, diff --git a/video/picture_id_tests.cc b/video/picture_id_tests.cc index 22d1818db2..482f48823c 100644 --- a/video/picture_id_tests.cc +++ b/video/picture_id_tests.cc @@ -11,6 +11,7 @@ #include "media/engine/simulcast_encoder_adapter.h" #include "modules/rtp_rtcp/source/rtp_format.h" #include "modules/video_coding/codecs/vp9/include/vp9.h" +#include "rtc_base/numerics/safe_conversions.h" #include "rtc_base/numerics/sequence_number_util.h" #include "test/call_test.h" #include "test/field_trial.h" @@ -277,8 +278,8 @@ class VideoStreamFactory // Use the same total bitrates when sending a single stream to avoid // lowering the bitrate estimate and requiring a subsequent rampup. - const int encoder_stream_bps = - kEncoderBitrateBps / encoder_config.number_of_streams; + const int encoder_stream_bps = kEncoderBitrateBps / rtc::checked_cast( + encoder_config.number_of_streams); for (size_t i = 0; i < encoder_config.number_of_streams; ++i) { streams[i].min_bitrate_bps = encoder_stream_bps;