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 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
771 LOG(LS_INFO) << "Dropping frame. Too large for target bitrate."; | 771 LOG(LS_INFO) << "Dropping frame. Too large for target bitrate."; |
772 AdaptDown(kQuality); | 772 AdaptDown(kQuality); |
773 ++initial_rampup_; | 773 ++initial_rampup_; |
774 return; | 774 return; |
775 } | 775 } |
776 initial_rampup_ = kMaxInitialFramedrop; | 776 initial_rampup_ = kMaxInitialFramedrop; |
777 | 777 |
778 int64_t now_ms = clock_->TimeInMilliseconds(); | 778 int64_t now_ms = clock_->TimeInMilliseconds(); |
779 if (pending_encoder_reconfiguration_) { | 779 if (pending_encoder_reconfiguration_) { |
780 ReconfigureEncoder(); | 780 ReconfigureEncoder(); |
| 781 last_parameters_update_ms_.emplace(now_ms); |
781 } else if (!last_parameters_update_ms_ || | 782 } else if (!last_parameters_update_ms_ || |
782 now_ms - *last_parameters_update_ms_ >= | 783 now_ms - *last_parameters_update_ms_ >= |
783 vcm::VCMProcessTimer::kDefaultProcessIntervalMs) { | 784 vcm::VCMProcessTimer::kDefaultProcessIntervalMs) { |
784 video_sender_.UpdateChannelParemeters(rate_allocator_.get(), | 785 video_sender_.UpdateChannelParemeters(rate_allocator_.get(), |
785 bitrate_observer_); | 786 bitrate_observer_); |
| 787 last_parameters_update_ms_.emplace(now_ms); |
786 } | 788 } |
787 last_parameters_update_ms_.emplace(now_ms); | |
788 | 789 |
789 if (EncoderPaused()) { | 790 if (EncoderPaused()) { |
790 TraceFrameDropStart(); | 791 TraceFrameDropStart(); |
791 return; | 792 return; |
792 } | 793 } |
793 TraceFrameDropEnd(); | 794 TraceFrameDropEnd(); |
794 | 795 |
795 VideoFrame out_frame(video_frame); | 796 VideoFrame out_frame(video_frame); |
796 // Crop frame if needed. | 797 // Crop frame if needed. |
797 if (crop_width_ > 0 || crop_height_ > 0) { | 798 if (crop_width_ > 0 || crop_height_ > 0) { |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1240 std::string ViEEncoder::AdaptCounter::ToString( | 1241 std::string ViEEncoder::AdaptCounter::ToString( |
1241 const std::vector<int>& counters) const { | 1242 const std::vector<int>& counters) const { |
1242 std::stringstream ss; | 1243 std::stringstream ss; |
1243 for (size_t reason = 0; reason < kScaleReasonSize; ++reason) { | 1244 for (size_t reason = 0; reason < kScaleReasonSize; ++reason) { |
1244 ss << (reason ? " cpu" : "quality") << ":" << counters[reason]; | 1245 ss << (reason ? " cpu" : "quality") << ":" << counters[reason]; |
1245 } | 1246 } |
1246 return ss.str(); | 1247 return ss.str(); |
1247 } | 1248 } |
1248 | 1249 |
1249 } // namespace webrtc | 1250 } // namespace webrtc |
OLD | NEW |