Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Side by Side Diff: webrtc/modules/audio_coding/neteq/neteq_external_decoder_unittest.cc

Issue 1316523002: Convert channel counts to size_t. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Fix compile Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 181
182 void SetUp() override { 182 void SetUp() override {
183 ASSERT_EQ(NetEq::kOK, neteq_internal_->RegisterPayloadType( 183 ASSERT_EQ(NetEq::kOK, neteq_internal_->RegisterPayloadType(
184 NetEqDecoder::kDecoderPCM16Bswb32kHz, 184 NetEqDecoder::kDecoderPCM16Bswb32kHz,
185 "pcm16-swb32", kPayloadType)); 185 "pcm16-swb32", kPayloadType));
186 } 186 }
187 187
188 void GetAndVerifyOutput() override { 188 void GetAndVerifyOutput() override {
189 NetEqOutputType output_type; 189 NetEqOutputType output_type;
190 size_t samples_per_channel; 190 size_t samples_per_channel;
191 int num_channels; 191 size_t num_channels;
192 // Get audio from internal decoder instance. 192 // Get audio from internal decoder instance.
193 EXPECT_EQ(NetEq::kOK, 193 EXPECT_EQ(NetEq::kOK,
194 neteq_internal_->GetAudio(kMaxBlockSize, 194 neteq_internal_->GetAudio(kMaxBlockSize,
195 output_internal_, 195 output_internal_,
196 &samples_per_channel, 196 &samples_per_channel,
197 &num_channels, 197 &num_channels,
198 &output_type)); 198 &output_type));
199 EXPECT_EQ(1, num_channels); 199 EXPECT_EQ(1u, num_channels);
200 EXPECT_EQ(static_cast<size_t>(kOutputLengthMs * sample_rate_hz_ / 1000), 200 EXPECT_EQ(static_cast<size_t>(kOutputLengthMs * sample_rate_hz_ / 1000),
201 samples_per_channel); 201 samples_per_channel);
202 202
203 // Get audio from external decoder instance. 203 // Get audio from external decoder instance.
204 samples_per_channel = GetOutputAudio(kMaxBlockSize, output_, &output_type); 204 samples_per_channel = GetOutputAudio(kMaxBlockSize, output_, &output_type);
205 205
206 for (size_t i = 0; i < samples_per_channel; ++i) { 206 for (size_t i = 0; i < samples_per_channel; ++i) {
207 ASSERT_EQ(output_[i], output_internal_[i]) << 207 ASSERT_EQ(output_[i], output_internal_[i]) <<
208 "Diff in sample " << i << "."; 208 "Diff in sample " << i << ".";
209 } 209 }
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 kStartSeqeunceNumber, 450 kStartSeqeunceNumber,
451 kStartTimestamp, 451 kStartTimestamp,
452 kJumpFromTimestamp, 452 kJumpFromTimestamp,
453 kJumpToTimestamp)); 453 kJumpToTimestamp));
454 454
455 RunTest(130); // Run 130 laps @ 10 ms each in the test loop. 455 RunTest(130); // Run 130 laps @ 10 ms each in the test loop.
456 EXPECT_EQ(kRecovered, test_state_); 456 EXPECT_EQ(kRecovered, test_state_);
457 } 457 }
458 458
459 } // namespace webrtc 459 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/include/neteq.h ('k') | webrtc/modules/audio_coding/neteq/neteq_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698