Update RED PT in SetProtectionPayloadTypes

Update of red_payload_type_ was unintentionally removed in https://webrtc-review.googlesource.com/c/src/+/271640/5 which led to rejecting of video packets if RED payload changes.

Bug: webrtc:11993, b/255730463
Change-Id: I58635dd6c76689b01fd88d6c5c717b56493e7270
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/281260
Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Commit-Queue: Sergey Silkin <ssilkin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#38521}
This commit is contained in:
Sergey Silkin
2022-11-01 09:56:59 +01:00
committed by WebRTC LUCI CQ
parent b395f5bd5c
commit 1cb3cdece5
2 changed files with 11 additions and 0 deletions

View File

@ -1047,6 +1047,7 @@ void RtpVideoStreamReceiver2::SetProtectionPayloadTypes(
RTC_DCHECK_RUN_ON(&packet_sequence_checker_); RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
RTC_DCHECK(red_payload_type >= -1 && red_payload_type < 0x80); RTC_DCHECK(red_payload_type >= -1 && red_payload_type < 0x80);
RTC_DCHECK(ulpfec_payload_type >= -1 && ulpfec_payload_type < 0x80); RTC_DCHECK(ulpfec_payload_type >= -1 && ulpfec_payload_type < 0x80);
red_payload_type_ = red_payload_type;
ulpfec_receiver_ = MaybeConstructUlpfecReceiver( ulpfec_receiver_ = MaybeConstructUlpfecReceiver(
config_.rtp.remote_ssrc, red_payload_type, ulpfec_payload_type, config_.rtp.remote_ssrc, red_payload_type, ulpfec_payload_type,
config_.rtp.extensions, this, clock_); config_.rtp.extensions, this, clock_);

View File

@ -371,6 +371,16 @@ TEST_F(RtpVideoStreamReceiver2Test, GenericKeyFrame) {
video_header); video_header);
} }
TEST_F(RtpVideoStreamReceiver2Test, SetProtectionPayloadTypes) {
EXPECT_NE(rtp_video_stream_receiver_->red_payload_type(), 104);
EXPECT_NE(rtp_video_stream_receiver_->ulpfec_payload_type(), 107);
rtp_video_stream_receiver_->SetProtectionPayloadTypes(104, 107);
EXPECT_EQ(rtp_video_stream_receiver_->red_payload_type(), 104);
EXPECT_EQ(rtp_video_stream_receiver_->ulpfec_payload_type(), 107);
}
TEST_F(RtpVideoStreamReceiver2Test, PacketInfoIsPropagatedIntoVideoFrames) { TEST_F(RtpVideoStreamReceiver2Test, PacketInfoIsPropagatedIntoVideoFrames) {
constexpr uint64_t kAbsoluteCaptureTimestamp = 12; constexpr uint64_t kAbsoluteCaptureTimestamp = 12;
constexpr int kId0 = 1; constexpr int kId0 = 1;