OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 ASSERT_EQ(0, acm_->RegisterReceiveCodec(my_codec_param)) | 137 ASSERT_EQ(0, acm_->RegisterReceiveCodec(my_codec_param)) |
138 << "Couldn't register receive codec.\n"; | 138 << "Couldn't register receive codec.\n"; |
139 } | 139 } |
140 } | 140 } |
141 } | 141 } |
142 | 142 |
143 int AcmReceiveTestOldApi::RegisterExternalReceiveCodec( | 143 int AcmReceiveTestOldApi::RegisterExternalReceiveCodec( |
144 int rtp_payload_type, | 144 int rtp_payload_type, |
145 AudioDecoder* external_decoder, | 145 AudioDecoder* external_decoder, |
146 int sample_rate_hz, | 146 int sample_rate_hz, |
147 int num_channels) { | 147 int num_channels, |
| 148 const std::string& name) { |
148 return acm_->RegisterExternalReceiveCodec(rtp_payload_type, external_decoder, | 149 return acm_->RegisterExternalReceiveCodec(rtp_payload_type, external_decoder, |
149 sample_rate_hz, num_channels); | 150 sample_rate_hz, num_channels, name); |
150 } | 151 } |
151 | 152 |
152 void AcmReceiveTestOldApi::Run() { | 153 void AcmReceiveTestOldApi::Run() { |
153 for (rtc::scoped_ptr<Packet> packet(packet_source_->NextPacket()); packet; | 154 for (rtc::scoped_ptr<Packet> packet(packet_source_->NextPacket()); packet; |
154 packet.reset(packet_source_->NextPacket())) { | 155 packet.reset(packet_source_->NextPacket())) { |
155 // Pull audio until time to insert packet. | 156 // Pull audio until time to insert packet. |
156 while (clock_.TimeInMilliseconds() < packet->time_ms()) { | 157 while (clock_.TimeInMilliseconds() < packet->time_ms()) { |
157 AudioFrame output_frame; | 158 AudioFrame output_frame; |
158 EXPECT_EQ(0, acm_->PlayoutData10Ms(output_freq_hz_, &output_frame)); | 159 EXPECT_EQ(0, acm_->PlayoutData10Ms(output_freq_hz_, &output_frame)); |
159 EXPECT_EQ(output_freq_hz_, output_frame.sample_rate_hz_); | 160 EXPECT_EQ(output_freq_hz_, output_frame.sample_rate_hz_); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 if (clock_.TimeInMilliseconds() >= last_toggle_time_ms_ + toggle_period_ms_) { | 213 if (clock_.TimeInMilliseconds() >= last_toggle_time_ms_ + toggle_period_ms_) { |
213 output_freq_hz_ = (output_freq_hz_ == output_freq_hz_1_) | 214 output_freq_hz_ = (output_freq_hz_ == output_freq_hz_1_) |
214 ? output_freq_hz_2_ | 215 ? output_freq_hz_2_ |
215 : output_freq_hz_1_; | 216 : output_freq_hz_1_; |
216 last_toggle_time_ms_ = clock_.TimeInMilliseconds(); | 217 last_toggle_time_ms_ = clock_.TimeInMilliseconds(); |
217 } | 218 } |
218 } | 219 } |
219 | 220 |
220 } // namespace test | 221 } // namespace test |
221 } // namespace webrtc | 222 } // namespace webrtc |
OLD | NEW |