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

Side by Side Diff: webrtc/modules/audio_coding/test/TestRedFec.cc

Issue 2390883004: Hooking up audio network adaptor to VoE. (Closed)
Patch Set: on Karl's comments Created 4 years, 2 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
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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 334
335 #if defined(SUPPORT_RED_FB) && defined(SUPPORT_RED_SWB) &&\ 335 #if defined(SUPPORT_RED_FB) && defined(SUPPORT_RED_SWB) &&\
336 defined(SUPPORT_RED_WB) 336 defined(SUPPORT_RED_WB)
337 // Switch to codec, RED should remain switched on. 337 // Switch to codec, RED should remain switched on.
338 EXPECT_TRUE(_acmA->REDStatus()); 338 EXPECT_TRUE(_acmA->REDStatus());
339 #else 339 #else
340 EXPECT_FALSE(_acmA->REDStatus()); 340 EXPECT_FALSE(_acmA->REDStatus());
341 #endif 341 #endif
342 342
343 // _channelA2B imposes 25% packet loss rate. 343 // _channelA2B imposes 25% packet loss rate.
344 EXPECT_EQ(0, _acmA->SetPacketLossRate(25)); 344 _acmA->ModifyEncoder([&](std::unique_ptr<AudioEncoder>* encoder) {
345 EXPECT_TRUE(*encoder);
346 (*encoder)->SetProjectedPacketLossRate(25.0 / 100.0);
kwiberg-webrtc 2016/10/11 10:18:42 Why is "25.0 / 100.0" better than just "0.25"?
minyue-webrtc 2016/10/11 10:38:35 sure. of course.
347 });
345 348
346 #ifdef SUPPORT_RED_FB 349 #ifdef SUPPORT_RED_FB
347 EXPECT_EQ(0, _acmA->SetREDStatus(true)); 350 EXPECT_EQ(0, _acmA->SetREDStatus(true));
348 EXPECT_TRUE(_acmA->REDStatus()); 351 EXPECT_TRUE(_acmA->REDStatus());
349 // Codec FEC and RED are mutually exclusive. 352 // Codec FEC and RED are mutually exclusive.
350 EXPECT_EQ(-1, _acmA->SetCodecFEC(true)); 353 EXPECT_EQ(-1, _acmA->SetCodecFEC(true));
351 354
352 EXPECT_EQ(0, _acmA->SetREDStatus(false)); 355 EXPECT_EQ(0, _acmA->SetREDStatus(false));
353 EXPECT_EQ(0, _acmA->SetCodecFEC(true)); 356 EXPECT_EQ(0, _acmA->SetCodecFEC(true));
354 357
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 std::string file_name; 475 std::string file_name;
473 std::stringstream file_stream; 476 std::stringstream file_stream;
474 file_stream << webrtc::test::OutputPath(); 477 file_stream << webrtc::test::OutputPath();
475 file_stream << "TestRedFec_outFile_"; 478 file_stream << "TestRedFec_outFile_";
476 file_stream << test_number << ".pcm"; 479 file_stream << test_number << ".pcm";
477 file_name = file_stream.str(); 480 file_name = file_stream.str();
478 _outFileB.Open(file_name, 16000, "wb"); 481 _outFileB.Open(file_name, 16000, "wb");
479 } 482 }
480 483
481 } // namespace webrtc 484 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698