OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 15 matching lines...) Expand all Loading... |
26 #include "webrtc/modules/video_coding/include/video_coding_defines.h" | 26 #include "webrtc/modules/video_coding/include/video_coding_defines.h" |
27 #include "webrtc/video/overuse_frame_detector.h" | 27 #include "webrtc/video/overuse_frame_detector.h" |
28 #include "webrtc/video/send_statistics_proxy.h" | 28 #include "webrtc/video/send_statistics_proxy.h" |
29 #include "webrtc/video_frame.h" | 29 #include "webrtc/video_frame.h" |
30 namespace webrtc { | 30 namespace webrtc { |
31 | 31 |
32 namespace { | 32 namespace { |
33 // Time interval for logging frame counts. | 33 // Time interval for logging frame counts. |
34 const int64_t kFrameLogIntervalMs = 60000; | 34 const int64_t kFrameLogIntervalMs = 60000; |
35 // We will never ask for a resolution lower than this. | 35 // We will never ask for a resolution lower than this. |
| 36 #if defined(WEBRTC_ANDROID) |
| 37 // TODO(kthelgason): Lower this limit when better testing |
| 38 // on MediaCodec and fallback implementations are in place. |
| 39 const int kMinPixelsPerFrame = 320 * 180; |
| 40 #else |
36 const int kMinPixelsPerFrame = 120 * 90; | 41 const int kMinPixelsPerFrame = 120 * 90; |
| 42 #endif |
37 | 43 |
38 // TODO(pbos): Lower these thresholds (to closer to 100%) when we handle | 44 // TODO(pbos): Lower these thresholds (to closer to 100%) when we handle |
39 // pipelining encoders better (multiple input frames before something comes | 45 // pipelining encoders better (multiple input frames before something comes |
40 // out). This should effectively turn off CPU adaptations for systems that | 46 // out). This should effectively turn off CPU adaptations for systems that |
41 // remotely cope with the load right now. | 47 // remotely cope with the load right now. |
42 CpuOveruseOptions GetCpuOveruseOptions(bool full_overuse_time) { | 48 CpuOveruseOptions GetCpuOveruseOptions(bool full_overuse_time) { |
43 CpuOveruseOptions options; | 49 CpuOveruseOptions options; |
44 if (full_overuse_time) { | 50 if (full_overuse_time) { |
45 options.low_encode_usage_threshold_percent = 150; | 51 options.low_encode_usage_threshold_percent = 150; |
46 options.high_encode_usage_threshold_percent = 200; | 52 options.high_encode_usage_threshold_percent = 200; |
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 --scale_counter_[reason]; | 752 --scale_counter_[reason]; |
747 source_proxy_->RequestHigherResolutionThan(current_pixel_count); | 753 source_proxy_->RequestHigherResolutionThan(current_pixel_count); |
748 LOG(LS_INFO) << "Scaling up resolution."; | 754 LOG(LS_INFO) << "Scaling up resolution."; |
749 for (size_t i = 0; i < kScaleReasonSize; ++i) { | 755 for (size_t i = 0; i < kScaleReasonSize; ++i) { |
750 LOG(LS_INFO) << "Scaled " << scale_counter_[i] | 756 LOG(LS_INFO) << "Scaled " << scale_counter_[i] |
751 << " times for reason: " << (i ? "quality" : "cpu"); | 757 << " times for reason: " << (i ? "quality" : "cpu"); |
752 } | 758 } |
753 } | 759 } |
754 | 760 |
755 } // namespace webrtc | 761 } // namespace webrtc |
OLD | NEW |