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

Unified Diff: webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc

Issue 2434073003: Extract bitrate allocation of spatial/temporal layers out of codec impl. (Closed)
Patch Set: Addressed comments. Moved VideoCodec creation to factory class. 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/modules/video_coding/codecs/h264/h264_encoder_impl.cc
diff --git a/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc b/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
index 2070f22890ff90d3028f91ab034ae342c7014bce..2ea76fdc6c4b96b093e835c5845dcfa9b435c492 100644
--- a/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
+++ b/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
@@ -252,11 +252,13 @@ int32_t H264EncoderImpl::RegisterEncodeCompleteCallback(
return WEBRTC_VIDEO_CODEC_OK;
}
-int32_t H264EncoderImpl::SetRates(uint32_t bitrate, uint32_t framerate) {
- if (bitrate <= 0 || framerate <= 0) {
+int32_t H264EncoderImpl::SetRateAllocation(
+ const BitrateAllocation& bitrate_allocation,
+ uint32_t framerate) {
+ if (bitrate_allocation.get_sum_kbps() <= 0 || framerate <= 0) {
return WEBRTC_VIDEO_CODEC_ERR_PARAMETER;
}
- codec_settings_.targetBitrate = bitrate;
+ codec_settings_.targetBitrate = bitrate_allocation.get_sum_kbps();
codec_settings_.maxFramerate = framerate;
quality_scaler_.ReportFramerate(framerate);

Powered by Google App Engine
This is Rietveld 408576698