From f8c03702c6ee067a1eecf9412f1628c13f51103f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Terelius?= Date: Wed, 8 Jan 2025 17:53:06 +0100 Subject: [PATCH] Fix some clang-tidy issues in call/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: None Change-Id: I4bc6425e33324e48cadb27a5d1bb6261221a07a3 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/373905 Reviewed-by: Danil Chapovalov Commit-Queue: Björn Terelius Cr-Commit-Position: refs/heads/main@{#43694} --- call/flexfec_receive_stream_unittest.cc | 1 - call/payload_type_picker.cc | 6 +++--- call/rtp_payload_params.cc | 6 +++--- call/rtp_payload_params_unittest.cc | 1 + call/rtp_video_sender_unittest.cc | 4 ++-- call/rtx_receive_stream_unittest.cc | 1 - 6 files changed, 9 insertions(+), 10 deletions(-) diff --git a/call/flexfec_receive_stream_unittest.cc b/call/flexfec_receive_stream_unittest.cc index b0a3420b6f..e155e7f94b 100644 --- a/call/flexfec_receive_stream_unittest.cc +++ b/call/flexfec_receive_stream_unittest.cc @@ -33,7 +33,6 @@ namespace webrtc { namespace { -using ::testing::_; using ::testing::Eq; using ::testing::Property; diff --git a/call/payload_type_picker.cc b/call/payload_type_picker.cc index d26abb754d..eb8ed45762 100644 --- a/call/payload_type_picker.cc +++ b/call/payload_type_picker.cc @@ -179,7 +179,7 @@ PayloadTypePicker::PayloadTypePicker() { {{cricket::kDtmfCodecName, 32000, 1}, 112}, {{cricket::kDtmfCodecName, 16000, 1}, 113}, {{cricket::kDtmfCodecName, 8000, 1}, 126}}; - for (auto entry : default_audio_mappings) { + for (const MapTableEntry& entry : default_audio_mappings) { AddMapping(PayloadType(entry.payload_type), cricket::CreateAudioCodec(entry.format)); } @@ -198,7 +198,7 @@ RTCErrorOr PayloadTypePicker::SuggestMapping( } // The first matching entry is returned, unless excluder // maps it to something different. - for (auto entry : entries_) { + for (const MapEntry& entry : entries_) { if (MatchesWithReferenceAttributes(entry.codec(), codec)) { if (excluder) { auto result = excluder->LookupCodec(entry.payload_type()); @@ -223,7 +223,7 @@ RTCError PayloadTypePicker::AddMapping(PayloadType payload_type, cricket::Codec codec) { // Completely duplicate mappings are ignored. // Multiple mappings for the same codec and the same PT are legal; - for (auto entry : entries_) { + for (const MapEntry& entry : entries_) { if (payload_type == entry.payload_type() && MatchesWithReferenceAttributes(codec, entry.codec())) { return RTCError::OK(); diff --git a/call/rtp_payload_params.cc b/call/rtp_payload_params.cc index ffe62eb40a..a2245e8931 100644 --- a/call/rtp_payload_params.cc +++ b/call/rtp_payload_params.cc @@ -381,16 +381,16 @@ std::optional RtpPayloadParams::GenericStructure( case VideoCodecType::kVideoCodecGeneric: if (simulate_generic_structure_) { return MinimalisticStructure(/*num_spatial_layers=*/1, - /*num_temporal_layer=*/1); + /*num_temporal_layers=*/1); } return std::nullopt; case VideoCodecType::kVideoCodecVP8: return MinimalisticStructure(/*num_spatial_layers=*/1, - /*num_temporal_layer=*/kMaxTemporalStreams); + /*num_temporal_layers=*/kMaxTemporalStreams); case VideoCodecType::kVideoCodecVP9: { std::optional structure = MinimalisticStructure( /*num_spatial_layers=*/kMaxSimulatedSpatialLayers, - /*num_temporal_layer=*/kMaxTemporalStreams); + /*num_temporal_layers=*/kMaxTemporalStreams); const CodecSpecificInfoVP9& vp9 = codec_specific_info->codecSpecific.VP9; if (vp9.ss_data_available && vp9.spatial_layer_resolution_present) { RenderResolution first_valid; diff --git a/call/rtp_payload_params_unittest.cc b/call/rtp_payload_params_unittest.cc index 1d16bb601b..9299515abe 100644 --- a/call/rtp_payload_params_unittest.cc +++ b/call/rtp_payload_params_unittest.cc @@ -14,6 +14,7 @@ #include #include #include +#include #include "absl/container/inlined_vector.h" #include "absl/types/variant.h" diff --git a/call/rtp_video_sender_unittest.cc b/call/rtp_video_sender_unittest.cc index 26e36e6567..936f2937a1 100644 --- a/call/rtp_video_sender_unittest.cc +++ b/call/rtp_video_sender_unittest.cc @@ -1343,7 +1343,7 @@ TEST(RtpVideoSenderTest, ClearsPendingPacketsOnInactivation) { // Set a very low bitrate. test.router()->OnBitrateUpdated( - CreateBitrateAllocationUpdate(/*rate_bps=*/10'000), + CreateBitrateAllocationUpdate(/*target_bitrate_bps=*/10'000), /*framerate=*/30); // Create and send a large keyframe. @@ -1421,7 +1421,7 @@ TEST(RtpVideoSenderTest, // Set a very low bitrate. test.router()->OnBitrateUpdated( - CreateBitrateAllocationUpdate(/*rate_bps=*/10'000), + CreateBitrateAllocationUpdate(/*target_bitrate_bps=*/10'000), /*framerate=*/30); // Create and send a large keyframe. diff --git a/call/rtx_receive_stream_unittest.cc b/call/rtx_receive_stream_unittest.cc index e6aee48be4..6a2d055639 100644 --- a/call/rtx_receive_stream_unittest.cc +++ b/call/rtx_receive_stream_unittest.cc @@ -30,7 +30,6 @@ namespace webrtc { namespace { -using ::testing::_; using ::testing::Property; using ::testing::StrictMock;