Sets sending status for active RtpRtcp modules.

When a simulcast stream is enabled or disabled, we want this state
change to be reflected properly in the RtpRtcp modules. Each video send
stream can contain multiple rtp_rtcp_modules pertaining to different
simulcast streams. These modules are currently all turned on/off when
the send stream is started and stopped. This change allows for
individual modules to be turned on/off. This means if a module stops
sending it will send a bye message, so the receiving side will not
expect more frames to be sent when the stream is inactive and the
encoder is no longer encoding/sending images.

Bug: webrtc:8653
Change-Id: Ib6d00240f627b4ff1714646e847026f24c7c3aa4
Reviewed-on: https://webrtc-review.googlesource.com/42841
Commit-Queue: Seth Hampson <shampson@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21880}
This commit is contained in:
Seth Hampson
2018-02-02 08:46:16 -08:00
committed by Commit Bot
parent d34dbac2ed
commit cc7125f240
12 changed files with 291 additions and 59 deletions

View File

@ -50,7 +50,13 @@ std::vector<VideoStream> CreateVideoStreams(
std::min(bitrate_left_bps,
DefaultVideoStreamFactory::kMaxBitratePerStream[i]);
stream_settings[i].max_qp = 56;
stream_settings[i].active = true;
if (i < encoder_config.simulcast_layers.size()) {
// Higher level controls are setting the active configuration for the
// VideoStream.
stream_settings[i].active = encoder_config.simulcast_layers[i].active;
} else {
stream_settings[i].active = true;
}
bitrate_left_bps -= stream_settings[i].target_bitrate_bps;
}
@ -78,6 +84,7 @@ void FillEncoderConfiguration(size_t num_streams,
configuration->video_stream_factory =
new rtc::RefCountedObject<DefaultVideoStreamFactory>();
configuration->max_bitrate_bps = 0;
configuration->simulcast_layers = std::vector<VideoStream>(num_streams);
for (size_t i = 0; i < num_streams; ++i) {
configuration->max_bitrate_bps +=
DefaultVideoStreamFactory::kMaxBitratePerStream[i];