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

Unified Diff: webrtc/media/engine/videoencodersoftwarefallbackwrapper.cc

Issue 2510583002: Reland #2 of Issue 2434073003: Extract bitrate allocation ... (Closed)
Patch Set: Addressed comments Created 4 years, 1 month 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/media/engine/videoencodersoftwarefallbackwrapper.cc
diff --git a/webrtc/media/engine/videoencodersoftwarefallbackwrapper.cc b/webrtc/media/engine/videoencodersoftwarefallbackwrapper.cc
index cd39f68c1a9b4fc32690daef492cfd8571b037b5..cc37a91736e9e1df696e32ecbba445ff0bd43c4b 100644
--- a/webrtc/media/engine/videoencodersoftwarefallbackwrapper.cc
+++ b/webrtc/media/engine/videoencodersoftwarefallbackwrapper.cc
@@ -18,8 +18,13 @@ namespace webrtc {
VideoEncoderSoftwareFallbackWrapper::VideoEncoderSoftwareFallbackWrapper(
VideoCodecType codec_type,
webrtc::VideoEncoder* encoder)
- : rates_set_(false),
+ : number_of_cores_(0),
+ max_payload_size_(0),
+ rates_set_(false),
+ framerate_(0),
channel_parameters_set_(false),
+ packet_loss_(0),
+ rtt_(0),
encoder_type_(CodecToEncoderType(codec_type)),
encoder_(encoder),
callback_(nullptr) {}
@@ -43,7 +48,7 @@ bool VideoEncoderSoftwareFallbackWrapper::InitFallbackEncoder() {
if (callback_)
fallback_encoder_->RegisterEncodeCompleteCallback(callback_);
if (rates_set_)
- fallback_encoder_->SetRates(bitrate_, framerate_);
+ fallback_encoder_->SetRateAllocation(bitrate_allocation_, framerate_);
if (channel_parameters_set_)
fallback_encoder_->SetChannelParameters(packet_loss_, rtt_);
@@ -140,14 +145,15 @@ int32_t VideoEncoderSoftwareFallbackWrapper::SetChannelParameters(
return ret;
}
-int32_t VideoEncoderSoftwareFallbackWrapper::SetRates(uint32_t bitrate,
- uint32_t framerate) {
+int32_t VideoEncoderSoftwareFallbackWrapper::SetRateAllocation(
+ const BitrateAllocation& bitrate_allocation,
+ uint32_t framerate) {
rates_set_ = true;
- bitrate_ = bitrate;
+ bitrate_allocation_ = bitrate_allocation;
framerate_ = framerate;
- int32_t ret = encoder_->SetRates(bitrate, framerate);
+ int32_t ret = encoder_->SetRateAllocation(bitrate_allocation_, framerate);
if (fallback_encoder_)
- return fallback_encoder_->SetRates(bitrate, framerate);
+ return fallback_encoder_->SetRateAllocation(bitrate_allocation_, framerate);
return ret;
}

Powered by Google App Engine
This is Rietveld 408576698