From 0e1a1f9e7c3df4d33d6fa6cb140728907b76c72e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20Spr=C3=A5ng?= Date: Mon, 18 Feb 2019 18:45:13 +0100 Subject: [PATCH] Add verbose logging to encoder bitrate adjuster MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:10155 Change-Id: I69a13c2c3980a2db1b2c2f75fd06e84b670745e0 Reviewed-on: https://webrtc-review.googlesource.com/c/123382 Reviewed-by: Ilya Nikolaevskiy Commit-Queue: Erik Språng Cr-Commit-Position: refs/heads/master@{#26745} --- video/encoder_bitrate_adjuster.cc | 5 +++++ video/video_stream_encoder.cc | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/video/encoder_bitrate_adjuster.cc b/video/encoder_bitrate_adjuster.cc index eb6017c787..6fa35047ff 100644 --- a/video/encoder_bitrate_adjuster.cc +++ b/video/encoder_bitrate_adjuster.cc @@ -139,6 +139,11 @@ VideoBitrateAllocation EncoderBitrateAdjuster::AdjustRateAllocation( min_bitrates_bps_[si]); } + if (spatial_layer_bitrate_bps > 0) { + RTC_LOG(LS_VERBOSE) << "Utilization factor for spatial index " << si + << ": " << utilization_factor; + } + // Populate the adjusted allocation with determined utilization factor. if (active_tls_[si] == 1 && spatial_layer_bitrate_bps > bitrate_allocation.GetBitrate(si, 0)) { diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc index 8436dd8a3d..6066ac5d75 100644 --- a/video/video_stream_encoder.cc +++ b/video/video_stream_encoder.cc @@ -858,8 +858,13 @@ VideoStreamEncoder::GetBitrateAllocationAndNotifyObserver( } if (bitrate_adjuster_) { - return bitrate_adjuster_->AdjustRateAllocation(bitrate_allocation, - framerate_fps); + VideoBitrateAllocation adjusted_allocation = + bitrate_adjuster_->AdjustRateAllocation(bitrate_allocation, + framerate_fps); + RTC_LOG(LS_VERBOSE) << "Adjusting allocation, fps = " << framerate_fps + << ", from " << bitrate_allocation.ToString() << ", to " + << adjusted_allocation.ToString(); + return adjusted_allocation; } return bitrate_allocation; }