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

Unified Diff: webrtc/video_engine/vie_encoder.cc

Issue 1231273004: Base padding bitrate for an encoder on the bitrate allocated for that encoder, rather than the tota… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: move some code around Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/video_engine/vie_encoder.cc
diff --git a/webrtc/video_engine/vie_encoder.cc b/webrtc/video_engine/vie_encoder.cc
index 0eea5f5506290a5ab922c628048fe4f48265f36d..8b38d95c9f4db2ed6390671e686e88af6fcf94d7 100644
--- a/webrtc/video_engine/vie_encoder.cc
+++ b/webrtc/video_engine/vie_encoder.cc
@@ -397,9 +397,10 @@ int32_t ViEEncoder::ScaleInputImage(bool enable) {
return 0;
}
-int ViEEncoder::GetPaddingNeededBps(int bitrate_bps) const {
+int ViEEncoder::GetPaddingNeededBps() const {
int64_t time_of_last_frame_activity_ms;
int min_transmit_bitrate_bps;
+ int bitrate_bps;
{
CriticalSectionScoped cs(data_cs_.get());
bool send_padding =
@@ -408,17 +409,15 @@ int ViEEncoder::GetPaddingNeededBps(int bitrate_bps) const {
return 0;
time_of_last_frame_activity_ms = time_of_last_frame_activity_ms_;
min_transmit_bitrate_bps = 1000 * min_transmit_bitrate_kbps_;
+ bitrate_bps = last_observed_bitrate_bps_;
}
+ bool video_is_suspended = vcm_->VideoSuspended();
+
pbos-webrtc 2015/07/15 10:52:36 git cl format, yo.
stefan-webrtc 2015/07/15 10:54:52 Done.
+
VideoCodec send_codec;
if (vcm_->SendCodec(&send_codec) != 0)
return 0;
- SimulcastStream* stream_configs = send_codec.simulcastStream;
- // Allocate the bandwidth between the streams.
- std::vector<uint32_t> stream_bitrates = AllocateStreamBitrates(
- bitrate_bps, stream_configs, send_codec.numberOfSimulcastStreams);
-
- bool video_is_suspended = vcm_->VideoSuspended();
// Find the max amount of padding we can allow ourselves to send at this
// point, based on which streams are currently active and what our current
@@ -427,6 +426,7 @@ int ViEEncoder::GetPaddingNeededBps(int bitrate_bps) const {
if (send_codec.numberOfSimulcastStreams == 0) {
pad_up_to_bitrate_bps = send_codec.minBitrate * 1000;
} else {
+ SimulcastStream* stream_configs = send_codec.simulcastStream;
pad_up_to_bitrate_bps =
stream_configs[send_codec.numberOfSimulcastStreams - 1].minBitrate *
1000;
« webrtc/video_engine/vie_channel_group.cc ('K') | « webrtc/video_engine/vie_encoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698