Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Side by Side Diff: webrtc/video/vie_encoder.cc

Issue 2953053002: Reland of Periodically update codec bit/frame rate settings. (Closed)
Patch Set: Fix bug and add test Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/video/video_send_stream_tests.cc ('k') | webrtc/video/vie_encoder_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webrtc/video/video_send_stream_tests.cc ('k') | webrtc/video/vie_encoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698