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

Unified Diff: webrtc/video/video_encoder.cc

Issue 2434073003: Extract bitrate allocation of spatial/temporal layers out of codec impl. (Closed)
Patch Set: Rebase 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
« no previous file with comments | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/video/video_encoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_encoder.cc
diff --git a/webrtc/video/video_encoder.cc b/webrtc/video/video_encoder.cc
index bb6e9e23082ae0b93a6adaefa5bf6dc28f262658..dbfd0eb8db022670664dca4fef0055a240324848 100644
--- a/webrtc/video/video_encoder.cc
+++ b/webrtc/video/video_encoder.cc
@@ -67,8 +67,13 @@ VideoEncoder::EncoderType VideoEncoder::CodecToEncoderType(
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) {}
@@ -92,7 +97,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_);
@@ -189,14 +194,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;
}
« no previous file with comments | « webrtc/video/end_to_end_tests.cc ('k') | webrtc/video/video_encoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698