OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 key_frame_ratio_.Reset(kDefaultKeyFrameRatioAlpha); | 66 key_frame_ratio_.Reset(kDefaultKeyFrameRatioAlpha); |
67 key_frame_ratio_.Apply(1.0f, kDefaultKeyFrameRatioValue); | 67 key_frame_ratio_.Apply(1.0f, kDefaultKeyFrameRatioValue); |
68 delta_frame_size_avg_kbits_.Reset(kDefaultFrameSizeAlpha); | 68 delta_frame_size_avg_kbits_.Reset(kDefaultFrameSizeAlpha); |
69 | 69 |
70 accumulator_ = 0.0f; | 70 accumulator_ = 0.0f; |
71 accumulator_max_ = kDefaultTargetBitrateKbps / 2; | 71 accumulator_max_ = kDefaultTargetBitrateKbps / 2; |
72 target_bitrate_ = kDefaultTargetBitrateKbps; | 72 target_bitrate_ = kDefaultTargetBitrateKbps; |
73 incoming_frame_rate_ = kDefaultIncomingFrameRate; | 73 incoming_frame_rate_ = kDefaultIncomingFrameRate; |
74 | 74 |
75 large_frame_accumulation_count_ = 0; | 75 large_frame_accumulation_count_ = 0; |
| 76 large_frame_accumulation_chunk_size_ = 0; |
76 large_frame_accumulation_spread_ = 0.5 * kDefaultIncomingFrameRate; | 77 large_frame_accumulation_spread_ = 0.5 * kDefaultIncomingFrameRate; |
77 | 78 |
78 drop_next_ = false; | 79 drop_next_ = false; |
79 drop_ratio_.Reset(0.9f); | 80 drop_ratio_.Reset(0.9f); |
80 drop_ratio_.Apply(0.0f, 0.0f); | 81 drop_ratio_.Apply(0.0f, 0.0f); |
81 drop_count_ = 0; | 82 drop_count_ = 0; |
82 was_below_max_ = true; | 83 was_below_max_ = true; |
83 } | 84 } |
84 | 85 |
85 void FrameDropper::Enable(bool enable) { | 86 void FrameDropper::Enable(bool enable) { |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 // This is a temporary fix for screencasting where very large frames from | 271 // This is a temporary fix for screencasting where very large frames from |
271 // encoder will cause very slow response (too many frame drops). | 272 // encoder will cause very slow response (too many frame drops). |
272 // TODO(isheriff): Remove this now that large delta frames are also spread out ? | 273 // TODO(isheriff): Remove this now that large delta frames are also spread out ? |
273 void FrameDropper::CapAccumulator() { | 274 void FrameDropper::CapAccumulator() { |
274 float max_accumulator = target_bitrate_ * kAccumulatorCapBufferSizeSecs; | 275 float max_accumulator = target_bitrate_ * kAccumulatorCapBufferSizeSecs; |
275 if (accumulator_ > max_accumulator) { | 276 if (accumulator_ > max_accumulator) { |
276 accumulator_ = max_accumulator; | 277 accumulator_ = max_accumulator; |
277 } | 278 } |
278 } | 279 } |
279 } // namespace webrtc | 280 } // namespace webrtc |
OLD | NEW |