OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 adapted_frame.set_ntp_time_ms(video_frame.ntp_time_ms()); | 142 adapted_frame.set_ntp_time_ms(video_frame.ntp_time_ms()); |
143 test::FrameForwarder::IncomingCapturedFrame(adapted_frame); | 143 test::FrameForwarder::IncomingCapturedFrame(adapted_frame); |
144 } else { | 144 } else { |
145 test::FrameForwarder::IncomingCapturedFrame(video_frame); | 145 test::FrameForwarder::IncomingCapturedFrame(video_frame); |
146 } | 146 } |
147 } | 147 } |
148 | 148 |
149 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, | 149 void AddOrUpdateSink(rtc::VideoSinkInterface<VideoFrame>* sink, |
150 const rtc::VideoSinkWants& wants) override { | 150 const rtc::VideoSinkWants& wants) override { |
151 rtc::CritScope cs(&crit_); | 151 rtc::CritScope cs(&crit_); |
152 adapter_.OnResolutionRequest(wants.max_pixel_count, | 152 adapter_.OnResolutionRequest(wants.target_pixel_count, |
153 wants.max_pixel_count_step_up); | 153 wants.max_pixel_count); |
154 test::FrameForwarder::AddOrUpdateSink(sink, wants); | 154 test::FrameForwarder::AddOrUpdateSink(sink, wants); |
155 } | 155 } |
156 | 156 |
157 cricket::VideoAdapter adapter_; | 157 cricket::VideoAdapter adapter_; |
158 bool adaptation_enabled_ GUARDED_BY(crit_); | 158 bool adaptation_enabled_ GUARDED_BY(crit_); |
159 }; | 159 }; |
160 } // namespace | 160 } // namespace |
161 | 161 |
162 class ViEEncoderTest : public ::testing::Test { | 162 class ViEEncoderTest : public ::testing::Test { |
163 public: | 163 public: |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
605 TEST_F(ViEEncoderTest, SinkWantsRotationApplied) { | 605 TEST_F(ViEEncoderTest, SinkWantsRotationApplied) { |
606 EXPECT_FALSE(video_source_.sink_wants().rotation_applied); | 606 EXPECT_FALSE(video_source_.sink_wants().rotation_applied); |
607 vie_encoder_->SetSink(&sink_, true /*rotation_applied*/); | 607 vie_encoder_->SetSink(&sink_, true /*rotation_applied*/); |
608 EXPECT_TRUE(video_source_.sink_wants().rotation_applied); | 608 EXPECT_TRUE(video_source_.sink_wants().rotation_applied); |
609 vie_encoder_->Stop(); | 609 vie_encoder_->Stop(); |
610 } | 610 } |
611 | 611 |
612 TEST_F(ViEEncoderTest, SinkWantsFromOveruseDetector) { | 612 TEST_F(ViEEncoderTest, SinkWantsFromOveruseDetector) { |
613 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); | 613 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
614 | 614 |
| 615 EXPECT_FALSE(video_source_.sink_wants().target_pixel_count); |
615 EXPECT_FALSE(video_source_.sink_wants().max_pixel_count); | 616 EXPECT_FALSE(video_source_.sink_wants().max_pixel_count); |
616 EXPECT_FALSE(video_source_.sink_wants().max_pixel_count_step_up); | |
617 | 617 |
618 int frame_width = 1280; | 618 int frame_width = 1280; |
619 int frame_height = 720; | 619 int frame_height = 720; |
620 | 620 |
621 // Trigger CPU overuse kMaxCpuDowngrades times. Every time, ViEEncoder should | 621 // Trigger CPU overuse kMaxCpuDowngrades times. Every time, ViEEncoder should |
622 // request lower resolution. | 622 // request lower resolution. |
623 for (int i = 1; i <= ViEEncoder::kMaxCpuDowngrades; ++i) { | 623 for (int i = 1; i <= ViEEncoder::kMaxCpuDowngrades; ++i) { |
624 video_source_.IncomingCapturedFrame( | 624 video_source_.IncomingCapturedFrame( |
625 CreateFrame(i, frame_width, frame_height)); | 625 CreateFrame(i, frame_width, frame_height)); |
626 sink_.WaitForEncodedFrame(i); | 626 sink_.WaitForEncodedFrame(i); |
627 | 627 |
628 vie_encoder_->TriggerCpuOveruse(); | 628 vie_encoder_->TriggerCpuOveruse(); |
629 | 629 |
| 630 EXPECT_FALSE(video_source_.sink_wants().target_pixel_count); |
630 EXPECT_LT(video_source_.sink_wants().max_pixel_count.value_or( | 631 EXPECT_LT(video_source_.sink_wants().max_pixel_count.value_or( |
631 std::numeric_limits<int>::max()), | 632 std::numeric_limits<int>::max()), |
632 frame_width * frame_height); | 633 frame_width * frame_height); |
633 EXPECT_FALSE(video_source_.sink_wants().max_pixel_count_step_up); | |
634 | 634 |
635 frame_width /= 2; | 635 frame_width /= 2; |
636 frame_height /= 2; | 636 frame_height /= 2; |
637 } | 637 } |
638 | 638 |
639 // Trigger CPU overuse one more time. This should not trigger a request for | 639 // Trigger CPU overuse one more time. This should not trigger a request for |
640 // lower resolution. | 640 // lower resolution. |
641 rtc::VideoSinkWants current_wants = video_source_.sink_wants(); | 641 rtc::VideoSinkWants current_wants = video_source_.sink_wants(); |
642 video_source_.IncomingCapturedFrame(CreateFrame( | 642 video_source_.IncomingCapturedFrame(CreateFrame( |
643 ViEEncoder::kMaxCpuDowngrades + 1, frame_width, frame_height)); | 643 ViEEncoder::kMaxCpuDowngrades + 1, frame_width, frame_height)); |
644 sink_.WaitForEncodedFrame(ViEEncoder::kMaxCpuDowngrades + 1); | 644 sink_.WaitForEncodedFrame(ViEEncoder::kMaxCpuDowngrades + 1); |
645 vie_encoder_->TriggerCpuOveruse(); | 645 vie_encoder_->TriggerCpuOveruse(); |
| 646 EXPECT_EQ(video_source_.sink_wants().target_pixel_count, |
| 647 current_wants.target_pixel_count); |
646 EXPECT_EQ(video_source_.sink_wants().max_pixel_count, | 648 EXPECT_EQ(video_source_.sink_wants().max_pixel_count, |
647 current_wants.max_pixel_count); | 649 current_wants.max_pixel_count); |
648 EXPECT_EQ(video_source_.sink_wants().max_pixel_count_step_up, | |
649 current_wants.max_pixel_count_step_up); | |
650 | 650 |
651 // Trigger CPU normal use. | 651 // Trigger CPU normal use. |
652 vie_encoder_->TriggerCpuNormalUsage(); | 652 vie_encoder_->TriggerCpuNormalUsage(); |
653 EXPECT_FALSE(video_source_.sink_wants().max_pixel_count); | 653 EXPECT_EQ(frame_width * frame_height * 5 / 3, |
654 EXPECT_EQ(video_source_.sink_wants().max_pixel_count_step_up.value_or(0), | 654 video_source_.sink_wants().target_pixel_count.value_or(0)); |
655 frame_width * frame_height); | 655 EXPECT_EQ(frame_width * frame_height * 4, |
| 656 video_source_.sink_wants().max_pixel_count.value_or(0)); |
656 | 657 |
657 vie_encoder_->Stop(); | 658 vie_encoder_->Stop(); |
658 } | 659 } |
659 | 660 |
660 TEST_F(ViEEncoderTest, | 661 TEST_F(ViEEncoderTest, |
661 ResolutionSinkWantsResetOnSetSourceWithDisabledResolutionScaling) { | 662 ResolutionSinkWantsResetOnSetSourceWithDisabledResolutionScaling) { |
662 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); | 663 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
663 | 664 |
| 665 EXPECT_FALSE(video_source_.sink_wants().target_pixel_count); |
664 EXPECT_FALSE(video_source_.sink_wants().max_pixel_count); | 666 EXPECT_FALSE(video_source_.sink_wants().max_pixel_count); |
665 EXPECT_FALSE(video_source_.sink_wants().max_pixel_count_step_up); | |
666 | 667 |
667 int frame_width = 1280; | 668 int frame_width = 1280; |
668 int frame_height = 720; | 669 int frame_height = 720; |
669 | 670 |
670 video_source_.IncomingCapturedFrame( | 671 video_source_.IncomingCapturedFrame( |
671 CreateFrame(1, frame_width, frame_height)); | 672 CreateFrame(1, frame_width, frame_height)); |
672 sink_.WaitForEncodedFrame(1); | 673 sink_.WaitForEncodedFrame(1); |
673 // Trigger CPU overuse. | 674 // Trigger CPU overuse. |
674 vie_encoder_->TriggerCpuOveruse(); | 675 vie_encoder_->TriggerCpuOveruse(); |
675 | 676 |
676 video_source_.IncomingCapturedFrame( | 677 video_source_.IncomingCapturedFrame( |
677 CreateFrame(2, frame_width, frame_height)); | 678 CreateFrame(2, frame_width, frame_height)); |
678 sink_.WaitForEncodedFrame(2); | 679 sink_.WaitForEncodedFrame(2); |
| 680 EXPECT_FALSE(video_source_.sink_wants().target_pixel_count); |
679 EXPECT_LT(video_source_.sink_wants().max_pixel_count.value_or( | 681 EXPECT_LT(video_source_.sink_wants().max_pixel_count.value_or( |
680 std::numeric_limits<int>::max()), | 682 std::numeric_limits<int>::max()), |
681 frame_width * frame_height); | 683 frame_width * frame_height); |
682 EXPECT_FALSE(video_source_.sink_wants().max_pixel_count_step_up); | |
683 | 684 |
684 // Set new source. | 685 // Set new source. |
685 test::FrameForwarder new_video_source; | 686 test::FrameForwarder new_video_source; |
686 vie_encoder_->SetSource( | 687 vie_encoder_->SetSource( |
687 &new_video_source, | 688 &new_video_source, |
688 VideoSendStream::DegradationPreference::kMaintainResolution); | 689 VideoSendStream::DegradationPreference::kMaintainResolution); |
689 | 690 |
| 691 EXPECT_FALSE(new_video_source.sink_wants().target_pixel_count); |
690 EXPECT_FALSE(new_video_source.sink_wants().max_pixel_count); | 692 EXPECT_FALSE(new_video_source.sink_wants().max_pixel_count); |
691 EXPECT_FALSE(new_video_source.sink_wants().max_pixel_count_step_up); | |
692 | 693 |
693 new_video_source.IncomingCapturedFrame( | 694 new_video_source.IncomingCapturedFrame( |
694 CreateFrame(3, frame_width, frame_height)); | 695 CreateFrame(3, frame_width, frame_height)); |
695 sink_.WaitForEncodedFrame(3); | 696 sink_.WaitForEncodedFrame(3); |
| 697 EXPECT_FALSE(new_video_source.sink_wants().target_pixel_count); |
696 EXPECT_FALSE(new_video_source.sink_wants().max_pixel_count); | 698 EXPECT_FALSE(new_video_source.sink_wants().max_pixel_count); |
697 EXPECT_FALSE(new_video_source.sink_wants().max_pixel_count_step_up); | |
698 | 699 |
699 // Calling SetSource with resolution scaling enabled apply the old SinkWants. | 700 // Calling SetSource with resolution scaling enabled apply the old SinkWants. |
700 vie_encoder_->SetSource(&new_video_source, | 701 vie_encoder_->SetSource(&new_video_source, |
701 VideoSendStream::DegradationPreference::kBalanced); | 702 VideoSendStream::DegradationPreference::kBalanced); |
702 EXPECT_LT(new_video_source.sink_wants().max_pixel_count.value_or( | 703 EXPECT_LT(new_video_source.sink_wants().max_pixel_count.value_or( |
703 std::numeric_limits<int>::max()), | 704 std::numeric_limits<int>::max()), |
704 frame_width * frame_height); | 705 frame_width * frame_height); |
705 EXPECT_FALSE(new_video_source.sink_wants().max_pixel_count_step_up); | 706 EXPECT_FALSE(new_video_source.sink_wants().target_pixel_count); |
706 | 707 |
707 vie_encoder_->Stop(); | 708 vie_encoder_->Stop(); |
708 } | 709 } |
709 | 710 |
710 TEST_F(ViEEncoderTest, StatsTracksAdaptationStats) { | 711 TEST_F(ViEEncoderTest, StatsTracksAdaptationStats) { |
711 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); | 712 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
712 | 713 |
713 int frame_width = 1280; | 714 int frame_width = 1280; |
714 int frame_height = 720; | 715 int frame_height = 720; |
715 | 716 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 stats = stats_proxy_->GetStats(); | 872 stats = stats_proxy_->GetStats(); |
872 EXPECT_FALSE(stats.cpu_limited_resolution); | 873 EXPECT_FALSE(stats.cpu_limited_resolution); |
873 EXPECT_FALSE(stats.bw_limited_resolution); | 874 EXPECT_FALSE(stats.bw_limited_resolution); |
874 | 875 |
875 vie_encoder_->Stop(); | 876 vie_encoder_->Stop(); |
876 } | 877 } |
877 | 878 |
878 TEST_F(ViEEncoderTest, StatsTracksAdaptationStatsWhenSwitchingSource) { | 879 TEST_F(ViEEncoderTest, StatsTracksAdaptationStatsWhenSwitchingSource) { |
879 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); | 880 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
880 | 881 |
881 // Trigger CPU overuse. | |
882 vie_encoder_->TriggerCpuOveruse(); | |
883 int frame_width = 1280; | 882 int frame_width = 1280; |
884 int frame_height = 720; | 883 int frame_height = 720; |
| 884 int sequence = 1; |
885 | 885 |
| 886 // Trigger CPU overuse, won't bite before first frame. |
| 887 vie_encoder_->TriggerCpuOveruse(); |
886 video_source_.IncomingCapturedFrame( | 888 video_source_.IncomingCapturedFrame( |
887 CreateFrame(1, frame_width, frame_height)); | 889 CreateFrame(sequence, frame_width, frame_height)); |
888 sink_.WaitForEncodedFrame(1); | 890 sink_.WaitForEncodedFrame(sequence++); |
889 | 891 |
890 VideoSendStream::Stats stats = stats_proxy_->GetStats(); | 892 VideoSendStream::Stats stats = stats_proxy_->GetStats(); |
| 893 EXPECT_FALSE(stats.cpu_limited_resolution); |
| 894 EXPECT_EQ(0, stats.number_of_cpu_adapt_changes); |
| 895 |
| 896 // Trigger CPU overuse again, should now adapt down. |
| 897 vie_encoder_->TriggerCpuOveruse(); |
| 898 video_source_.IncomingCapturedFrame( |
| 899 CreateFrame(sequence, frame_width, frame_height)); |
| 900 sink_.WaitForEncodedFrame(sequence++); |
| 901 |
| 902 stats = stats_proxy_->GetStats(); |
891 EXPECT_TRUE(stats.cpu_limited_resolution); | 903 EXPECT_TRUE(stats.cpu_limited_resolution); |
892 EXPECT_EQ(1, stats.number_of_cpu_adapt_changes); | 904 EXPECT_EQ(1, stats.number_of_cpu_adapt_changes); |
893 | 905 |
894 // Set new source with adaptation still enabled. | 906 // Set new source with adaptation still enabled. |
895 test::FrameForwarder new_video_source; | 907 test::FrameForwarder new_video_source; |
896 vie_encoder_->SetSource(&new_video_source, | 908 vie_encoder_->SetSource(&new_video_source, |
897 VideoSendStream::DegradationPreference::kBalanced); | 909 VideoSendStream::DegradationPreference::kBalanced); |
898 | 910 |
899 new_video_source.IncomingCapturedFrame( | 911 new_video_source.IncomingCapturedFrame( |
900 CreateFrame(2, frame_width, frame_height)); | 912 CreateFrame(sequence, frame_width, frame_height)); |
901 sink_.WaitForEncodedFrame(2); | 913 sink_.WaitForEncodedFrame(sequence++); |
902 stats = stats_proxy_->GetStats(); | 914 stats = stats_proxy_->GetStats(); |
903 EXPECT_TRUE(stats.cpu_limited_resolution); | 915 EXPECT_TRUE(stats.cpu_limited_resolution); |
904 EXPECT_EQ(1, stats.number_of_cpu_adapt_changes); | 916 EXPECT_EQ(1, stats.number_of_cpu_adapt_changes); |
905 | 917 |
906 // Set adaptation disabled. | 918 // Set adaptation disabled. |
907 vie_encoder_->SetSource( | 919 vie_encoder_->SetSource( |
908 &new_video_source, | 920 &new_video_source, |
909 VideoSendStream::DegradationPreference::kMaintainResolution); | 921 VideoSendStream::DegradationPreference::kMaintainResolution); |
910 new_video_source.IncomingCapturedFrame( | 922 new_video_source.IncomingCapturedFrame( |
911 CreateFrame(3, frame_width, frame_height)); | 923 CreateFrame(sequence, frame_width, frame_height)); |
912 sink_.WaitForEncodedFrame(3); | 924 sink_.WaitForEncodedFrame(sequence++); |
913 stats = stats_proxy_->GetStats(); | 925 stats = stats_proxy_->GetStats(); |
914 EXPECT_FALSE(stats.cpu_limited_resolution); | 926 EXPECT_FALSE(stats.cpu_limited_resolution); |
915 EXPECT_EQ(1, stats.number_of_cpu_adapt_changes); | 927 EXPECT_EQ(1, stats.number_of_cpu_adapt_changes); |
916 | 928 |
917 // Switch back the source with adaptation enabled. | 929 // Switch back the source with adaptation enabled. |
918 vie_encoder_->SetSource(&video_source_, | 930 vie_encoder_->SetSource(&video_source_, |
919 VideoSendStream::DegradationPreference::kBalanced); | 931 VideoSendStream::DegradationPreference::kBalanced); |
920 video_source_.IncomingCapturedFrame( | 932 video_source_.IncomingCapturedFrame( |
921 CreateFrame(4, frame_width, frame_height)); | 933 CreateFrame(sequence, frame_width, frame_height)); |
922 sink_.WaitForEncodedFrame(4); | 934 sink_.WaitForEncodedFrame(sequence++); |
923 stats = stats_proxy_->GetStats(); | 935 stats = stats_proxy_->GetStats(); |
924 EXPECT_TRUE(stats.cpu_limited_resolution); | 936 EXPECT_TRUE(stats.cpu_limited_resolution); |
925 EXPECT_EQ(1, stats.number_of_cpu_adapt_changes); | 937 EXPECT_EQ(1, stats.number_of_cpu_adapt_changes); |
926 | 938 |
927 // Trigger CPU normal usage. | 939 // Trigger CPU normal usage. |
928 vie_encoder_->TriggerCpuNormalUsage(); | 940 vie_encoder_->TriggerCpuNormalUsage(); |
929 video_source_.IncomingCapturedFrame( | 941 video_source_.IncomingCapturedFrame( |
930 CreateFrame(5, frame_width, frame_height)); | 942 CreateFrame(sequence, frame_width, frame_height)); |
931 sink_.WaitForEncodedFrame(5); | 943 sink_.WaitForEncodedFrame(sequence++); |
932 stats = stats_proxy_->GetStats(); | 944 stats = stats_proxy_->GetStats(); |
933 EXPECT_FALSE(stats.cpu_limited_resolution); | 945 EXPECT_FALSE(stats.cpu_limited_resolution); |
934 EXPECT_EQ(2, stats.number_of_cpu_adapt_changes); | 946 EXPECT_EQ(2, stats.number_of_cpu_adapt_changes); |
935 | 947 |
936 vie_encoder_->Stop(); | 948 vie_encoder_->Stop(); |
937 } | 949 } |
938 | 950 |
939 TEST_F(ViEEncoderTest, StatsTracksPreferredBitrate) { | 951 TEST_F(ViEEncoderTest, StatsTracksPreferredBitrate) { |
940 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); | 952 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
941 | 953 |
942 video_source_.IncomingCapturedFrame(CreateFrame(1, 1280, 720)); | 954 video_source_.IncomingCapturedFrame(CreateFrame(1, 1280, 720)); |
943 sink_.WaitForEncodedFrame(1); | 955 sink_.WaitForEncodedFrame(1); |
944 | 956 |
945 VideoSendStream::Stats stats = stats_proxy_->GetStats(); | 957 VideoSendStream::Stats stats = stats_proxy_->GetStats(); |
946 EXPECT_EQ(video_encoder_config_.max_bitrate_bps, | 958 EXPECT_EQ(video_encoder_config_.max_bitrate_bps, |
947 stats.preferred_media_bitrate_bps); | 959 stats.preferred_media_bitrate_bps); |
948 | 960 |
949 vie_encoder_->Stop(); | 961 vie_encoder_->Stop(); |
950 } | 962 } |
951 | 963 |
952 TEST_F(ViEEncoderTest, ScalingUpAndDownDoesNothingWithMaintainResolution) { | 964 TEST_F(ViEEncoderTest, ScalingUpAndDownDoesNothingWithMaintainResolution) { |
953 const int kTargetBitrateBps = 100000; | 965 const int kTargetBitrateBps = 100000; |
954 int frame_width = 1280; | 966 int frame_width = 1280; |
955 int frame_height = 720; | 967 int frame_height = 720; |
956 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); | 968 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
957 | 969 |
958 // Expect no scaling to begin with | 970 // Expect no scaling to begin with |
| 971 EXPECT_FALSE(video_source_.sink_wants().target_pixel_count); |
959 EXPECT_FALSE(video_source_.sink_wants().max_pixel_count); | 972 EXPECT_FALSE(video_source_.sink_wants().max_pixel_count); |
960 EXPECT_FALSE(video_source_.sink_wants().max_pixel_count_step_up); | |
961 | 973 |
962 video_source_.IncomingCapturedFrame( | 974 video_source_.IncomingCapturedFrame( |
963 CreateFrame(1, frame_width, frame_height)); | 975 CreateFrame(1, frame_width, frame_height)); |
964 sink_.WaitForEncodedFrame(1); | 976 sink_.WaitForEncodedFrame(1); |
965 | 977 |
966 // Trigger scale down | 978 // Trigger scale down |
967 vie_encoder_->TriggerQualityLow(); | 979 vie_encoder_->TriggerQualityLow(); |
968 | 980 |
969 video_source_.IncomingCapturedFrame( | 981 video_source_.IncomingCapturedFrame( |
970 CreateFrame(2, frame_width, frame_height)); | 982 CreateFrame(2, frame_width, frame_height)); |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 | 1128 |
1117 // Trigger CPU normal use, return to original resoluton; | 1129 // Trigger CPU normal use, return to original resoluton; |
1118 vie_encoder_->TriggerCpuNormalUsage(); | 1130 vie_encoder_->TriggerCpuNormalUsage(); |
1119 video_source_.IncomingCapturedFrame( | 1131 video_source_.IncomingCapturedFrame( |
1120 CreateFrame(3, kFrameWidth, kFrameHeight)); | 1132 CreateFrame(3, kFrameWidth, kFrameHeight)); |
1121 sink_.WaitForEncodedFrame(kFrameWidth, kFrameHeight); | 1133 sink_.WaitForEncodedFrame(kFrameWidth, kFrameHeight); |
1122 | 1134 |
1123 vie_encoder_->Stop(); | 1135 vie_encoder_->Stop(); |
1124 } | 1136 } |
1125 } // namespace webrtc | 1137 } // namespace webrtc |
OLD | NEW |