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

Unified Diff: webrtc/video/vie_encoder.cc

Issue 1754283002: Make ReconfigureVideoEncoder void. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Kbps Created 4 years, 10 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
« no previous file with comments | « webrtc/video/vie_encoder.h ('k') | webrtc/video_send_stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/vie_encoder.cc
diff --git a/webrtc/video/vie_encoder.cc b/webrtc/video/vie_encoder.cc
index c1f6b0971afbbd3c87eed974cb13685e20b16870..1433879f2d623a3086009308bf9ddf9dd6f551d9 100644
--- a/webrtc/video/vie_encoder.cc
+++ b/webrtc/video/vie_encoder.cc
@@ -194,20 +194,19 @@ int32_t ViEEncoder::DeRegisterExternalEncoder(uint8_t pl_type) {
}
return 0;
}
-
-int32_t ViEEncoder::SetEncoder(const webrtc::VideoCodec& video_codec) {
+void ViEEncoder::SetEncoder(const webrtc::VideoCodec& video_codec) {
RTC_DCHECK(send_payload_router_ != NULL);
// Setting target width and height for VPM.
- if (vp_->SetTargetResolution(video_codec.width, video_codec.height,
- video_codec.maxFramerate) != VPM_OK) {
- return -1;
- }
+ RTC_CHECK_EQ(VPM_OK,
+ vp_->SetTargetResolution(video_codec.width, video_codec.height,
+ video_codec.maxFramerate));
// Cache codec before calling AddBitrateObserver (which calls OnNetworkChanged
// that makes use of the number of simulcast streams configured).
{
rtc::CritScope lock(&data_cs_);
encoder_config_ = video_codec;
+ encoder_paused_ = true;
}
// Add a bitrate observer to the allocator and update the start, max and
@@ -220,12 +219,19 @@ int32_t ViEEncoder::SetEncoder(const webrtc::VideoCodec& video_codec) {
modified_video_codec.startBitrate = allocated_bitrate_bps / 1000;
size_t max_data_payload_length = send_payload_router_->MaxPayloadLength();
- if (vcm_->RegisterSendCodec(&modified_video_codec, number_of_cores_,
- static_cast<uint32_t>(max_data_payload_length)) !=
- VCM_OK) {
- return -1;
+ bool success = vcm_->RegisterSendCodec(
+ &modified_video_codec, number_of_cores_,
+ static_cast<uint32_t>(max_data_payload_length)) == VCM_OK;
+ if (!success) {
+ LOG(LS_ERROR) << "Failed to configure encoder.";
+ RTC_DCHECK(success);
}
- return 0;
+
+ send_payload_router_->SetSendingRtpModules(
+ video_codec.numberOfSimulcastStreams);
+
+ // Restart the media flow
+ Restart();
}
int ViEEncoder::GetPaddingNeededBps() const {
« no previous file with comments | « webrtc/video/vie_encoder.h ('k') | webrtc/video_send_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698