| 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 |
| 11 #include "webrtc/video/vie_encoder.h" | 11 #include "webrtc/video/vie_encoder.h" |
| 12 | 12 |
| 13 #include <algorithm> | 13 #include <algorithm> |
| 14 #include <limits> | 14 #include <limits> |
| 15 #include <numeric> | 15 #include <numeric> |
| 16 #include <utility> | 16 #include <utility> |
| 17 | 17 |
| 18 #include "webrtc/base/arraysize.h" | 18 #include "webrtc/base/arraysize.h" |
| 19 #include "webrtc/base/checks.h" | 19 #include "webrtc/base/checks.h" |
| 20 #include "webrtc/base/location.h" | 20 #include "webrtc/base/location.h" |
| 21 #include "webrtc/base/logging.h" | 21 #include "webrtc/base/logging.h" |
| 22 #include "webrtc/base/timeutils.h" | 22 #include "webrtc/base/timeutils.h" |
| 23 #include "webrtc/base/trace_event.h" | 23 #include "webrtc/base/trace_event.h" |
| 24 #include "webrtc/common_video/include/video_bitrate_allocator.h" | 24 #include "webrtc/common_video/include/video_bitrate_allocator.h" |
| 25 #include "webrtc/common_video/include/video_frame.h" |
| 25 #include "webrtc/modules/pacing/paced_sender.h" | 26 #include "webrtc/modules/pacing/paced_sender.h" |
| 26 #include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h" | 27 #include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h" |
| 27 #include "webrtc/modules/video_coding/include/video_codec_initializer.h" | 28 #include "webrtc/modules/video_coding/include/video_codec_initializer.h" |
| 28 #include "webrtc/modules/video_coding/include/video_coding.h" | 29 #include "webrtc/modules/video_coding/include/video_coding.h" |
| 29 #include "webrtc/modules/video_coding/include/video_coding_defines.h" | 30 #include "webrtc/modules/video_coding/include/video_coding_defines.h" |
| 30 #include "webrtc/video/overuse_frame_detector.h" | 31 #include "webrtc/video/overuse_frame_detector.h" |
| 31 #include "webrtc/video/send_statistics_proxy.h" | 32 #include "webrtc/video/send_statistics_proxy.h" |
| 32 #include "webrtc/video_frame.h" | 33 |
| 33 namespace webrtc { | 34 namespace webrtc { |
| 34 | 35 |
| 35 namespace { | 36 namespace { |
| 36 | 37 |
| 37 // Time interval for logging frame counts. | 38 // Time interval for logging frame counts. |
| 38 const int64_t kFrameLogIntervalMs = 60000; | 39 const int64_t kFrameLogIntervalMs = 60000; |
| 39 | 40 |
| 40 // We will never ask for a resolution lower than this. | 41 // We will never ask for a resolution lower than this. |
| 41 // TODO(kthelgason): Lower this limit when better testing | 42 // TODO(kthelgason): Lower this limit when better testing |
| 42 // on MediaCodec and fallback implementations are in place. | 43 // on MediaCodec and fallback implementations are in place. |
| (...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 void ViEEncoder::IncrementScaleCounter(int reason, int delta) { | 984 void ViEEncoder::IncrementScaleCounter(int reason, int delta) { |
| 984 // Get the counters and validate. This may also lazily initialize the state. | 985 // Get the counters and validate. This may also lazily initialize the state. |
| 985 const std::vector<int>& counter = GetScaleCounters(); | 986 const std::vector<int>& counter = GetScaleCounters(); |
| 986 if (delta < 0) { | 987 if (delta < 0) { |
| 987 RTC_DCHECK_GE(counter[reason], delta); | 988 RTC_DCHECK_GE(counter[reason], delta); |
| 988 } | 989 } |
| 989 scale_counters_[degradation_preference_][reason] += delta; | 990 scale_counters_[degradation_preference_][reason] += delta; |
| 990 } | 991 } |
| 991 | 992 |
| 992 } // namespace webrtc | 993 } // namespace webrtc |
| OLD | NEW |