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

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

Issue 1493403003: modules/rtp_rtcp/include folder cleared of lint warnings (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years 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/modules/rtp_rtcp/source/rtp_rtcp_impl.cc ('k') | webrtc/video/vie_channel.cc » ('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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 module1->SetSSRC(test_ssrc); 234 module1->SetSSRC(test_ssrc);
235 module1->SetStartTimestamp(test_timestamp); 235 module1->SetStartTimestamp(test_timestamp);
236 EXPECT_EQ(0, module1->SetSendingStatus(true)); 236 EXPECT_EQ(0, module1->SetSendingStatus(true));
237 237
238 voice_codec.pltype = 127; 238 voice_codec.pltype = 127;
239 voice_codec.plfreq = 8000; 239 voice_codec.plfreq = 8000;
240 memcpy(voice_codec.plname, "RED", 4); 240 memcpy(voice_codec.plname, "RED", 4);
241 241
242 EXPECT_EQ(0, module1->SetSendREDPayloadType(voice_codec.pltype)); 242 EXPECT_EQ(0, module1->SetSendREDPayloadType(voice_codec.pltype));
243 int8_t red = 0; 243 int8_t red = 0;
244 EXPECT_EQ(0, module1->SendREDPayloadType(red)); 244 EXPECT_EQ(0, module1->SendREDPayloadType(&red));
245 EXPECT_EQ(voice_codec.pltype, red); 245 EXPECT_EQ(voice_codec.pltype, red);
246 EXPECT_EQ(0, rtp_receiver1_->RegisterReceivePayload( 246 EXPECT_EQ(0, rtp_receiver1_->RegisterReceivePayload(
247 voice_codec.plname, 247 voice_codec.plname,
248 voice_codec.pltype, 248 voice_codec.pltype,
249 voice_codec.plfreq, 249 voice_codec.plfreq,
250 voice_codec.channels, 250 voice_codec.channels,
251 (voice_codec.rate < 0) ? 0 : voice_codec.rate)); 251 (voice_codec.rate < 0) ? 0 : voice_codec.rate));
252 EXPECT_EQ(0, rtp_receiver2_->RegisterReceivePayload( 252 EXPECT_EQ(0, rtp_receiver2_->RegisterReceivePayload(
253 voice_codec.plname, 253 voice_codec.plname,
254 voice_codec.pltype, 254 voice_codec.pltype,
(...skipping 16 matching lines...) Expand all
271 fragmentation.fragmentationPlType[0] = 96; 271 fragmentation.fragmentationPlType[0] = 96;
272 fragmentation.fragmentationPlType[1] = 96; 272 fragmentation.fragmentationPlType[1] = 96;
273 273
274 const uint8_t test[5] = "test"; 274 const uint8_t test[5] = "test";
275 // Send a RTP packet. 275 // Send a RTP packet.
276 EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech, 276 EXPECT_EQ(0, module1->SendOutgoingData(webrtc::kAudioFrameSpeech,
277 96, 160, -1, test, 4, 277 96, 160, -1, test, 4,
278 &fragmentation)); 278 &fragmentation));
279 279
280 EXPECT_EQ(0, module1->SetSendREDPayloadType(-1)); 280 EXPECT_EQ(0, module1->SetSendREDPayloadType(-1));
281 EXPECT_EQ(-1, module1->SendREDPayloadType(red)); 281 EXPECT_EQ(-1, module1->SendREDPayloadType(&red));
282 } 282 }
283 283
284 TEST_F(RtpRtcpAudioTest, DTMF) { 284 TEST_F(RtpRtcpAudioTest, DTMF) {
285 CodecInst voice_codec; 285 CodecInst voice_codec;
286 memset(&voice_codec, 0, sizeof(voice_codec)); 286 memset(&voice_codec, 0, sizeof(voice_codec));
287 voice_codec.pltype = 96; 287 voice_codec.pltype = 96;
288 voice_codec.plfreq = 8000; 288 voice_codec.plfreq = 8000;
289 memcpy(voice_codec.plname, "PCMU", 5); 289 memcpy(voice_codec.plname, "PCMU", 5);
290 290
291 EXPECT_EQ(0, module1->RegisterSendPayload(voice_codec)); 291 EXPECT_EQ(0, module1->RegisterSendPayload(voice_codec));
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc ('k') | webrtc/video/vie_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698