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

Side by Side Diff: webrtc/modules/rtp_rtcp/test/testAPI/test_api_audio.cc

Issue 1782053002: Relanding https://codereview.webrtc.org/1715883002/ in pieces. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 9 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
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.cc ('k') | webrtc/test/mock_voe_channel_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.cc ('k') | webrtc/test/mock_voe_channel_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698