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

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

Issue 2750783004: Add mute state field to AudioFrame. (Closed)
Patch Set: Update new usages of AudioFrame::data_ Created 3 years, 6 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 sync_buffer.GetNextAudioInterleaved(kNewLen / 2, &output1); 147 sync_buffer.GetNextAudioInterleaved(kNewLen / 2, &output1);
148 EXPECT_EQ(kChannels, output1.num_channels_); 148 EXPECT_EQ(kChannels, output1.num_channels_);
149 EXPECT_EQ(kNewLen / 2, output1.samples_per_channel_); 149 EXPECT_EQ(kNewLen / 2, output1.samples_per_channel_);
150 150
151 AudioFrame output2; 151 AudioFrame output2;
152 sync_buffer.GetNextAudioInterleaved(kNewLen / 2, &output2); 152 sync_buffer.GetNextAudioInterleaved(kNewLen / 2, &output2);
153 EXPECT_EQ(kChannels, output2.num_channels_); 153 EXPECT_EQ(kChannels, output2.num_channels_);
154 EXPECT_EQ(kNewLen / 2, output2.samples_per_channel_); 154 EXPECT_EQ(kNewLen / 2, output2.samples_per_channel_);
155 155
156 // Verify the data. 156 // Verify the data.
157 int16_t* output_ptr = output1.data_; 157 const int16_t* output_ptr = output1.data();
158 for (size_t i = 0; i < kNewLen / 2; ++i) { 158 for (size_t i = 0; i < kNewLen / 2; ++i) {
159 for (size_t channel = 0; channel < kChannels; ++channel) { 159 for (size_t channel = 0; channel < kChannels; ++channel) {
160 EXPECT_EQ(new_data[channel][i], *output_ptr); 160 EXPECT_EQ(new_data[channel][i], *output_ptr);
161 ++output_ptr; 161 ++output_ptr;
162 } 162 }
163 } 163 }
164 output_ptr = output2.data_; 164 output_ptr = output2.data();
165 for (size_t i = kNewLen / 2; i < kNewLen; ++i) { 165 for (size_t i = kNewLen / 2; i < kNewLen; ++i) {
166 for (size_t channel = 0; channel < kChannels; ++channel) { 166 for (size_t channel = 0; channel < kChannels; ++channel) {
167 EXPECT_EQ(new_data[channel][i], *output_ptr); 167 EXPECT_EQ(new_data[channel][i], *output_ptr);
168 ++output_ptr; 168 ++output_ptr;
169 } 169 }
170 } 170 }
171 } 171 }
172 172
173 } // namespace webrtc 173 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/sync_buffer.cc ('k') | webrtc/modules/audio_coding/neteq/tools/audio_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698