OLD | NEW |
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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 | 315 |
316 EXPECT_EQ(0, module1->RegisterSendPayload(voice_codec)); | 316 EXPECT_EQ(0, module1->RegisterSendPayload(voice_codec)); |
317 EXPECT_EQ(0, rtp_receiver2_->RegisterReceivePayload( | 317 EXPECT_EQ(0, rtp_receiver2_->RegisterReceivePayload( |
318 voice_codec.plname, | 318 voice_codec.plname, |
319 voice_codec.pltype, | 319 voice_codec.pltype, |
320 voice_codec.plfreq, | 320 voice_codec.plfreq, |
321 voice_codec.channels, | 321 voice_codec.channels, |
322 (voice_codec.rate < 0) ? 0 : voice_codec.rate)); | 322 (voice_codec.rate < 0) ? 0 : voice_codec.rate)); |
323 | 323 |
324 // Start DTMF test. | 324 // Start DTMF test. |
325 uint32_t timeStamp = 160; | 325 int timeStamp = 160; |
326 | 326 |
327 // Send a DTMF tone using RFC 2833 (4733). | 327 // Send a DTMF tone using RFC 2833 (4733). |
328 for (int i = 0; i < 16; i++) { | 328 for (int i = 0; i < 16; i++) { |
329 EXPECT_EQ(0, module1->SendTelephoneEventOutband(i, timeStamp, 10)); | 329 EXPECT_EQ(0, module1->SendTelephoneEventOutband(i, timeStamp, 10)); |
330 } | 330 } |
331 timeStamp += 160; // Prepare for next packet. | 331 timeStamp += 160; // Prepare for next packet. |
332 | 332 |
333 const uint8_t test[9] = "test"; | 333 const uint8_t test[9] = "test"; |
334 | 334 |
335 // Send RTP packets for 16 tones a 160 ms 100ms | 335 // Send RTP packets for 16 tones a 160 ms 100ms |
336 // pause between = 2560ms + 1600ms = 4160ms | 336 // pause between = 2560ms + 1600ms = 4160ms |
337 for (; timeStamp <= 250 * 160; timeStamp += 160) { | 337 for (; timeStamp <= 250 * 160; timeStamp += 160) { |
338 EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96, | 338 EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96, |
339 timeStamp, -1, test, 4)); | 339 timeStamp, -1, test, 4)); |
340 fake_clock.AdvanceTimeMilliseconds(20); | 340 fake_clock.AdvanceTimeMilliseconds(20); |
341 module1->Process(); | 341 module1->Process(); |
342 } | 342 } |
343 EXPECT_EQ(0, module1->SendTelephoneEventOutband(32, 9000, 10)); | 343 EXPECT_EQ(0, module1->SendTelephoneEventOutband(32, 9000, 10)); |
344 | 344 |
345 for (; timeStamp <= 740 * 160; timeStamp += 160) { | 345 for (; timeStamp <= 740 * 160; timeStamp += 160) { |
346 EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96, | 346 EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 96, |
347 timeStamp, -1, test, 4)); | 347 timeStamp, -1, test, 4)); |
348 fake_clock.AdvanceTimeMilliseconds(20); | 348 fake_clock.AdvanceTimeMilliseconds(20); |
349 module1->Process(); | 349 module1->Process(); |
350 } | 350 } |
351 } | 351 } |
352 | 352 |
353 } // namespace | 353 } // namespace |
354 } // namespace webrtc | 354 } // namespace webrtc |
OLD | NEW |