| OLD | NEW |
| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 for (int n = 0; n < samples; ++n) { | 137 for (int n = 0; n < samples; ++n) { |
| 138 in_audio_frame.data_[n] = kAmp; | 138 in_audio_frame.data_[n] = kAmp; |
| 139 } | 139 } |
| 140 | 140 |
| 141 uint32_t timestamp = 0; | 141 uint32_t timestamp = 0; |
| 142 double rms = 0; | 142 double rms = 0; |
| 143 ASSERT_EQ(0, acm_a_->RegisterSendCodec(codec)); | 143 ASSERT_EQ(0, acm_a_->RegisterSendCodec(codec)); |
| 144 acm_b_->SetInitialPlayoutDelay(initial_delay_ms); | 144 acm_b_->SetInitialPlayoutDelay(initial_delay_ms); |
| 145 while (rms < kAmp / 2) { | 145 while (rms < kAmp / 2) { |
| 146 in_audio_frame.timestamp_ = timestamp; | 146 in_audio_frame.timestamp_ = timestamp; |
| 147 timestamp += in_audio_frame.samples_per_channel_; | 147 timestamp += static_cast<uint32_t>(in_audio_frame.samples_per_channel_); |
| 148 ASSERT_GE(acm_a_->Add10MsData(in_audio_frame), 0); | 148 ASSERT_GE(acm_a_->Add10MsData(in_audio_frame), 0); |
| 149 ASSERT_EQ(0, acm_b_->PlayoutData10Ms(codec.plfreq, &out_audio_frame)); | 149 ASSERT_EQ(0, acm_b_->PlayoutData10Ms(codec.plfreq, &out_audio_frame)); |
| 150 rms = FrameRms(out_audio_frame); | 150 rms = FrameRms(out_audio_frame); |
| 151 ++num_frames; | 151 ++num_frames; |
| 152 } | 152 } |
| 153 | 153 |
| 154 ASSERT_GE(num_frames * 10, initial_delay_ms); | 154 ASSERT_GE(num_frames * 10, initial_delay_ms); |
| 155 ASSERT_LE(num_frames * 10, initial_delay_ms + 100); | 155 ASSERT_LE(num_frames * 10, initial_delay_ms + 100); |
| 156 } | 156 } |
| 157 | 157 |
| 158 rtc::scoped_ptr<AudioCodingModule> acm_a_; | 158 rtc::scoped_ptr<AudioCodingModule> acm_a_; |
| 159 rtc::scoped_ptr<AudioCodingModule> acm_b_; | 159 rtc::scoped_ptr<AudioCodingModule> acm_b_; |
| 160 Channel* channel_a2b_; | 160 Channel* channel_a2b_; |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 TEST_F(InitialPlayoutDelayTest, NbMono) { NbMono(); } | 163 TEST_F(InitialPlayoutDelayTest, NbMono) { NbMono(); } |
| 164 | 164 |
| 165 TEST_F(InitialPlayoutDelayTest, WbMono) { WbMono(); } | 165 TEST_F(InitialPlayoutDelayTest, WbMono) { WbMono(); } |
| 166 | 166 |
| 167 TEST_F(InitialPlayoutDelayTest, SwbMono) { SwbMono(); } | 167 TEST_F(InitialPlayoutDelayTest, SwbMono) { SwbMono(); } |
| 168 | 168 |
| 169 TEST_F(InitialPlayoutDelayTest, NbStereo) { NbStereo(); } | 169 TEST_F(InitialPlayoutDelayTest, NbStereo) { NbStereo(); } |
| 170 | 170 |
| 171 TEST_F(InitialPlayoutDelayTest, WbStereo) { WbStereo(); } | 171 TEST_F(InitialPlayoutDelayTest, WbStereo) { WbStereo(); } |
| 172 | 172 |
| 173 TEST_F(InitialPlayoutDelayTest, SwbStereo) { SwbStereo(); } | 173 TEST_F(InitialPlayoutDelayTest, SwbStereo) { SwbStereo(); } |
| 174 | 174 |
| 175 } // namespace webrtc | 175 } // namespace webrtc |
| OLD | NEW |