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

Side by Side Diff: webrtc/video/rampup_tests.cc

Issue 1273363005: Add send transports to individual webrtc::Call streams. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase+comment Created 5 years, 3 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/video/packet_injection_tests.cc ('k') | webrtc/video/replay.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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 bool rtx, 374 bool rtx,
375 bool red) { 375 bool red) {
376 std::vector<uint32_t> ssrcs(GenerateSsrcs(num_streams, 100)); 376 std::vector<uint32_t> ssrcs(GenerateSsrcs(num_streams, 100));
377 std::vector<uint32_t> rtx_ssrcs(GenerateSsrcs(num_streams, 200)); 377 std::vector<uint32_t> rtx_ssrcs(GenerateSsrcs(num_streams, 200));
378 StreamObserver::SsrcMap rtx_ssrc_map; 378 StreamObserver::SsrcMap rtx_ssrc_map;
379 if (rtx) { 379 if (rtx) {
380 for (size_t i = 0; i < ssrcs.size(); ++i) 380 for (size_t i = 0; i < ssrcs.size(); ++i)
381 rtx_ssrc_map[rtx_ssrcs[i]] = ssrcs[i]; 381 rtx_ssrc_map[rtx_ssrcs[i]] = ssrcs[i];
382 } 382 }
383 383
384 CreateSendConfig(num_streams);
385 send_config_.rtp.extensions.clear();
386
387 test::DirectTransport receiver_transport; 384 test::DirectTransport receiver_transport;
388 StreamObserver stream_observer(rtx_ssrc_map, &receiver_transport, 385 StreamObserver stream_observer(rtx_ssrc_map, &receiver_transport,
389 Clock::GetRealTimeClock()); 386 Clock::GetRealTimeClock());
390 387
388 CreateSendConfig(num_streams, &stream_observer);
389 send_config_.rtp.extensions.clear();
390
391 if (extension_type == RtpExtension::kAbsSendTime) { 391 if (extension_type == RtpExtension::kAbsSendTime) {
392 stream_observer.SetRemoteBitrateEstimator( 392 stream_observer.SetRemoteBitrateEstimator(
393 new RemoteBitrateEstimatorAbsSendTime( 393 new RemoteBitrateEstimatorAbsSendTime(
394 &stream_observer, Clock::GetRealTimeClock(), 394 &stream_observer, Clock::GetRealTimeClock(),
395 kRemoteBitrateEstimatorMinBitrateBps)); 395 kRemoteBitrateEstimatorMinBitrateBps));
396 send_config_.rtp.extensions.push_back(RtpExtension( 396 send_config_.rtp.extensions.push_back(RtpExtension(
397 extension_type.c_str(), kAbsSendTimeExtensionId)); 397 extension_type.c_str(), kAbsSendTimeExtensionId));
398 } else { 398 } else {
399 stream_observer.SetRemoteBitrateEstimator( 399 stream_observer.SetRemoteBitrateEstimator(
400 new RemoteBitrateEstimatorSingleStream( 400 new RemoteBitrateEstimatorSingleStream(
401 &stream_observer, Clock::GetRealTimeClock(), 401 &stream_observer, Clock::GetRealTimeClock(),
402 kRemoteBitrateEstimatorMinBitrateBps)); 402 kRemoteBitrateEstimatorMinBitrateBps));
403 send_config_.rtp.extensions.push_back(RtpExtension( 403 send_config_.rtp.extensions.push_back(RtpExtension(
404 extension_type.c_str(), kTransmissionTimeOffsetExtensionId)); 404 extension_type.c_str(), kTransmissionTimeOffsetExtensionId));
405 } 405 }
406 406
407 Call::Config call_config(&stream_observer); 407 Call::Config call_config;
408 if (start_bitrate_bps != 0) { 408 if (start_bitrate_bps != 0) {
409 call_config.bitrate_config.start_bitrate_bps = start_bitrate_bps; 409 call_config.bitrate_config.start_bitrate_bps = start_bitrate_bps;
410 stream_observer.set_start_bitrate_bps(start_bitrate_bps); 410 stream_observer.set_start_bitrate_bps(start_bitrate_bps);
411 } 411 }
412
413 CreateSenderCall(call_config); 412 CreateSenderCall(call_config);
414 413
415 receiver_transport.SetReceiver(sender_call_->Receiver()); 414 receiver_transport.SetReceiver(sender_call_->Receiver());
416 415
417 if (num_streams == 1) { 416 if (num_streams == 1) {
418 encoder_config_.streams[0].target_bitrate_bps = 2000000; 417 encoder_config_.streams[0].target_bitrate_bps = 2000000;
419 encoder_config_.streams[0].max_bitrate_bps = 2000000; 418 encoder_config_.streams[0].max_bitrate_bps = 2000000;
420 } 419 }
421 420
422 send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs; 421 send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 DestroyStreams(); 454 DestroyStreams();
456 } 455 }
457 456
458 void RampUpTest::RunRampUpDownUpTest(size_t number_of_streams, 457 void RampUpTest::RunRampUpDownUpTest(size_t number_of_streams,
459 bool rtx, 458 bool rtx,
460 bool red) { 459 bool red) {
461 test::DirectTransport receiver_transport; 460 test::DirectTransport receiver_transport;
462 LowRateStreamObserver stream_observer( 461 LowRateStreamObserver stream_observer(
463 &receiver_transport, Clock::GetRealTimeClock(), number_of_streams, rtx); 462 &receiver_transport, Clock::GetRealTimeClock(), number_of_streams, rtx);
464 463
465 Call::Config call_config(&stream_observer); 464 Call::Config call_config;
466 call_config.bitrate_config.start_bitrate_bps = 60000; 465 call_config.bitrate_config.start_bitrate_bps = 60000;
467 CreateSenderCall(call_config); 466 CreateSenderCall(call_config);
468 receiver_transport.SetReceiver(sender_call_->Receiver()); 467 receiver_transport.SetReceiver(sender_call_->Receiver());
469 468
470 CreateSendConfig(number_of_streams); 469 CreateSendConfig(number_of_streams, &stream_observer);
471 470
472 send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs; 471 send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs;
473 send_config_.rtp.extensions.push_back(RtpExtension( 472 send_config_.rtp.extensions.push_back(RtpExtension(
474 RtpExtension::kAbsSendTime, kAbsSendTimeExtensionId)); 473 RtpExtension::kAbsSendTime, kAbsSendTimeExtensionId));
475 send_config_.suspend_below_min_bitrate = true; 474 send_config_.suspend_below_min_bitrate = true;
476 475
477 if (rtx) { 476 if (rtx) {
478 send_config_.rtp.rtx.payload_type = kSendRtxPayloadType; 477 send_config_.rtp.rtx.payload_type = kSendRtxPayloadType;
479 send_config_.rtp.rtx.ssrcs = GenerateSsrcs(number_of_streams, 200); 478 send_config_.rtp.rtx.ssrcs = GenerateSsrcs(number_of_streams, 200);
480 } 479 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 554
556 TEST_F(RampUpTest, AbsSendTimeSimulcastByRedWithRtx) { 555 TEST_F(RampUpTest, AbsSendTimeSimulcastByRedWithRtx) {
557 RunRampUpTest(3, 0, RtpExtension::kAbsSendTime, true, true); 556 RunRampUpTest(3, 0, RtpExtension::kAbsSendTime, true, true);
558 } 557 }
559 558
560 TEST_F(RampUpTest, AbsSendTimeSingleStreamWithHighStartBitrate) { 559 TEST_F(RampUpTest, AbsSendTimeSingleStreamWithHighStartBitrate) {
561 RunRampUpTest(1, 0.9 * kSingleStreamTargetBps, RtpExtension::kAbsSendTime, 560 RunRampUpTest(1, 0.9 * kSingleStreamTargetBps, RtpExtension::kAbsSendTime,
562 false, false); 561 false, false);
563 } 562 }
564 } // namespace webrtc 563 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/packet_injection_tests.cc ('k') | webrtc/video/replay.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698