Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #include <stdio.h> | 10 #include <stdio.h> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 size_t width, height; | 47 size_t width, height; |
| 48 int fps; | 48 int fps; |
| 49 } clip; | 49 } clip; |
| 50 bool screenshare; | 50 bool screenshare; |
| 51 int min_bitrate_bps; | 51 int min_bitrate_bps; |
| 52 int target_bitrate_bps; | 52 int target_bitrate_bps; |
| 53 int max_bitrate_bps; | 53 int max_bitrate_bps; |
| 54 double avg_psnr_threshold; | 54 double avg_psnr_threshold; |
| 55 double avg_ssim_threshold; | 55 double avg_ssim_threshold; |
| 56 int test_durations_secs; | 56 int test_durations_secs; |
| 57 std::string codec; | |
| 57 FakeNetworkPipe::Config link; | 58 FakeNetworkPipe::Config link; |
| 58 }; | 59 }; |
| 59 | 60 |
| 60 class FullStackTest : public test::CallTest { | 61 class FullStackTest : public test::CallTest { |
| 61 protected: | 62 protected: |
| 62 void RunTest(const FullStackTestParams& params); | 63 void RunTest(const FullStackTestParams& params); |
| 63 }; | 64 }; |
| 64 | 65 |
| 65 class VideoAnalyzer : public PacketReceiver, | 66 class VideoAnalyzer : public PacketReceiver, |
| 66 public newapi::Transport, | 67 public newapi::Transport, |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 214 | 215 |
| 215 bool IsTextureSupported() const override { return false; } | 216 bool IsTextureSupported() const override { return false; } |
| 216 | 217 |
| 217 void Wait() { | 218 void Wait() { |
| 218 // Frame comparisons can be very expensive. Wait for test to be done, but | 219 // Frame comparisons can be very expensive. Wait for test to be done, but |
| 219 // at time-out check if frames_processed is going up. If so, give it more | 220 // at time-out check if frames_processed is going up. If so, give it more |
| 220 // time, otherwise fail. Hopefully this will reduce test flakiness. | 221 // time, otherwise fail. Hopefully this will reduce test flakiness. |
| 221 | 222 |
| 222 int last_frames_processed = -1; | 223 int last_frames_processed = -1; |
| 223 EventTypeWrapper eventType; | 224 EventTypeWrapper eventType; |
| 224 while ((eventType = done_->Wait(FullStackTest::kDefaultTimeoutMs)) != | 225 while ((eventType = done_->Wait(FullStackTest::kLongTimeoutMs)) != |
| 225 kEventSignaled) { | 226 kEventSignaled) { |
| 226 int frames_processed; | 227 int frames_processed; |
| 227 { | 228 { |
| 228 rtc::CritScope crit(&comparison_lock_); | 229 rtc::CritScope crit(&comparison_lock_); |
| 229 frames_processed = frames_processed_; | 230 frames_processed = frames_processed_; |
| 230 } | 231 } |
| 231 if (last_frames_processed == -1) { | 232 if (last_frames_processed == -1) { |
| 232 last_frames_processed = frames_processed; | 233 last_frames_processed = frames_processed; |
| 233 continue; | 234 continue; |
| 234 } | 235 } |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 492 params.test_durations_secs * params.clip.fps); | 493 params.test_durations_secs * params.clip.fps); |
| 493 | 494 |
| 494 CreateCalls(Call::Config(&analyzer), Call::Config(&recv_transport)); | 495 CreateCalls(Call::Config(&analyzer), Call::Config(&recv_transport)); |
| 495 | 496 |
| 496 analyzer.SetReceiver(receiver_call_->Receiver()); | 497 analyzer.SetReceiver(receiver_call_->Receiver()); |
| 497 send_transport.SetReceiver(&analyzer); | 498 send_transport.SetReceiver(&analyzer); |
| 498 recv_transport.SetReceiver(sender_call_->Receiver()); | 499 recv_transport.SetReceiver(sender_call_->Receiver()); |
| 499 | 500 |
| 500 CreateSendConfig(1); | 501 CreateSendConfig(1); |
| 501 | 502 |
| 502 rtc::scoped_ptr<VideoEncoder> encoder( | 503 rtc::scoped_ptr<VideoEncoder> encoder; |
| 503 VideoEncoder::Create(VideoEncoder::kVp8)); | 504 if (params.codec == "VP8") { |
| 504 send_config_.encoder_settings.encoder = encoder.get(); | 505 encoder = |
| 505 send_config_.encoder_settings.payload_name = "VP8"; | 506 rtc::scoped_ptr<VideoEncoder>(VideoEncoder::Create(VideoEncoder::kVp8)); |
| 507 send_config_.encoder_settings.encoder = encoder.get(); | |
| 508 send_config_.encoder_settings.payload_name = "VP8"; | |
| 509 } else if (params.codec == "VP9") { | |
| 510 encoder = | |
| 511 rtc::scoped_ptr<VideoEncoder>(VideoEncoder::Create(VideoEncoder::kVp9)); | |
| 512 send_config_.encoder_settings.encoder = encoder.get(); | |
| 513 send_config_.encoder_settings.payload_name = "VP9"; | |
| 514 } else { | |
| 515 RTC_NOTREACHED() << "Codec not supported!"; | |
| 516 return; | |
| 517 } | |
| 506 send_config_.encoder_settings.payload_type = 124; | 518 send_config_.encoder_settings.payload_type = 124; |
| 519 | |
| 507 send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs; | 520 send_config_.rtp.nack.rtp_history_ms = kNackRtpHistoryMs; |
| 508 send_config_.rtp.rtx.ssrcs.push_back(kSendRtxSsrcs[0]); | 521 send_config_.rtp.rtx.ssrcs.push_back(kSendRtxSsrcs[0]); |
| 509 send_config_.rtp.rtx.payload_type = kSendRtxPayloadType; | 522 send_config_.rtp.rtx.payload_type = kSendRtxPayloadType; |
| 510 | 523 |
| 511 VideoStream* stream = &encoder_config_.streams[0]; | 524 VideoStream* stream = &encoder_config_.streams[0]; |
| 512 stream->width = params.clip.width; | 525 stream->width = params.clip.width; |
| 513 stream->height = params.clip.height; | 526 stream->height = params.clip.height; |
| 514 stream->min_bitrate_bps = params.min_bitrate_bps; | 527 stream->min_bitrate_bps = params.min_bitrate_bps; |
| 515 stream->target_bitrate_bps = params.target_bitrate_bps; | 528 stream->target_bitrate_bps = params.target_bitrate_bps; |
| 516 stream->max_bitrate_bps = params.max_bitrate_bps; | 529 stream->max_bitrate_bps = params.max_bitrate_bps; |
| 517 stream->max_framerate = params.clip.fps; | 530 stream->max_framerate = params.clip.fps; |
| 518 | 531 |
| 532 VideoCodecVP8 vp8_settings; | |
| 533 VideoCodecVP9 vp9_settings; | |
| 519 if (params.screenshare) { | 534 if (params.screenshare) { |
| 520 encoder_config_.content_type = VideoEncoderConfig::ContentType::kScreen; | 535 encoder_config_.content_type = VideoEncoderConfig::ContentType::kScreen; |
| 521 encoder_config_.min_transmit_bitrate_bps = 400 * 1000; | 536 encoder_config_.min_transmit_bitrate_bps = 400 * 1000; |
| 522 VideoCodecVP8 vp8_settings = VideoEncoder::GetDefaultVp8Settings(); | 537 if (params.codec == "VP8") { |
| 523 vp8_settings.denoisingOn = false; | 538 vp8_settings = VideoEncoder::GetDefaultVp8Settings(); |
| 524 vp8_settings.frameDroppingOn = false; | 539 vp8_settings.denoisingOn = false; |
| 525 vp8_settings.numberOfTemporalLayers = 2; | 540 vp8_settings.frameDroppingOn = false; |
| 526 encoder_config_.encoder_specific_settings = &vp8_settings; | 541 vp8_settings.numberOfTemporalLayers = 2; |
| 542 encoder_config_.encoder_specific_settings = &vp8_settings; | |
| 543 } else if (params.codec == "VP9") { | |
| 544 vp9_settings = VideoEncoder::GetDefaultVp9Settings(); | |
| 545 vp9_settings.denoisingOn = false; | |
| 546 vp9_settings.frameDroppingOn = false; | |
| 547 vp9_settings.numberOfTemporalLayers = 2; | |
| 548 encoder_config_.encoder_specific_settings = &vp9_settings; | |
| 549 } | |
| 527 | 550 |
| 528 stream->temporal_layer_thresholds_bps.clear(); | 551 stream->temporal_layer_thresholds_bps.clear(); |
| 529 stream->temporal_layer_thresholds_bps.push_back(stream->target_bitrate_bps); | 552 stream->temporal_layer_thresholds_bps.push_back(stream->target_bitrate_bps); |
| 530 } | 553 } |
| 531 | 554 |
| 532 CreateMatchingReceiveConfigs(); | 555 CreateMatchingReceiveConfigs(); |
| 533 receive_configs_[0].renderer = &analyzer; | 556 receive_configs_[0].renderer = &analyzer; |
| 534 receive_configs_[0].rtp.nack.rtp_history_ms = kNackRtpHistoryMs; | 557 receive_configs_[0].rtp.nack.rtp_history_ms = kNackRtpHistoryMs; |
| 535 receive_configs_[0].rtp.rtx[kSendRtxPayloadType].ssrc = kSendRtxSsrcs[0]; | 558 receive_configs_[0].rtp.rtx[kSendRtxPayloadType].ssrc = kSendRtxSsrcs[0]; |
| 536 receive_configs_[0].rtp.rtx[kSendRtxPayloadType].payload_type = | 559 receive_configs_[0].rtp.rtx[kSendRtxPayloadType].payload_type = |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 584 | 607 |
| 585 TEST_F(FullStackTest, ParisQcifWithoutPacketLoss) { | 608 TEST_F(FullStackTest, ParisQcifWithoutPacketLoss) { |
| 586 FullStackTestParams paris_qcif = {"net_delay_0_0_plr_0", | 609 FullStackTestParams paris_qcif = {"net_delay_0_0_plr_0", |
| 587 {"paris_qcif", 176, 144, 30}, | 610 {"paris_qcif", 176, 144, 30}, |
| 588 false, | 611 false, |
| 589 300000, | 612 300000, |
| 590 300000, | 613 300000, |
| 591 300000, | 614 300000, |
| 592 36.0, | 615 36.0, |
| 593 0.96, | 616 0.96, |
| 594 kFullStackTestDurationSecs}; | 617 kFullStackTestDurationSecs, |
| 618 "VP8"}; | |
| 595 RunTest(paris_qcif); | 619 RunTest(paris_qcif); |
| 596 } | 620 } |
| 597 | 621 |
| 598 TEST_F(FullStackTest, ForemanCifWithoutPacketLoss) { | 622 TEST_F(FullStackTest, ForemanCifWithoutPacketLoss) { |
| 599 // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif. | 623 // TODO(pbos): Decide on psnr/ssim thresholds for foreman_cif. |
| 600 FullStackTestParams foreman_cif = {"foreman_cif_net_delay_0_0_plr_0", | 624 FullStackTestParams foreman_cif = {"foreman_cif_net_delay_0_0_plr_0", |
| 601 {"foreman_cif", 352, 288, 30}, | 625 {"foreman_cif", 352, 288, 30}, |
| 602 false, | 626 false, |
| 603 700000, | 627 700000, |
| 604 700000, | 628 700000, |
| 605 700000, | 629 700000, |
| 606 0.0, | 630 0.0, |
| 607 0.0, | 631 0.0, |
| 608 kFullStackTestDurationSecs}; | 632 kFullStackTestDurationSecs, |
| 633 "VP8"}; | |
| 609 RunTest(foreman_cif); | 634 RunTest(foreman_cif); |
| 610 } | 635 } |
| 611 | 636 |
| 612 TEST_F(FullStackTest, ForemanCifPlr5) { | 637 TEST_F(FullStackTest, ForemanCifPlr5) { |
| 613 FullStackTestParams foreman_cif = {"foreman_cif_delay_50_0_plr_5", | 638 FullStackTestParams foreman_cif = {"foreman_cif_delay_50_0_plr_5", |
| 614 {"foreman_cif", 352, 288, 30}, | 639 {"foreman_cif", 352, 288, 30}, |
| 615 false, | 640 false, |
| 616 30000, | 641 30000, |
| 617 500000, | 642 500000, |
| 618 2000000, | 643 2000000, |
| 619 0.0, | 644 0.0, |
| 620 0.0, | 645 0.0, |
| 621 kFullStackTestDurationSecs}; | 646 kFullStackTestDurationSecs, |
| 647 "VP8"}; | |
| 622 foreman_cif.link.loss_percent = 5; | 648 foreman_cif.link.loss_percent = 5; |
| 623 foreman_cif.link.queue_delay_ms = 50; | 649 foreman_cif.link.queue_delay_ms = 50; |
| 624 RunTest(foreman_cif); | 650 RunTest(foreman_cif); |
| 625 } | 651 } |
| 626 | 652 |
| 627 TEST_F(FullStackTest, ForemanCif500kbps) { | 653 TEST_F(FullStackTest, ForemanCif500kbps) { |
| 628 FullStackTestParams foreman_cif = {"foreman_cif_500kbps", | 654 FullStackTestParams foreman_cif = {"foreman_cif_500kbps", |
| 629 {"foreman_cif", 352, 288, 30}, | 655 {"foreman_cif", 352, 288, 30}, |
| 630 false, | 656 false, |
| 631 30000, | 657 30000, |
| 632 500000, | 658 500000, |
| 633 2000000, | 659 2000000, |
| 634 0.0, | 660 0.0, |
| 635 0.0, | 661 0.0, |
| 636 kFullStackTestDurationSecs}; | 662 kFullStackTestDurationSecs, |
| 663 "VP8"}; | |
| 637 foreman_cif.link.queue_length_packets = 0; | 664 foreman_cif.link.queue_length_packets = 0; |
| 638 foreman_cif.link.queue_delay_ms = 0; | 665 foreman_cif.link.queue_delay_ms = 0; |
| 639 foreman_cif.link.link_capacity_kbps = 500; | 666 foreman_cif.link.link_capacity_kbps = 500; |
| 640 RunTest(foreman_cif); | 667 RunTest(foreman_cif); |
| 641 } | 668 } |
| 642 | 669 |
| 643 TEST_F(FullStackTest, ForemanCif500kbpsLimitedQueue) { | 670 TEST_F(FullStackTest, ForemanCif500kbpsLimitedQueue) { |
| 644 FullStackTestParams foreman_cif = {"foreman_cif_500kbps_32pkts_queue", | 671 FullStackTestParams foreman_cif = {"foreman_cif_500kbps_32pkts_queue", |
| 645 {"foreman_cif", 352, 288, 30}, | 672 {"foreman_cif", 352, 288, 30}, |
| 646 false, | 673 false, |
| 647 30000, | 674 30000, |
| 648 500000, | 675 500000, |
| 649 2000000, | 676 2000000, |
| 650 0.0, | 677 0.0, |
| 651 0.0, | 678 0.0, |
| 652 kFullStackTestDurationSecs}; | 679 kFullStackTestDurationSecs, |
| 680 "VP8"}; | |
| 653 foreman_cif.link.queue_length_packets = 32; | 681 foreman_cif.link.queue_length_packets = 32; |
| 654 foreman_cif.link.queue_delay_ms = 0; | 682 foreman_cif.link.queue_delay_ms = 0; |
| 655 foreman_cif.link.link_capacity_kbps = 500; | 683 foreman_cif.link.link_capacity_kbps = 500; |
| 656 RunTest(foreman_cif); | 684 RunTest(foreman_cif); |
| 657 } | 685 } |
| 658 | 686 |
| 659 TEST_F(FullStackTest, ForemanCif500kbps100ms) { | 687 TEST_F(FullStackTest, ForemanCif500kbps100ms) { |
| 660 FullStackTestParams foreman_cif = {"foreman_cif_500kbps_100ms", | 688 FullStackTestParams foreman_cif = {"foreman_cif_500kbps_100ms", |
| 661 {"foreman_cif", 352, 288, 30}, | 689 {"foreman_cif", 352, 288, 30}, |
| 662 false, | 690 false, |
| 663 30000, | 691 30000, |
| 664 500000, | 692 500000, |
| 665 2000000, | 693 2000000, |
| 666 0.0, | 694 0.0, |
| 667 0.0, | 695 0.0, |
| 668 kFullStackTestDurationSecs}; | 696 kFullStackTestDurationSecs, |
| 697 "VP8"}; | |
| 669 foreman_cif.link.queue_length_packets = 0; | 698 foreman_cif.link.queue_length_packets = 0; |
| 670 foreman_cif.link.queue_delay_ms = 100; | 699 foreman_cif.link.queue_delay_ms = 100; |
| 671 foreman_cif.link.link_capacity_kbps = 500; | 700 foreman_cif.link.link_capacity_kbps = 500; |
| 672 RunTest(foreman_cif); | 701 RunTest(foreman_cif); |
| 673 } | 702 } |
| 674 | 703 |
| 675 TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueue) { | 704 TEST_F(FullStackTest, ForemanCif500kbps100msLimitedQueue) { |
| 676 FullStackTestParams foreman_cif = {"foreman_cif_500kbps_100ms_32pkts_queue", | 705 FullStackTestParams foreman_cif = {"foreman_cif_500kbps_100ms_32pkts_queue", |
| 677 {"foreman_cif", 352, 288, 30}, | 706 {"foreman_cif", 352, 288, 30}, |
| 678 false, | 707 false, |
| 679 30000, | 708 30000, |
| 680 500000, | 709 500000, |
| 681 2000000, | 710 2000000, |
| 682 0.0, | 711 0.0, |
| 683 0.0, | 712 0.0, |
| 684 kFullStackTestDurationSecs}; | 713 kFullStackTestDurationSecs, |
| 714 "VP8"}; | |
| 685 foreman_cif.link.queue_length_packets = 32; | 715 foreman_cif.link.queue_length_packets = 32; |
| 686 foreman_cif.link.queue_delay_ms = 100; | 716 foreman_cif.link.queue_delay_ms = 100; |
| 687 foreman_cif.link.link_capacity_kbps = 500; | 717 foreman_cif.link.link_capacity_kbps = 500; |
| 688 RunTest(foreman_cif); | 718 RunTest(foreman_cif); |
| 689 } | 719 } |
| 690 | 720 |
| 691 TEST_F(FullStackTest, ForemanCif1000kbps100msLimitedQueue) { | 721 TEST_F(FullStackTest, ForemanCif1000kbps100msLimitedQueue) { |
| 692 FullStackTestParams foreman_cif = {"foreman_cif_1000kbps_100ms_32pkts_queue", | 722 FullStackTestParams foreman_cif = {"foreman_cif_1000kbps_100ms_32pkts_queue", |
| 693 {"foreman_cif", 352, 288, 30}, | 723 {"foreman_cif", 352, 288, 30}, |
| 694 false, | 724 false, |
| 695 30000, | 725 30000, |
| 696 2000000, | 726 2000000, |
| 697 2000000, | 727 2000000, |
| 698 0.0, | 728 0.0, |
| 699 0.0, | 729 0.0, |
| 700 kFullStackTestDurationSecs}; | 730 kFullStackTestDurationSecs, |
| 731 "VP8"}; | |
| 701 foreman_cif.link.queue_length_packets = 32; | 732 foreman_cif.link.queue_length_packets = 32; |
| 702 foreman_cif.link.queue_delay_ms = 100; | 733 foreman_cif.link.queue_delay_ms = 100; |
| 703 foreman_cif.link.link_capacity_kbps = 1000; | 734 foreman_cif.link.link_capacity_kbps = 1000; |
| 704 RunTest(foreman_cif); | 735 RunTest(foreman_cif); |
| 705 } | 736 } |
| 706 | 737 |
| 707 // Temporarily disabled on Android due to low test timeouts. | 738 // Temporarily disabled on Android due to low test timeouts. |
| 708 // https://code.google.com/p/chromium/issues/detail?id=513170 | 739 // https://code.google.com/p/chromium/issues/detail?id=513170 |
| 709 #include "webrtc/test/testsupport/gtest_disable.h" | 740 #include "webrtc/test/testsupport/gtest_disable.h" |
| 710 TEST_F(FullStackTest, DISABLED_ON_ANDROID(ScreenshareSlides)) { | 741 TEST_F(FullStackTest, DISABLED_ON_ANDROID(ScreenshareSlidesVP8_2TL)) { |
| 711 FullStackTestParams screenshare_params = { | 742 FullStackTestParams screenshare_params = { |
| 712 "screenshare_slides", | 743 "screenshare_slides", // keep the old label |
|
pbos-webrtc
2015/07/30 08:27:55
remove comment, or put "// No suffix to preserve h
| |
| 713 {"screenshare_slides", 1850, 1110, 5}, | 744 {"screenshare_slides", 1850, 1110, 5}, |
| 714 true, | 745 true, |
| 715 50000, | 746 50000, |
| 747 200000, | |
| 748 2000000, | |
| 749 0.0, | |
| 750 0.0, | |
| 751 kFullStackTestDurationSecs, | |
| 752 "VP8"}; | |
| 753 RunTest(screenshare_params); | |
| 754 } | |
| 755 | |
| 756 // probably the same issue as | |
|
pbos-webrtc
2015/07/30 08:27:55
"Disabled on Android along with VP8 screenshare ab
| |
| 757 // https://code.google.com/p/chromium/issues/detail?id=513170 | |
| 758 TEST_F(FullStackTest, DISABLED_ON_ANDROID(ScreenshareSlidesVP9_2TL)) { | |
| 759 FullStackTestParams screenshare_params = { | |
| 760 "screenshare_slides_vp9_2tl", | |
| 761 {"screenshare_slides", 1850, 1110, 5}, | |
| 762 true, | |
| 763 50000, | |
| 716 200000, | 764 200000, |
| 717 2000000, | 765 2000000, |
| 718 0.0, | 766 0.0, |
| 719 0.0, | 767 0.0, |
| 720 kFullStackTestDurationSecs}; | 768 kFullStackTestDurationSecs, |
| 769 "VP9"}; | |
| 721 RunTest(screenshare_params); | 770 RunTest(screenshare_params); |
| 722 } | 771 } |
| 723 } // namespace webrtc | 772 } // namespace webrtc |
| OLD | NEW |