Update the red_payload_type without recreating video receive streams.

A follow-up change will combine the setters for ulpfec and red payload
types, since they're entwined.

Bug: webrtc:11993
Change-Id: Ifea7fe9f4ebc7ac88a62db6cd6748f4d3c20db4c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271482
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37785}
This commit is contained in:
Tommi
2022-08-13 10:43:59 +02:00
committed by WebRTC LUCI CQ
parent 875c9d357b
commit 1c5f317e17
7 changed files with 53 additions and 11 deletions

View File

@ -2973,16 +2973,18 @@ bool WebRtcVideoChannel::WebRtcVideoReceiveStream::ReconfigureCodecs(
raw_payload_types, decoders);
const auto& codec = recv_codecs.front();
if (config_.rtp.ulpfec_payload_type != codec.ulpfec.ulpfec_payload_type) {
config_.rtp.ulpfec_payload_type = codec.ulpfec.ulpfec_payload_type;
stream_->SetUlpfecPayloadType(config_.rtp.ulpfec_payload_type);
}
bool recreate_needed = false;
if (config_.rtp.red_payload_type != codec.ulpfec.red_payload_type) {
config_.rtp.red_payload_type = codec.ulpfec.red_payload_type;
recreate_needed = true;
stream_->SetRedPayloadType(codec.ulpfec.red_payload_type);
}
// Check and optionally set `ulpfec_payload_type` _after_ checking the
// `red_payload_type` due to encapsulation. See RtpVideoStreamReceiver2
// for more details.
if (config_.rtp.ulpfec_payload_type != codec.ulpfec.ulpfec_payload_type) {
config_.rtp.ulpfec_payload_type = codec.ulpfec.ulpfec_payload_type;
stream_->SetUlpfecPayloadType(config_.rtp.ulpfec_payload_type);
}
const bool has_lntf = HasLntf(codec.codec);
@ -3020,6 +3022,8 @@ bool WebRtcVideoChannel::WebRtcVideoReceiveStream::ReconfigureCodecs(
codec.ulpfec.red_payload_type;
}
bool recreate_needed = false;
if (config_.rtp.rtx_associated_payload_types !=
rtx_associated_payload_types) {
rtx_associated_payload_types.swap(config_.rtp.rtx_associated_payload_types);