| 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 867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 878 vie_encoder_->Stop(); | 878 vie_encoder_->Stop(); |
| 879 } | 879 } |
| 880 | 880 |
| 881 TEST_F(ViEEncoderTest, StatsTracksAdaptationStatsWhenSwitchingSource) { | 881 TEST_F(ViEEncoderTest, StatsTracksAdaptationStatsWhenSwitchingSource) { |
| 882 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); | 882 vie_encoder_->OnBitrateUpdated(kTargetBitrateBps, 0, 0); |
| 883 | 883 |
| 884 int frame_width = 1280; | 884 int frame_width = 1280; |
| 885 int frame_height = 720; | 885 int frame_height = 720; |
| 886 int sequence = 1; | 886 int sequence = 1; |
| 887 | 887 |
| 888 // Trigger CPU overuse, won't bite before first frame. | |
| 889 vie_encoder_->TriggerCpuOveruse(); | |
| 890 video_source_.IncomingCapturedFrame( | 888 video_source_.IncomingCapturedFrame( |
| 891 CreateFrame(sequence, frame_width, frame_height)); | 889 CreateFrame(sequence, frame_width, frame_height)); |
| 892 sink_.WaitForEncodedFrame(sequence++); | 890 sink_.WaitForEncodedFrame(sequence++); |
| 893 | 891 |
| 894 VideoSendStream::Stats stats = stats_proxy_->GetStats(); | 892 VideoSendStream::Stats stats = stats_proxy_->GetStats(); |
| 895 EXPECT_FALSE(stats.cpu_limited_resolution); | 893 EXPECT_FALSE(stats.cpu_limited_resolution); |
| 896 EXPECT_EQ(0, stats.number_of_cpu_adapt_changes); | 894 EXPECT_EQ(0, stats.number_of_cpu_adapt_changes); |
| 897 | 895 |
| 898 // Trigger CPU overuse again, should now adapt down. | 896 // Trigger CPU overuse again, should now adapt down. |
| 899 vie_encoder_->TriggerCpuOveruse(); | 897 vie_encoder_->TriggerCpuOveruse(); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1200 | 1198 |
| 1201 // Trigger CPU normal use, return to original resoluton; | 1199 // Trigger CPU normal use, return to original resoluton; |
| 1202 vie_encoder_->TriggerCpuNormalUsage(); | 1200 vie_encoder_->TriggerCpuNormalUsage(); |
| 1203 video_source_.IncomingCapturedFrame( | 1201 video_source_.IncomingCapturedFrame( |
| 1204 CreateFrame(3, kFrameWidth, kFrameHeight)); | 1202 CreateFrame(3, kFrameWidth, kFrameHeight)); |
| 1205 sink_.WaitForEncodedFrame(kFrameWidth, kFrameHeight); | 1203 sink_.WaitForEncodedFrame(kFrameWidth, kFrameHeight); |
| 1206 | 1204 |
| 1207 vie_encoder_->Stop(); | 1205 vie_encoder_->Stop(); |
| 1208 } | 1206 } |
| 1209 } // namespace webrtc | 1207 } // namespace webrtc |
| OLD | NEW |