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

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: Fixed sign mismatch Created 4 years, 2 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/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 3dfa0b559d1228725ae8820bbb0f2aecd551b410..18b2cf2568bc63f451ead0fd7323566c2a6080fa 100644
--- a/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
+++ b/webrtc/modules/video_coding/codecs/h264/h264_encoder_impl.cc
@@ -149,10 +149,10 @@ static void RtpFragmentize(EncodedImage* encoded_image,
H264EncoderImpl::H264EncoderImpl()
: openh264_encoder_(nullptr),
+ number_of_cores_(0),
encoded_image_callback_(nullptr),
has_reported_init_(false),
- has_reported_error_(false) {
-}
+ has_reported_error_(false) {}
H264EncoderImpl::~H264EncoderImpl() {
Release();
@@ -249,11 +249,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