From 17b050f8f833580c99178b374e44d8688925f59f Mon Sep 17 00:00:00 2001 From: Benjamin Wright Date: Wed, 13 Mar 2019 17:35:46 -0700 Subject: [PATCH] Fixes ClangTidy errors in audio/ These are manual edits please verify there are no typos. Feel free to auto-submit if there are no issues. Bug: webrtc:10410 Change-Id: I1b46653b91bce012afabfa0f2d249718e6de2df8 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/127626 Reviewed-by: Fredrik Solenberg Commit-Queue: Benjamin Wright Cr-Commit-Position: refs/heads/master@{#27139} --- audio/audio_receive_stream_unittest.cc | 6 +++--- audio/audio_transport_impl.cc | 4 ++-- audio/channel_send.cc | 11 +++++------ audio/test/media_transport_test.cc | 4 +--- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/audio/audio_receive_stream_unittest.cc b/audio/audio_receive_stream_unittest.cc index 76ebeae4d4..def4d1ae7e 100644 --- a/audio/audio_receive_stream_unittest.cc +++ b/audio/audio_receive_stream_unittest.cc @@ -36,7 +36,6 @@ namespace { using testing::_; using testing::FloatEq; using testing::Return; -using testing::ReturnRef; AudioDecodingCallStats MakeAudioDecodeStatsForTest() { AudioDecodingCallStats audio_decode_stats; @@ -64,8 +63,9 @@ const double kTotalOutputDuration = 0.5; const CallReceiveStatistics kCallStats = {345, 678, 901, 234, -12, 567, 890, 123}; -const std::pair kReceiveCodec = - {123, {"codec_name_recv", 96000, 0}}; +const std::pair kReceiveCodec = { + 123, + {"codec_name_recv", 96000, 0}}; const NetworkStatistics kNetworkStats = { 123, 456, false, 789012, 3456, 123, 456, 789, 0, {}, 789, 12, 345, 678, 901, 0, -1, -1, -1, -1, -1, 0}; diff --git a/audio/audio_transport_impl.cc b/audio/audio_transport_impl.cc index cdbdacd8da..2e6ff52108 100644 --- a/audio/audio_transport_impl.cc +++ b/audio/audio_transport_impl.cc @@ -144,7 +144,7 @@ int32_t AudioTransportImpl::RecordedDataIsAvailable( // Measure audio level of speech after all processing. double sample_duration = static_cast(number_of_frames) / sample_rate; - audio_level_.ComputeLevel(*audio_frame.get(), sample_duration); + audio_level_.ComputeLevel(*audio_frame, sample_duration); // Copy frame and push to each sending stream. The copy is required since an // encoding task will be posted internally to each stream. @@ -157,7 +157,7 @@ int32_t AudioTransportImpl::RecordedDataIsAvailable( auto it = sending_streams_.begin(); while (++it != sending_streams_.end()) { std::unique_ptr audio_frame_copy(new AudioFrame()); - audio_frame_copy->CopyFrom(*audio_frame.get()); + audio_frame_copy->CopyFrom(*audio_frame); (*it)->SendAudioData(std::move(audio_frame_copy)); } // Send the original frame to the first stream w/o copying. diff --git a/audio/channel_send.cc b/audio/channel_send.cc index 9f95ebb90b..5ca6f6a975 100644 --- a/audio/channel_send.cc +++ b/audio/channel_send.cc @@ -76,11 +76,10 @@ class TransportFeedbackProxy; class TransportSequenceNumberProxy; class VoERtcpObserver; -class ChannelSend - : public ChannelSendInterface, - public AudioPacketizationCallback, // receive encoded packets from the - // ACM - public TargetTransferRateObserver { +class ChannelSend : public ChannelSendInterface, + public AudioPacketizationCallback, // receive encoded + // packets from the ACM + public TargetTransferRateObserver { public: // TODO(nisse): Make OnUplinkPacketLossRate public, and delete friend // declaration. @@ -603,7 +602,7 @@ int32_t ChannelSend::SendMediaTransportAudio( // Sample count isn't conveniently available from the AudioCodingModule, // and needs some refactoring to wire up in a good way. For now, left as // zero. - /*sample_count=*/0, + /*samples_per_channel=*/0, /*sequence_number=*/media_transport_sequence_number_, MediaTransportFrameTypeForWebrtcFrameType(frameType), payloadType, diff --git a/audio/test/media_transport_test.cc b/audio/test/media_transport_test.cc index b9a084db14..e07b79e8b6 100644 --- a/audio/test/media_transport_test.cc +++ b/audio/test/media_transport_test.cc @@ -34,9 +34,7 @@ namespace webrtc { namespace test { namespace { -using testing::_; using testing::NiceMock; -using testing::Return; constexpr int kPayloadTypeOpus = 17; constexpr int kSamplingFrequency = 48000; @@ -113,7 +111,7 @@ TEST(AudioWithMediaTransport, DeliversAudio) { webrtc::internal::AudioReceiveStream receive_stream( Clock::GetRealTimeClock(), - /*rtp_stream_receiver_controller=*/nullptr, + /*receiver_controller=*/nullptr, /*packet_router=*/nullptr, receive_process_thread.get(), receive_config, audio_state, null_event_log.get());