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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 } | 310 } |
311 // Reset the short-term averaged content data. | 311 // Reset the short-term averaged content data. |
312 content_->ResetShortTermAvgData(); | 312 content_->ResetShortTermAvgData(); |
313 } | 313 } |
314 | 314 |
315 CheckSuspendConditions(); | 315 CheckSuspendConditions(); |
316 | 316 |
317 return target_bit_rate_; | 317 return target_bit_rate_; |
318 } | 318 } |
319 | 319 |
320 void MediaOptimization::EnableProtectionMethod(bool enable, | 320 void MediaOptimization::SetProtectionMethod(VCMProtectionMethodEnum method) { |
321 VCMProtectionMethodEnum method) { | |
322 CriticalSectionScoped lock(crit_sect_.get()); | 321 CriticalSectionScoped lock(crit_sect_.get()); |
323 if (!enable && loss_prot_logic_->SelectedType() != method) | |
324 return; | |
325 if (!enable) | |
326 method = kNone; | |
327 loss_prot_logic_->SetMethod(method); | 322 loss_prot_logic_->SetMethod(method); |
328 } | 323 } |
329 | 324 |
330 uint32_t MediaOptimization::InputFrameRate() { | 325 uint32_t MediaOptimization::InputFrameRate() { |
331 CriticalSectionScoped lock(crit_sect_.get()); | 326 CriticalSectionScoped lock(crit_sect_.get()); |
332 return InputFrameRateInternal(); | 327 return InputFrameRateInternal(); |
333 } | 328 } |
334 | 329 |
335 uint32_t MediaOptimization::InputFrameRateInternal() { | 330 uint32_t MediaOptimization::InputFrameRateInternal() { |
336 ProcessIncomingFrameRate(clock_->TimeInMilliseconds()); | 331 ProcessIncomingFrameRate(clock_->TimeInMilliseconds()); |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 if (target_bit_rate_ > | 649 if (target_bit_rate_ > |
655 suspension_threshold_bps_ + suspension_window_bps_) { | 650 suspension_threshold_bps_ + suspension_window_bps_) { |
656 video_suspended_ = false; | 651 video_suspended_ = false; |
657 } | 652 } |
658 } | 653 } |
659 } | 654 } |
660 } | 655 } |
661 | 656 |
662 } // namespace media_optimization | 657 } // namespace media_optimization |
663 } // namespace webrtc | 658 } // namespace webrtc |
OLD | NEW |