Reformat the WebRTC code base
Running clang-format with chromium's style guide.
The goal is n-fold:
* providing consistency and readability (that's what code guidelines are for)
* preventing noise with presubmit checks and git cl format
* building on the previous point: making it easier to automatically fix format issues
* you name it
Please consider using git-hyper-blame to ignore this commit.
Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
diff --git a/audio/audio_level.cc b/audio/audio_level.cc
index f1c5b68..3b8df97 100644
--- a/audio/audio_level.cc
+++ b/audio/audio_level.cc
@@ -47,10 +47,12 @@
void AudioLevel::ComputeLevel(const AudioFrame& audioFrame, double duration) {
// Check speech level (works for 2 channels as well)
- int16_t abs_value = audioFrame.muted() ? 0 :
- WebRtcSpl_MaxAbsValueW16(
- audioFrame.data(),
- audioFrame.samples_per_channel_ * audioFrame.num_channels_);
+ int16_t abs_value =
+ audioFrame.muted()
+ ? 0
+ : WebRtcSpl_MaxAbsValueW16(
+ audioFrame.data(),
+ audioFrame.samples_per_channel_ * audioFrame.num_channels_);
// Protect member access using a lock since this method is called on a
// dedicated audio thread in the RecordedDataIsAvailable() callback.
diff --git a/audio/audio_receive_stream.cc b/audio/audio_receive_stream.cc
index b52563b..6f43576 100644
--- a/audio/audio_receive_stream.cc
+++ b/audio/audio_receive_stream.cc
@@ -102,8 +102,7 @@
const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
webrtc::RtcEventLog* event_log,
std::unique_ptr<voe::ChannelProxy> channel_proxy)
- : audio_state_(audio_state),
- channel_proxy_(std::move(channel_proxy)) {
+ : audio_state_(audio_state), channel_proxy_(std::move(channel_proxy)) {
RTC_LOG(LS_INFO) << "AudioReceiveStream: " << config.rtp.remote_ssrc;
RTC_DCHECK(receiver_controller);
RTC_DCHECK(packet_router);
@@ -120,9 +119,8 @@
channel_proxy_->RegisterReceiverCongestionControlObjects(packet_router);
// Register with transport.
- rtp_stream_receiver_ =
- receiver_controller->CreateReceiver(config.rtp.remote_ssrc,
- channel_proxy_.get());
+ rtp_stream_receiver_ = receiver_controller->CreateReceiver(
+ config.rtp.remote_ssrc, channel_proxy_.get());
ConfigureStream(this, config, true);
}
@@ -273,9 +271,7 @@
return absl::nullopt;
}
if (rtp_rtcp->RemoteNTP(&info.capture_time_ntp_secs,
- &info.capture_time_ntp_frac,
- nullptr,
- nullptr,
+ &info.capture_time_ntp_frac, nullptr, nullptr,
&info.capture_time_source_clock) != 0) {
return absl::nullopt;
}
@@ -329,8 +325,8 @@
return config_;
}
-const AudioSendStream*
- AudioReceiveStream::GetAssociatedSendStreamForTesting() const {
+const AudioSendStream* AudioReceiveStream::GetAssociatedSendStreamForTesting()
+ const {
RTC_DCHECK_RUN_ON(&worker_thread_checker_);
return associated_send_stream_;
}
diff --git a/audio/audio_receive_stream_unittest.cc b/audio/audio_receive_stream_unittest.cc
index 07a23e3..51635f6 100644
--- a/audio/audio_receive_stream_unittest.cc
+++ b/audio/audio_receive_stream_unittest.cc
@@ -59,18 +59,16 @@
const double kTotalOutputEnergy = 0.25;
const double kTotalOutputDuration = 0.5;
-const CallStatistics kCallStats = {
- 345, 678, 901, 234, -12, 3456, 7890, 567, 890, 123};
-const CodecInst kCodecInst = {
- 123, "codec_name_recv", 96000, -187, 0, -103};
+const CallStatistics kCallStats = {345, 678, 901, 234, -12,
+ 3456, 7890, 567, 890, 123};
+const CodecInst kCodecInst = {123, "codec_name_recv", 96000, -187, 0, -103};
const NetworkStatistics kNetworkStats = {
123, 456, false, 789012, 3456, 123, 456, 0, {}, 789, 12,
345, 678, 901, 0, -1, -1, -1, -1, -1, 0};
const AudioDecodingCallStats kAudioDecodeStats = MakeAudioDecodeStatsForTest();
struct ConfigHelper {
- ConfigHelper()
- : ConfigHelper(new rtc::RefCountedObject<MockAudioMixer>()) {}
+ ConfigHelper() : ConfigHelper(new rtc::RefCountedObject<MockAudioMixer>()) {}
explicit ConfigHelper(rtc::scoped_refptr<MockAudioMixer> audio_mixer)
: audio_mixer_(audio_mixer) {
@@ -88,23 +86,21 @@
EXPECT_CALL(*channel_proxy_, SetRemoteSSRC(kRemoteSsrc)).Times(1);
EXPECT_CALL(*channel_proxy_, SetNACKStatus(true, 15)).Times(1);
EXPECT_CALL(*channel_proxy_,
- RegisterReceiverCongestionControlObjects(&packet_router_))
- .Times(1);
+ RegisterReceiverCongestionControlObjects(&packet_router_))
+ .Times(1);
EXPECT_CALL(*channel_proxy_, ResetReceiverCongestionControlObjects())
.Times(1);
EXPECT_CALL(*channel_proxy_, RegisterTransport(nullptr)).Times(2);
testing::Expectation expect_set =
- EXPECT_CALL(*channel_proxy_, SetRtcEventLog(&event_log_))
- .Times(1);
+ EXPECT_CALL(*channel_proxy_, SetRtcEventLog(&event_log_)).Times(1);
EXPECT_CALL(*channel_proxy_, SetRtcEventLog(testing::IsNull()))
.Times(1)
.After(expect_set);
EXPECT_CALL(*channel_proxy_, DisassociateSendChannel()).Times(1);
EXPECT_CALL(*channel_proxy_, SetReceiveCodecs(_))
- .WillRepeatedly(
- Invoke([](const std::map<int, SdpAudioFormat>& codecs) {
- EXPECT_THAT(codecs, testing::IsEmpty());
- }));
+ .WillRepeatedly(Invoke([](const std::map<int, SdpAudioFormat>& codecs) {
+ EXPECT_THAT(codecs, testing::IsEmpty());
+ }));
stream_config_.rtp.local_ssrc = kLocalSsrc;
stream_config_.rtp.remote_ssrc = kRemoteSsrc;
@@ -120,11 +116,8 @@
std::unique_ptr<internal::AudioReceiveStream> CreateAudioReceiveStream() {
return std::unique_ptr<internal::AudioReceiveStream>(
new internal::AudioReceiveStream(
- &rtp_stream_receiver_controller_,
- &packet_router_,
- stream_config_,
- audio_state_,
- &event_log_,
+ &rtp_stream_receiver_controller_, &packet_router_, stream_config_,
+ audio_state_, &event_log_,
std::unique_ptr<voe::ChannelProxy>(channel_proxy_)));
}
@@ -323,7 +316,7 @@
ConfigHelper helper;
auto recv_stream = helper.CreateAudioReceiveStream();
EXPECT_CALL(*helper.channel_proxy(),
- SetChannelOutputVolumeScaling(FloatEq(0.765f)));
+ SetChannelOutputVolumeScaling(FloatEq(0.765f)));
recv_stream->SetGain(0.765f);
}
@@ -371,10 +364,10 @@
new_config.rtp.nack.rtp_history_ms = 300 + 20;
new_config.rtp.extensions.clear();
new_config.rtp.extensions.push_back(
- RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId + 1));
- new_config.rtp.extensions.push_back(RtpExtension(
- RtpExtension::kTransportSequenceNumberUri,
- kTransportSequenceNumberId + 1));
+ RtpExtension(RtpExtension::kAudioLevelUri, kAudioLevelId + 1));
+ new_config.rtp.extensions.push_back(
+ RtpExtension(RtpExtension::kTransportSequenceNumberUri,
+ kTransportSequenceNumberId + 1));
new_config.decoder_map.emplace(1, SdpAudioFormat("foo", 8000, 1));
MockVoEChannelProxy& channel_proxy = *helper.channel_proxy();
diff --git a/audio/audio_send_stream.cc b/audio/audio_send_stream.cc
index 8ed78eb..d2e26cd 100644
--- a/audio/audio_send_stream.cc
+++ b/audio/audio_send_stream.cc
@@ -218,8 +218,7 @@
new_config.rtp.nack.rtp_history_ms / 20);
}
- if (first_time ||
- new_config.send_transport != old_config.send_transport) {
+ if (first_time || new_config.send_transport != old_config.send_transport) {
if (old_config.send_transport) {
channel_proxy->RegisterTransport(nullptr);
}
@@ -326,7 +325,8 @@
}
bool AudioSendStream::SendTelephoneEvent(int payload_type,
- int payload_frequency, int event,
+ int payload_frequency,
+ int event,
int duration_ms) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
return channel_proxy_->SetSendTelephoneEventPayloadType(payload_type,
@@ -415,8 +415,7 @@
if (bitrate_bps == 0) {
bitrate_bps = config_.min_bitrate_bps;
}
- RTC_DCHECK_GE(bitrate_bps,
- static_cast<uint32_t>(config_.min_bitrate_bps));
+ RTC_DCHECK_GE(bitrate_bps, static_cast<uint32_t>(config_.min_bitrate_bps));
// The bitrate allocator might allocate an higher than max configured bitrate
// if there is room, to allow for, as example, extra FEC. Ignore that for now.
const uint32_t max_bitrate_bps = config_.max_bitrate_bps;
diff --git a/audio/audio_send_stream.h b/audio/audio_send_stream.h
index efc9c0e..ba87202 100644
--- a/audio/audio_send_stream.h
+++ b/audio/audio_send_stream.h
@@ -70,7 +70,9 @@
void Start() override;
void Stop() override;
void SendAudioData(std::unique_ptr<AudioFrame> audio_frame) override;
- bool SendTelephoneEvent(int payload_type, int payload_frequency, int event,
+ bool SendTelephoneEvent(int payload_type,
+ int payload_frequency,
+ int event,
int duration_ms) override;
void SetMuted(bool muted) override;
webrtc::AudioSendStream::Stats GetStats() const override;
diff --git a/audio/audio_send_stream_tests.cc b/audio/audio_send_stream_tests.cc
index 3f96c33..7deeff3 100644
--- a/audio/audio_send_stream_tests.cc
+++ b/audio/audio_send_stream_tests.cc
@@ -20,15 +20,9 @@
public:
AudioSendTest() : SendTest(CallTest::kDefaultTimeoutMs) {}
- size_t GetNumVideoStreams() const override {
- return 0;
- }
- size_t GetNumAudioStreams() const override {
- return 1;
- }
- size_t GetNumFlexfecStreams() const override {
- return 0;
- }
+ size_t GetNumVideoStreams() const override { return 0; }
+ size_t GetNumAudioStreams() const override { return 1; }
+ size_t GetNumFlexfecStreams() const override { return 0; }
};
} // namespace
diff --git a/audio/audio_send_stream_unittest.cc b/audio/audio_send_stream_unittest.cc
index d0bc45f..f84aaaf 100644
--- a/audio/audio_send_stream_unittest.cc
+++ b/audio/audio_send_stream_unittest.cc
@@ -56,8 +56,8 @@
const double kEchoReturnLossEnhancement = 101;
const double kResidualEchoLikelihood = -1.0f;
const double kResidualEchoLikelihoodMax = 23.0f;
-const CallStatistics kCallStats = {
- 1345, 1678, 1901, 1234, 112, 13456, 17890, 1567, -1890, -1123};
+const CallStatistics kCallStats = {1345, 1678, 1901, 1234, 112,
+ 13456, 17890, 1567, -1890, -1123};
const ReportBlock kReportBlock = {456, 780, 123, 567, 890, 132, 143, 13354};
const int kTelephoneEventPayloadType = 123;
const int kTelephoneEventPayloadFrequency = 65432;
@@ -181,9 +181,8 @@
TimeInterval* active_lifetime() { return &active_lifetime_; }
static void AddBweToConfig(AudioSendStream::Config* config) {
- config->rtp.extensions.push_back(
- RtpExtension(RtpExtension::kTransportSequenceNumberUri,
- kTransportSequenceNumberId));
+ config->rtp.extensions.push_back(RtpExtension(
+ RtpExtension::kTransportSequenceNumberUri, kTransportSequenceNumberId));
config->send_codec_spec->transport_cc_enabled = true;
}
@@ -254,13 +253,14 @@
void SetupMockForSendTelephoneEvent() {
EXPECT_TRUE(channel_proxy_);
- EXPECT_CALL(*channel_proxy_,
- SetSendTelephoneEventPayloadType(kTelephoneEventPayloadType,
- kTelephoneEventPayloadFrequency))
- .WillOnce(Return(true));
- EXPECT_CALL(*channel_proxy_,
+ EXPECT_CALL(*channel_proxy_, SetSendTelephoneEventPayloadType(
+ kTelephoneEventPayloadType,
+ kTelephoneEventPayloadFrequency))
+ .WillOnce(Return(true));
+ EXPECT_CALL(
+ *channel_proxy_,
SendTelephoneEventOutband(kTelephoneEventCode, kTelephoneEventDuration))
- .WillOnce(Return(true));
+ .WillOnce(Return(true));
}
void SetupMockForGetStats() {
@@ -355,9 +355,9 @@
ConfigHelper helper(false, true);
auto send_stream = helper.CreateAudioSendStream();
helper.SetupMockForSendTelephoneEvent();
- EXPECT_TRUE(send_stream->SendTelephoneEvent(kTelephoneEventPayloadType,
- kTelephoneEventPayloadFrequency, kTelephoneEventCode,
- kTelephoneEventDuration));
+ EXPECT_TRUE(send_stream->SendTelephoneEvent(
+ kTelephoneEventPayloadType, kTelephoneEventPayloadFrequency,
+ kTelephoneEventCode, kTelephoneEventDuration));
}
TEST(AudioSendStreamTest, SetMuted) {
@@ -518,7 +518,7 @@
EXPECT_CALL(*helper.channel_proxy(), ResetSenderCongestionControlObjects())
.Times(1);
EXPECT_CALL(*helper.channel_proxy(), RegisterSenderCongestionControlObjects(
- helper.transport(), Ne(nullptr)))
+ helper.transport(), Ne(nullptr)))
.Times(1);
}
send_stream->Reconfigure(new_config);
diff --git a/audio/audio_state.cc b/audio/audio_state.cc
index d738884..bff818e 100644
--- a/audio/audio_state.cc
+++ b/audio/audio_state.cc
@@ -27,8 +27,7 @@
AudioState::AudioState(const AudioState::Config& config)
: config_(config),
- audio_transport_(config_.audio_mixer,
- config_.audio_processing.get()) {
+ audio_transport_(config_.audio_mixer, config_.audio_processing.get()) {
process_thread_checker_.DetachFromThread();
RTC_DCHECK(config_.audio_mixer);
RTC_DCHECK(config_.audio_device_module);
@@ -50,7 +49,7 @@
RTC_DCHECK_EQ(0, receiving_streams_.count(stream));
receiving_streams_.insert(stream);
if (!config_.audio_mixer->AddSource(
- static_cast<internal::AudioReceiveStream*>(stream))) {
+ static_cast<internal::AudioReceiveStream*>(stream))) {
RTC_DLOG(LS_ERROR) << "Failed to add source to mixer.";
}
@@ -79,7 +78,8 @@
}
void AudioState::AddSendingStream(webrtc::AudioSendStream* stream,
- int sample_rate_hz, size_t num_channels) {
+ int sample_rate_hz,
+ size_t num_channels) {
RTC_DCHECK(thread_checker_.CalledOnValidThread());
auto& properties = sending_streams_[stream];
properties.sample_rate_hz = sample_rate_hz;
@@ -121,8 +121,7 @@
}
} else {
config_.audio_device_module->StopPlayout();
- null_audio_poller_ =
- rtc::MakeUnique<NullAudioPoller>(&audio_transport_);
+ null_audio_poller_ = rtc::MakeUnique<NullAudioPoller>(&audio_transport_);
}
}
}
diff --git a/audio/audio_state.h b/audio/audio_state.h
index d4e4e3f..689534b 100644
--- a/audio/audio_state.h
+++ b/audio/audio_state.h
@@ -39,9 +39,7 @@
RTC_DCHECK(config_.audio_processing);
return config_.audio_processing.get();
}
- AudioTransport* audio_transport() override {
- return &audio_transport_;
- }
+ AudioTransport* audio_transport() override { return &audio_transport_; }
void SetPlayout(bool enabled) override;
void SetRecording(bool enabled) override;
@@ -60,7 +58,8 @@
void RemoveReceivingStream(webrtc::AudioReceiveStream* stream);
void AddSendingStream(webrtc::AudioSendStream* stream,
- int sample_rate_hz, size_t num_channels);
+ int sample_rate_hz,
+ size_t num_channels);
void RemoveSendingStream(webrtc::AudioSendStream* stream);
private:
diff --git a/audio/audio_state_unittest.cc b/audio/audio_state_unittest.cc
index e825ec6..dc622df 100644
--- a/audio/audio_state_unittest.cc
+++ b/audio/audio_state_unittest.cc
@@ -71,8 +71,7 @@
const float inc = (2 * 3.14159265f * 1000) / sample_rate_hz;
float w = 0.f;
for (int i = 0; i < samples_per_channel; ++i) {
- audio_data[i * num_channels] =
- static_cast<int16_t>(32767.f * std::sin(w));
+ audio_data[i * num_channels] = static_cast<int16_t>(32767.f * std::sin(w));
w += inc;
}
return audio_data;
@@ -111,16 +110,18 @@
MockAudioSendStream stream;
audio_state->AddSendingStream(&stream, 8000, 2);
- EXPECT_CALL(stream, SendAudioDataForMock(testing::AllOf(
- testing::Field(&AudioFrame::sample_rate_hz_, testing::Eq(8000)),
- testing::Field(&AudioFrame::num_channels_, testing::Eq(2u)))))
- .WillOnce(
- // Verify that channels are not swapped by default.
- testing::Invoke([](AudioFrame* audio_frame) {
- auto levels = ComputeChannelLevels(audio_frame);
- EXPECT_LT(0u, levels[0]);
- EXPECT_EQ(0u, levels[1]);
- }));
+ EXPECT_CALL(
+ stream,
+ SendAudioDataForMock(testing::AllOf(
+ testing::Field(&AudioFrame::sample_rate_hz_, testing::Eq(8000)),
+ testing::Field(&AudioFrame::num_channels_, testing::Eq(2u)))))
+ .WillOnce(
+ // Verify that channels are not swapped by default.
+ testing::Invoke([](AudioFrame* audio_frame) {
+ auto levels = ComputeChannelLevels(audio_frame);
+ EXPECT_LT(0u, levels[0]);
+ EXPECT_EQ(0u, levels[1]);
+ }));
MockAudioProcessing* ap =
static_cast<MockAudioProcessing*>(audio_state->audio_processing());
EXPECT_CALL(*ap, set_stream_delay_ms(0));
@@ -132,8 +133,8 @@
auto audio_data = Create10msTestData(kSampleRate, kNumChannels);
uint32_t new_mic_level = 667;
audio_state->audio_transport()->RecordedDataIsAvailable(
- &audio_data[0], kSampleRate / 100, kNumChannels * 2,
- kNumChannels, kSampleRate, 0, 0, 0, false, new_mic_level);
+ &audio_data[0], kSampleRate / 100, kNumChannels * 2, kNumChannels,
+ kSampleRate, 0, 0, 0, false, new_mic_level);
EXPECT_EQ(667u, new_mic_level);
audio_state->RemoveSendingStream(&stream);
@@ -149,24 +150,28 @@
audio_state->AddSendingStream(&stream_1, 8001, 2);
audio_state->AddSendingStream(&stream_2, 32000, 1);
- EXPECT_CALL(stream_1, SendAudioDataForMock(testing::AllOf(
- testing::Field(&AudioFrame::sample_rate_hz_, testing::Eq(16000)),
- testing::Field(&AudioFrame::num_channels_, testing::Eq(1u)))))
- .WillOnce(
- // Verify that there is output signal.
- testing::Invoke([](AudioFrame* audio_frame) {
- auto levels = ComputeChannelLevels(audio_frame);
- EXPECT_LT(0u, levels[0]);
- }));
- EXPECT_CALL(stream_2, SendAudioDataForMock(testing::AllOf(
- testing::Field(&AudioFrame::sample_rate_hz_, testing::Eq(16000)),
- testing::Field(&AudioFrame::num_channels_, testing::Eq(1u)))))
- .WillOnce(
- // Verify that there is output signal.
- testing::Invoke([](AudioFrame* audio_frame) {
- auto levels = ComputeChannelLevels(audio_frame);
- EXPECT_LT(0u, levels[0]);
- }));
+ EXPECT_CALL(
+ stream_1,
+ SendAudioDataForMock(testing::AllOf(
+ testing::Field(&AudioFrame::sample_rate_hz_, testing::Eq(16000)),
+ testing::Field(&AudioFrame::num_channels_, testing::Eq(1u)))))
+ .WillOnce(
+ // Verify that there is output signal.
+ testing::Invoke([](AudioFrame* audio_frame) {
+ auto levels = ComputeChannelLevels(audio_frame);
+ EXPECT_LT(0u, levels[0]);
+ }));
+ EXPECT_CALL(
+ stream_2,
+ SendAudioDataForMock(testing::AllOf(
+ testing::Field(&AudioFrame::sample_rate_hz_, testing::Eq(16000)),
+ testing::Field(&AudioFrame::num_channels_, testing::Eq(1u)))))
+ .WillOnce(
+ // Verify that there is output signal.
+ testing::Invoke([](AudioFrame* audio_frame) {
+ auto levels = ComputeChannelLevels(audio_frame);
+ EXPECT_LT(0u, levels[0]);
+ }));
MockAudioProcessing* ap =
static_cast<MockAudioProcessing*>(audio_state->audio_processing());
EXPECT_CALL(*ap, set_stream_delay_ms(5));
@@ -178,8 +183,8 @@
auto audio_data = Create10msTestData(kSampleRate, kNumChannels);
uint32_t new_mic_level = 667;
audio_state->audio_transport()->RecordedDataIsAvailable(
- &audio_data[0], kSampleRate / 100, kNumChannels * 2,
- kNumChannels, kSampleRate, 5, 0, 0, true, new_mic_level);
+ &audio_data[0], kSampleRate / 100, kNumChannels * 2, kNumChannels,
+ kSampleRate, 5, 0, 0, true, new_mic_level);
EXPECT_EQ(667u, new_mic_level);
audio_state->RemoveSendingStream(&stream_1);
@@ -210,8 +215,8 @@
auto audio_data = Create10msTestData(kSampleRate, kNumChannels);
uint32_t new_mic_level = 667;
audio_state->audio_transport()->RecordedDataIsAvailable(
- &audio_data[0], kSampleRate / 100, kNumChannels * 2,
- kNumChannels, kSampleRate, 0, 0, 0, false, new_mic_level);
+ &audio_data[0], kSampleRate / 100, kNumChannels * 2, kNumChannels,
+ kSampleRate, 0, 0, 0, false, new_mic_level);
EXPECT_EQ(667u, new_mic_level);
audio_state->RemoveSendingStream(&stream);
@@ -230,8 +235,8 @@
auto audio_data = Create10msSilentTestData(kSampleRate, kNumChannels);
uint32_t new_mic_level = 667;
audio_state->audio_transport()->RecordedDataIsAvailable(
- &audio_data[0], kSampleRate / 100, kNumChannels * 2,
- kNumChannels, kSampleRate, 0, 0, 0, false, new_mic_level);
+ &audio_data[0], kSampleRate / 100, kNumChannels * 2, kNumChannels,
+ kSampleRate, 0, 0, 0, false, new_mic_level);
auto stats = audio_state->GetAudioInputStats();
EXPECT_EQ(0, stats.audio_level);
EXPECT_THAT(stats.total_energy, testing::DoubleEq(0.0));
@@ -244,8 +249,8 @@
uint32_t new_mic_level = 667;
for (int i = 0; i < 10; ++i) {
audio_state->audio_transport()->RecordedDataIsAvailable(
- &audio_data[0], kSampleRate / 100, kNumChannels * 2,
- kNumChannels, kSampleRate, 0, 0, 0, false, new_mic_level);
+ &audio_data[0], kSampleRate / 100, kNumChannels * 2, kNumChannels,
+ kSampleRate, 0, 0, 0, false, new_mic_level);
}
auto stats = audio_state->GetAudioInputStats();
EXPECT_EQ(32767, stats.audio_level);
diff --git a/audio/audio_transport_impl.cc b/audio/audio_transport_impl.cc
index f9b0311..44e95aa 100644
--- a/audio/audio_transport_impl.cc
+++ b/audio/audio_transport_impl.cc
@@ -83,8 +83,7 @@
AudioTransportImpl::AudioTransportImpl(AudioMixer* mixer,
AudioProcessing* audio_processing)
- : audio_processing_(audio_processing),
- mixer_(mixer) {
+ : audio_processing_(audio_processing), mixer_(mixer) {
RTC_DCHECK(mixer);
RTC_DCHECK(audio_processing);
}
@@ -125,9 +124,8 @@
}
std::unique_ptr<AudioFrame> audio_frame(new AudioFrame());
- InitializeCaptureFrame(sample_rate, send_sample_rate_hz,
- number_of_channels, send_num_channels,
- audio_frame.get());
+ InitializeCaptureFrame(sample_rate, send_sample_rate_hz, number_of_channels,
+ send_num_channels, audio_frame.get());
voe::RemixAndResample(static_cast<const int16_t*>(audio_data),
number_of_frames, number_of_channels, sample_rate,
&capture_resampler_, audio_frame.get());
@@ -175,13 +173,13 @@
// Mix all received streams, feed the result to the AudioProcessing module, then
// resample the result to the requested output rate.
int32_t AudioTransportImpl::NeedMorePlayData(const size_t nSamples,
- const size_t nBytesPerSample,
- const size_t nChannels,
- const uint32_t samplesPerSec,
- void* audioSamples,
- size_t& nSamplesOut,
- int64_t* elapsed_time_ms,
- int64_t* ntp_time_ms) {
+ const size_t nBytesPerSample,
+ const size_t nChannels,
+ const uint32_t samplesPerSec,
+ void* audioSamples,
+ size_t& nSamplesOut,
+ int64_t* elapsed_time_ms,
+ int64_t* ntp_time_ms) {
RTC_DCHECK_EQ(sizeof(int16_t) * nChannels, nBytesPerSample);
RTC_DCHECK_GE(nChannels, 1);
RTC_DCHECK_LE(nChannels, 2);
@@ -210,12 +208,12 @@
// Used by Chromium - same as NeedMorePlayData() but because Chrome has its
// own APM instance, does not call audio_processing_->ProcessReverseStream().
void AudioTransportImpl::PullRenderData(int bits_per_sample,
- int sample_rate,
- size_t number_of_channels,
- size_t number_of_frames,
- void* audio_data,
- int64_t* elapsed_time_ms,
- int64_t* ntp_time_ms) {
+ int sample_rate,
+ size_t number_of_channels,
+ size_t number_of_frames,
+ void* audio_data,
+ int64_t* elapsed_time_ms,
+ int64_t* ntp_time_ms) {
RTC_DCHECK_EQ(bits_per_sample, 16);
RTC_DCHECK_GE(number_of_channels, 1);
RTC_DCHECK_LE(number_of_channels, 2);
@@ -237,7 +235,8 @@
}
void AudioTransportImpl::UpdateSendingStreams(
- std::vector<AudioSendStream*> streams, int send_sample_rate_hz,
+ std::vector<AudioSendStream*> streams,
+ int send_sample_rate_hz,
size_t send_num_channels) {
rtc::CritScope lock(&capture_lock_);
sending_streams_ = std::move(streams);
diff --git a/audio/audio_transport_impl.h b/audio/audio_transport_impl.h
index 4e6e047..3a3155c 100644
--- a/audio/audio_transport_impl.h
+++ b/audio/audio_transport_impl.h
@@ -30,8 +30,7 @@
class AudioTransportImpl : public AudioTransport {
public:
- AudioTransportImpl(AudioMixer* mixer,
- AudioProcessing* audio_processing);
+ AudioTransportImpl(AudioMixer* mixer, AudioProcessing* audio_processing);
~AudioTransportImpl() override;
int32_t RecordedDataIsAvailable(const void* audioSamples,
@@ -63,12 +62,11 @@
int64_t* ntp_time_ms) override;
void UpdateSendingStreams(std::vector<AudioSendStream*> streams,
- int send_sample_rate_hz, size_t send_num_channels);
+ int send_sample_rate_hz,
+ size_t send_num_channels);
void SetStereoChannelSwapping(bool enable);
bool typing_noise_detected() const;
- const voe::AudioLevel& audio_level() const {
- return audio_level_;
- }
+ const voe::AudioLevel& audio_level() const { return audio_level_; }
private:
// Shared.
diff --git a/audio/channel.cc b/audio/channel.cc
index ecde172..7eafd52 100644
--- a/audio/channel.cc
+++ b/audio/channel.cc
@@ -20,8 +20,8 @@
#include "api/array_view.h"
#include "audio/utility/audio_frame_operations.h"
#include "call/rtp_transport_controller_send_interface.h"
-#include "logging/rtc_event_log/rtc_event_log.h"
#include "logging/rtc_event_log/events/rtc_event_audio_playout.h"
+#include "logging/rtc_event_log/rtc_event_log.h"
#include "modules/audio_coding/audio_network_adaptor/include/audio_network_adaptor_config.h"
#include "modules/audio_coding/codecs/audio_format_conversion.h"
#include "modules/audio_device/include/audio_device.h"
@@ -943,9 +943,8 @@
uint32_t ntp_secs = 0;
uint32_t ntp_frac = 0;
uint32_t rtp_timestamp = 0;
- if (0 !=
- _rtpRtcpModule->RemoteNTP(&ntp_secs, &ntp_frac, NULL, NULL,
- &rtp_timestamp)) {
+ if (0 != _rtpRtcpModule->RemoteNTP(&ntp_secs, &ntp_frac, NULL, NULL,
+ &rtp_timestamp)) {
// Waiting for RTCP.
return 0;
}
@@ -993,7 +992,7 @@
return -1;
}
if (_rtpRtcpModule->SendTelephoneEventOutband(
- event, duration_ms, kTelephoneEventAttenuationdB) != 0) {
+ event, duration_ms, kTelephoneEventAttenuationdB) != 0) {
RTC_DLOG(LS_ERROR) << "SendTelephoneEventOutband() failed to send event";
return -1;
}
diff --git a/audio/channel_proxy.cc b/audio/channel_proxy.cc
index e37d9d7..bac681f 100644
--- a/audio/channel_proxy.cc
+++ b/audio/channel_proxy.cc
@@ -22,8 +22,8 @@
namespace voe {
ChannelProxy::ChannelProxy() {}
-ChannelProxy::ChannelProxy(std::unique_ptr<Channel> channel) :
- channel_(std::move(channel)) {
+ChannelProxy::ChannelProxy(std::unique_ptr<Channel> channel)
+ : channel_(std::move(channel)) {
RTC_DCHECK(channel_);
module_process_thread_checker_.DetachFromThread();
}
@@ -92,7 +92,7 @@
RtcpBandwidthObserver* bandwidth_observer) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
channel_->RegisterSenderCongestionControlObjects(transport,
- bandwidth_observer);
+ bandwidth_observer);
}
void ChannelProxy::RegisterReceiverCongestionControlObjects(
@@ -172,7 +172,7 @@
int payload_frequency) {
RTC_DCHECK(worker_thread_checker_.CalledOnValidThread());
return channel_->SetSendTelephoneEventPayloadType(payload_type,
- payload_frequency) == 0;
+ payload_frequency) == 0;
}
bool ChannelProxy::SendTelephoneEventOutband(int event, int duration_ms) {
diff --git a/audio/channel_proxy.h b/audio/channel_proxy.h
index d285042..0029851 100644
--- a/audio/channel_proxy.h
+++ b/audio/channel_proxy.h
@@ -108,8 +108,7 @@
virtual void SetTransportOverhead(int transport_overhead_per_packet);
virtual void AssociateSendChannel(const ChannelProxy& send_channel_proxy);
virtual void DisassociateSendChannel();
- virtual void GetRtpRtcp(RtpRtcp** rtp_rtcp,
- RtpReceiver** rtp_receiver) const;
+ virtual void GetRtpRtcp(RtpRtcp** rtp_rtcp, RtpReceiver** rtp_receiver) const;
virtual uint32_t GetPlayoutTimestamp() const;
virtual void SetMinimumPlayoutDelay(int delay_ms);
virtual bool GetRecCodec(CodecInst* codec_inst) const;
diff --git a/audio/mock_voe_channel_proxy.h b/audio/mock_voe_channel_proxy.h
index 186a108..7396dd1 100644
--- a/audio/mock_voe_channel_proxy.h
+++ b/audio/mock_voe_channel_proxy.h
@@ -31,8 +31,7 @@
return SetEncoderForMock(payload_type, &encoder);
}
MOCK_METHOD2(SetEncoderForMock,
- bool(int payload_type,
- std::unique_ptr<AudioEncoder>* encoder));
+ bool(int payload_type, std::unique_ptr<AudioEncoder>* encoder));
MOCK_METHOD1(
ModifyEncoder,
void(rtc::FunctionView<void(std::unique_ptr<AudioEncoder>*)> modifier));
@@ -59,8 +58,8 @@
MOCK_CONST_METHOD0(GetTotalOutputEnergy, double());
MOCK_CONST_METHOD0(GetTotalOutputDuration, double());
MOCK_CONST_METHOD0(GetDelayEstimate, uint32_t());
- MOCK_METHOD2(SetSendTelephoneEventPayloadType, bool(int payload_type,
- int payload_frequency));
+ MOCK_METHOD2(SetSendTelephoneEventPayloadType,
+ bool(int payload_type, int payload_frequency));
MOCK_METHOD2(SendTelephoneEventOutband, bool(int event, int duration_ms));
MOCK_METHOD2(SetBitrate, void(int bitrate_bps, int64_t probing_interval_ms));
MOCK_METHOD1(SetSink, void(AudioSinkInterface* sink));
@@ -71,8 +70,8 @@
MOCK_METHOD1(SetChannelOutputVolumeScaling, void(float scaling));
MOCK_METHOD1(SetRtcEventLog, void(RtcEventLog* event_log));
MOCK_METHOD2(GetAudioFrameWithInfo,
- AudioMixer::Source::AudioFrameInfo(int sample_rate_hz,
- AudioFrame* audio_frame));
+ AudioMixer::Source::AudioFrameInfo(int sample_rate_hz,
+ AudioFrame* audio_frame));
MOCK_CONST_METHOD0(PreferredSampleRate, int());
// GMock doesn't like move-only types, like std::unique_ptr.
virtual void ProcessAndEncodeAudio(std::unique_ptr<AudioFrame> audio_frame) {
@@ -84,8 +83,8 @@
MOCK_METHOD1(AssociateSendChannel,
void(const ChannelProxy& send_channel_proxy));
MOCK_METHOD0(DisassociateSendChannel, void());
- MOCK_CONST_METHOD2(GetRtpRtcp, void(RtpRtcp** rtp_rtcp,
- RtpReceiver** rtp_receiver));
+ MOCK_CONST_METHOD2(GetRtpRtcp,
+ void(RtpRtcp** rtp_rtcp, RtpReceiver** rtp_receiver));
MOCK_CONST_METHOD0(GetPlayoutTimestamp, uint32_t());
MOCK_METHOD1(SetMinimumPlayoutDelay, void(int delay_ms));
MOCK_CONST_METHOD1(GetRecCodec, bool(CodecInst* codec_inst));
diff --git a/audio/remix_resample.cc b/audio/remix_resample.cc
index 69038cd..eda70c7 100644
--- a/audio/remix_resample.cc
+++ b/audio/remix_resample.cc
@@ -68,9 +68,9 @@
// how much to zero here; or 2) make resampler accept a hint that the input is
// zeroed.
const size_t src_length = samples_per_channel * audio_ptr_num_channels;
- int out_length = resampler->Resample(audio_ptr, src_length,
- dst_frame->mutable_data(),
- AudioFrame::kMaxDataSizeSamples);
+ int out_length =
+ resampler->Resample(audio_ptr, src_length, dst_frame->mutable_data(),
+ AudioFrame::kMaxDataSizeSamples);
if (out_length == -1) {
FATAL() << "Resample failed: audio_ptr = " << audio_ptr
<< ", src_length = " << src_length
diff --git a/audio/remix_resample_unittest.cc b/audio/remix_resample_unittest.cc
index 1d8cce7..f1fb5f7 100644
--- a/audio/remix_resample_unittest.cc
+++ b/audio/remix_resample_unittest.cc
@@ -113,7 +113,8 @@
// Computes the best SNR based on the error between |ref_frame| and
// |test_frame|. It allows for up to a |max_delay| in samples between the
// signals to compensate for the resampling delay.
-float ComputeSNR(const AudioFrame& ref_frame, const AudioFrame& test_frame,
+float ComputeSNR(const AudioFrame& ref_frame,
+ const AudioFrame& test_frame,
size_t max_delay) {
VerifyParams(ref_frame, test_frame);
float best_snr = 0;
@@ -123,8 +124,9 @@
float variance = 0;
const int16_t* ref_frame_data = ref_frame.data();
const int16_t* test_frame_data = test_frame.data();
- for (size_t i = 0; i < ref_frame.samples_per_channel_ *
- ref_frame.num_channels_ - delay; i++) {
+ for (size_t i = 0;
+ i < ref_frame.samples_per_channel_ * ref_frame.num_channels_ - delay;
+ i++) {
int error = ref_frame_data[i] - test_frame_data[i + delay];
mse += error * error;
variance += ref_frame_data[i] * ref_frame_data[i];
@@ -145,7 +147,7 @@
const AudioFrame& test_frame) {
VerifyParams(ref_frame, test_frame);
const int16_t* ref_frame_data = ref_frame.data();
- const int16_t* test_frame_data = test_frame.data();
+ const int16_t* test_frame_data = test_frame.data();
for (size_t i = 0;
i < ref_frame.samples_per_channel_ * ref_frame.num_channels_; i++) {
EXPECT_EQ(ref_frame_data[i], test_frame_data[i]);
@@ -161,8 +163,8 @@
const int16_t kSrcCh2 = 15;
const int16_t kSrcCh3 = 22;
const int16_t kSrcCh4 = 8;
- const float resampling_factor = (1.0 * src_sample_rate_hz) /
- dst_sample_rate_hz;
+ const float resampling_factor =
+ (1.0 * src_sample_rate_hz) / dst_sample_rate_hz;
const float dst_ch1 = resampling_factor * kSrcCh1;
const float dst_ch2 = resampling_factor * kSrcCh2;
const float dst_ch3 = resampling_factor * kSrcCh3;
@@ -206,7 +208,7 @@
static_cast<double>(dst_sample_rate_hz) / src_sample_rate_hz *
kInputKernelDelaySamples * dst_channels * 2);
printf("(%d, %d Hz) -> (%d, %d Hz) ", // SNR reported on the same line later.
- src_channels, src_sample_rate_hz, dst_channels, dst_sample_rate_hz);
+ src_channels, src_sample_rate_hz, dst_channels, dst_sample_rate_hz);
RemixAndResample(src_frame_, &resampler, &dst_frame_);
if (src_sample_rate_hz == 96000 && dst_sample_rate_hz == 8000) {
@@ -258,8 +260,7 @@
for (int src_rate = 0; src_rate < kSampleRatesSize; src_rate++) {
for (int dst_rate = 0; dst_rate < kSampleRatesSize; dst_rate++) {
- for (int src_channel = 0; src_channel < kSrcChannelsSize;
- src_channel++) {
+ for (int src_channel = 0; src_channel < kSrcChannelsSize; src_channel++) {
for (int dst_channel = 0; dst_channel < kDstChannelsSize;
dst_channel++) {
RunResampleTest(kSrcChannels[src_channel], kSampleRates[src_rate],
diff --git a/audio/test/audio_end_to_end_test.cc b/audio/test/audio_end_to_end_test.cc
index 84ad4f0..820b464 100644
--- a/audio/test/audio_end_to_end_test.cc
+++ b/audio/test/audio_end_to_end_test.cc
@@ -67,15 +67,15 @@
}
test::PacketTransport* AudioEndToEndTest::CreateReceiveTransport(
- SingleThreadedTaskQueueForTesting* task_queue) {
+ SingleThreadedTaskQueueForTesting* task_queue) {
return new test::PacketTransport(
task_queue, nullptr, this, test::PacketTransport::kReceiver,
test::CallTest::payload_type_map_, GetNetworkPipeConfig());
}
void AudioEndToEndTest::ModifyAudioConfigs(
- AudioSendStream::Config* send_config,
- std::vector<AudioReceiveStream::Config>* receive_configs) {
+ AudioSendStream::Config* send_config,
+ std::vector<AudioReceiveStream::Config>* receive_configs) {
// Large bitrate by default.
const webrtc::SdpAudioFormat kDefaultFormat("opus", 48000, 2,
{{"stereo", "1"}});
diff --git a/audio/test/low_bandwidth_audio_test.cc b/audio/test/low_bandwidth_audio_test.cc
index f53f7b6..169f4bf 100644
--- a/audio/test/low_bandwidth_audio_test.cc
+++ b/audio/test/low_bandwidth_audio_test.cc
@@ -13,10 +13,12 @@
#include "system_wrappers/include/sleep.h"
#include "test/testsupport/fileutils.h"
-DEFINE_int(sample_rate_hz, 16000,
+DEFINE_int(sample_rate_hz,
+ 16000,
"Sample rate (Hz) of the produced audio files.");
-DEFINE_bool(quick, false,
+DEFINE_bool(quick,
+ false,
"Don't do the full audio recording. "
"Used to quickly check that the test runs without crashing.");
@@ -42,7 +44,7 @@
const ::testing::TestInfo* const test_info =
::testing::UnitTest::GetInstance()->current_test_info();
return webrtc::test::OutputPath() + "LowBandwidth_" + test_info->name() +
- "_" + FileSampleRateSuffix() + ".wav";
+ "_" + FileSampleRateSuffix() + ".wav";
}
std::unique_ptr<TestAudioDeviceModule::Capturer> CreateCapturer() override {
@@ -69,22 +71,21 @@
// Output information about the input and output audio files so that further
// processing can be done by an external process.
- printf("TEST %s %s %s\n", test_info->name(),
- AudioInputFile().c_str(), AudioOutputFile().c_str());
+ printf("TEST %s %s %s\n", test_info->name(), AudioInputFile().c_str(),
+ AudioOutputFile().c_str());
}
};
class Mobile2GNetworkTest : public AudioQualityTest {
- void ModifyAudioConfigs(AudioSendStream::Config* send_config,
+ void ModifyAudioConfigs(
+ AudioSendStream::Config* send_config,
std::vector<AudioReceiveStream::Config>* receive_configs) override {
send_config->send_codec_spec = AudioSendStream::Config::SendCodecSpec(
test::CallTest::kAudioSendPayloadType,
{"OPUS",
48000,
2,
- {{"maxaveragebitrate", "6000"},
- {"ptime", "60"},
- {"stereo", "1"}}});
+ {{"maxaveragebitrate", "6000"}, {"ptime", "60"}, {"stereo", "1"}}});
}
FakeNetworkPipe::Config GetNetworkPipeConfig() const override {
diff --git a/audio/transport_feedback_packet_loss_tracker_unittest.cc b/audio/transport_feedback_packet_loss_tracker_unittest.cc
index b190c62..2f9bf68 100644
--- a/audio/transport_feedback_packet_loss_tracker_unittest.cc
+++ b/audio/transport_feedback_packet_loss_tracker_unittest.cc
@@ -412,34 +412,30 @@
TEST_P(TransportFeedbackPacketLossTrackerTest, SanityGapsInSequenceNumbers) {
TransportFeedbackPacketLossTracker tracker(50 * kDefaultSendIntervalMs, 5, 1);
- SendPackets(&tracker,
- {static_cast<uint16_t>(base_),
- static_cast<uint16_t>(base_ + 2),
- static_cast<uint16_t>(base_ + 4),
- static_cast<uint16_t>(base_ + 6),
- static_cast<uint16_t>(base_ + 8)},
- kDefaultSendIntervalMs);
+ SendPackets(
+ &tracker,
+ {static_cast<uint16_t>(base_), static_cast<uint16_t>(base_ + 2),
+ static_cast<uint16_t>(base_ + 4), static_cast<uint16_t>(base_ + 6),
+ static_cast<uint16_t>(base_ + 8)},
+ kDefaultSendIntervalMs);
// Gaps in sequence numbers not considered as gaps in window, because only
// those sequence numbers which were associated with the stream count.
// Expected window contents: [] -> [11011].
AddTransportFeedbackAndValidate(
// Note: Left packets belong to this stream, right ones ignored.
- &tracker, base_, {true, false,
- true, false,
- false, false,
- true, false,
- true, true});
+ &tracker, base_,
+ {true, false, true, false, false, false, true, false, true, true});
ValidatePacketLossStatistics(tracker, 1.0f / 5.0f, 1.0f / 4.0f);
// Create gap by sending [base + 10] but not acking it.
// Note: Acks for [base + 11] and [base + 13] ignored (other stream).
// Expected window contents: [11011] -> [11011-GAP-01].
- SendPackets(&tracker,
- {static_cast<uint16_t>(base_ + 10),
- static_cast<uint16_t>(base_ + 12),
- static_cast<uint16_t>(base_ + 14)},
- kDefaultSendIntervalMs);
+ SendPackets(
+ &tracker,
+ {static_cast<uint16_t>(base_ + 10), static_cast<uint16_t>(base_ + 12),
+ static_cast<uint16_t>(base_ + 14)},
+ kDefaultSendIntervalMs);
AddTransportFeedbackAndValidate(&tracker, base_ + 11,
{false, false, false, true, true});
ValidatePacketLossStatistics(tracker, 2.0f / 7.0f, 2.0f / 5.0f);
diff --git a/audio/utility/audio_frame_operations.cc b/audio/utility/audio_frame_operations.cc
index ed7b7a8..fb1f3b0 100644
--- a/audio/utility/audio_frame_operations.cc
+++ b/audio/utility/audio_frame_operations.cc
@@ -159,7 +159,8 @@
for (size_t i = 0; i < samples_per_channel; i++) {
dst_audio[i] =
(static_cast<int32_t>(src_audio[4 * i]) + src_audio[4 * i + 1] +
- src_audio[4 * i + 2] + src_audio[4 * i + 3]) >> 2;
+ src_audio[4 * i + 2] + src_audio[4 * i + 3]) >>
+ 2;
}
}
diff --git a/audio/utility/audio_frame_operations_unittest.cc b/audio/utility/audio_frame_operations_unittest.cc
index 1d08d7e..76f1dcd 100644
--- a/audio/utility/audio_frame_operations_unittest.cc
+++ b/audio/utility/audio_frame_operations_unittest.cc
@@ -50,27 +50,29 @@
void SetFrameData(int16_t data, AudioFrame* frame) {
int16_t* frame_data = frame->mutable_data();
- for (size_t i = 0;
- i < frame->samples_per_channel_ * frame->num_channels_; i++) {
+ for (size_t i = 0; i < frame->samples_per_channel_ * frame->num_channels_;
+ i++) {
frame_data[i] = data;
}
}
void VerifyFramesAreEqual(const AudioFrame& frame1, const AudioFrame& frame2) {
EXPECT_EQ(frame1.num_channels_, frame2.num_channels_);
- EXPECT_EQ(frame1.samples_per_channel_,
- frame2.samples_per_channel_);
+ EXPECT_EQ(frame1.samples_per_channel_, frame2.samples_per_channel_);
const int16_t* frame1_data = frame1.data();
const int16_t* frame2_data = frame2.data();
for (size_t i = 0; i < frame1.samples_per_channel_ * frame1.num_channels_;
- i++) {
+ i++) {
EXPECT_EQ(frame1_data[i], frame2_data[i]);
}
EXPECT_EQ(frame1.muted(), frame2.muted());
}
-void InitFrame(AudioFrame* frame, size_t channels, size_t samples_per_channel,
- int16_t left_data, int16_t right_data) {
+void InitFrame(AudioFrame* frame,
+ size_t channels,
+ size_t samples_per_channel,
+ int16_t left_data,
+ int16_t right_data) {
RTC_DCHECK(frame);
RTC_DCHECK_GE(2, channels);
RTC_DCHECK_GE(AudioFrame::kMaxDataSizeSamples,
@@ -90,7 +92,9 @@
return frame.data()[index * frame.num_channels_ + channel];
}
-void VerifyFrameDataBounds(const AudioFrame& frame, size_t channel, int16_t max,
+void VerifyFrameDataBounds(const AudioFrame& frame,
+ size_t channel,
+ int16_t max,
int16_t min) {
for (size_t i = 0; i < frame.samples_per_channel_; ++i) {
int16_t s = GetChannelData(frame, channel, i);