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 1039 matching lines...) Loading... |
1050 vie_encoder_->TriggerCpuOveruse(); | 1050 vie_encoder_->TriggerCpuOveruse(); |
1051 for (int i = 1; i <= SendStatisticsProxy::kMinRequiredMetricsSamples; ++i) { | 1051 for (int i = 1; i <= SendStatisticsProxy::kMinRequiredMetricsSamples; ++i) { |
1052 video_source_.IncomingCapturedFrame( | 1052 video_source_.IncomingCapturedFrame( |
1053 CreateFrame(SendStatisticsProxy::kMinRequiredMetricsSamples + i, | 1053 CreateFrame(SendStatisticsProxy::kMinRequiredMetricsSamples + i, |
1054 frame_width, frame_height)); | 1054 frame_width, frame_height)); |
1055 sink_.WaitForEncodedFrame(SendStatisticsProxy::kMinRequiredMetricsSamples + | 1055 sink_.WaitForEncodedFrame(SendStatisticsProxy::kMinRequiredMetricsSamples + |
1056 i); | 1056 i); |
1057 } | 1057 } |
1058 | 1058 |
1059 vie_encoder_->Stop(); | 1059 vie_encoder_->Stop(); |
| 1060 vie_encoder_.reset(); |
| 1061 stats_proxy_.reset(); |
1060 | 1062 |
1061 stats_proxy_.reset(); | |
1062 EXPECT_EQ(1, | 1063 EXPECT_EQ(1, |
1063 metrics::NumSamples("WebRTC.Video.CpuLimitedResolutionInPercent")); | 1064 metrics::NumSamples("WebRTC.Video.CpuLimitedResolutionInPercent")); |
1064 EXPECT_EQ( | 1065 EXPECT_EQ( |
1065 1, metrics::NumEvents("WebRTC.Video.CpuLimitedResolutionInPercent", 50)); | 1066 1, metrics::NumEvents("WebRTC.Video.CpuLimitedResolutionInPercent", 50)); |
1066 } | 1067 } |
1067 | 1068 |
1068 TEST_F(ViEEncoderTest, CallsBitrateObserver) { | 1069 TEST_F(ViEEncoderTest, CallsBitrateObserver) { |
1069 class MockBitrateObserver : public VideoBitrateAllocationObserver { | 1070 class MockBitrateObserver : public VideoBitrateAllocationObserver { |
1070 public: | 1071 public: |
1071 MOCK_METHOD1(OnBitrateAllocationUpdated, void(const BitrateAllocation&)); | 1072 MOCK_METHOD1(OnBitrateAllocationUpdated, void(const BitrateAllocation&)); |
(...skipping 155 matching lines...) Loading... |
1227 | 1228 |
1228 // Trigger CPU normal use, return to original resoluton; | 1229 // Trigger CPU normal use, return to original resoluton; |
1229 vie_encoder_->TriggerCpuNormalUsage(); | 1230 vie_encoder_->TriggerCpuNormalUsage(); |
1230 video_source_.IncomingCapturedFrame( | 1231 video_source_.IncomingCapturedFrame( |
1231 CreateFrame(3, kFrameWidth, kFrameHeight)); | 1232 CreateFrame(3, kFrameWidth, kFrameHeight)); |
1232 sink_.WaitForEncodedFrame(kFrameWidth, kFrameHeight); | 1233 sink_.WaitForEncodedFrame(kFrameWidth, kFrameHeight); |
1233 | 1234 |
1234 vie_encoder_->Stop(); | 1235 vie_encoder_->Stop(); |
1235 } | 1236 } |
1236 } // namespace webrtc | 1237 } // namespace webrtc |
OLD | NEW |