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

Unified Diff: webrtc/video/video_send_stream.cc

Issue 2383493005: Revert of Let ViEEncoder handle resolution changes. (Closed)
Patch Set: Created 4 years, 3 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/video_quality_test.cc ('k') | webrtc/video/video_send_stream_tests.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_send_stream.cc
diff --git a/webrtc/video/video_send_stream.cc b/webrtc/video/video_send_stream.cc
index 2a727372afc7312ea7732454e3dffe95975facc9..259e828394d6604c586a89dbbbd0176b10058da8 100644
--- a/webrtc/video/video_send_stream.cc
+++ b/webrtc/video/video_send_stream.cc
@@ -521,11 +521,18 @@
config_.pre_encode_callback, config_.overuse_callback,
config_.post_encode_callback));
+ // TODO(perkj): Remove vector<VideoStreams> from VideoEncoderConfig and
+ // replace with max_bitrate. The VideoStream should be created by ViEEncoder
+ // when the video resolution is known.
+ int initial_max_encoder_bitrate = 0;
+ for (const auto& stream : encoder_config.streams)
+ initial_max_encoder_bitrate += stream.max_bitrate_bps;
+
worker_queue_->PostTask(std::unique_ptr<rtc::QueuedTask>(new ConstructionTask(
&send_stream_, &thread_sync_event_, &stats_proxy_, vie_encoder_.get(),
module_process_thread, call_stats, congestion_controller,
bitrate_allocator, send_delay_stats, remb, event_log, &config_,
- encoder_config.max_bitrate_bps, suspended_ssrcs)));
+ initial_max_encoder_bitrate, suspended_ssrcs)));
// Wait for ConstructionTask to complete so that |send_stream_| can be used.
// |module_process_thread| must be registered and deregistered on the thread
@@ -572,9 +579,12 @@
}
void VideoSendStream::ReconfigureVideoEncoder(VideoEncoderConfig config) {
- // TODO(perkj): Some test cases in VideoSendStreamTest call
- // ReconfigureVideoEncoder from the network thread.
- // RTC_DCHECK_RUN_ON(&thread_checker_);
+ // ReconfigureVideoEncoder will be called on the thread that deliverers video
+ // frames. We must change the encoder settings immediately so that
+ // the codec settings matches the next frame.
+ // TODO(perkj): Move logic for reconfiguration the encoder due to frame size
+ // change from WebRtcVideoChannel2::WebRtcVideoSendStream::OnFrame to
+ // be internally handled by ViEEncoder.
vie_encoder_->ConfigureEncoder(std::move(config),
config_.rtp.max_packet_size);
}
« no previous file with comments | « webrtc/video/video_quality_test.cc ('k') | webrtc/video/video_send_stream_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698