Add SetRtcpXr - set extended RTCP attributes without recreate.

Bug: webrtc:11993
Change-Id: Ie64b37c1e8a3f5b6fbcf671fce4ed642c74521cd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/271300
Reviewed-by: Rasmus Brandt <brandtr@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37776}
This commit is contained in:
Tommi 2022-08-12 22:06:20 +02:00 committed by WebRTC LUCI CQ
parent 7dc5e11666
commit 2e809365d7
7 changed files with 21 additions and 2 deletions

View File

@ -305,6 +305,8 @@ class VideoReceiveStreamInterface : public MediaReceiveStreamInterface {
virtual void SetUlpfecPayloadType(int ulpfec_payload_type) = 0;
virtual void SetRtcpXr(Config::Rtp::RtcpXr rtcp_xr) = 0;
protected:
virtual ~VideoReceiveStreamInterface() {}
};

View File

@ -302,6 +302,10 @@ class FakeVideoReceiveStream final
config_.rtp.ulpfec_payload_type = ulpfec_payload_type;
}
void SetRtcpXr(Config::Rtp::RtcpXr rtcp_xr) override {
config_.rtp.rtcp_xr = rtcp_xr;
}
void Start() override;
void Stop() override;

View File

@ -3010,9 +3010,8 @@ bool WebRtcVideoChannel::WebRtcVideoReceiveStream::ReconfigureCodecs(
const bool has_rtr = HasRrtr(codec.codec);
if (has_rtr != config_.rtp.rtcp_xr.receiver_reference_time_report) {
// TODO(tommi): Look into if/when this happens in practice.
config_.rtp.rtcp_xr.receiver_reference_time_report = has_rtr;
recreate_needed = true;
stream_->SetRtcpXr(config_.rtp.rtcp_xr);
}
if (codec.ulpfec.red_rtx_payload_type != -1) {

View File

@ -959,6 +959,11 @@ void RtpVideoStreamReceiver2::SetRtcpMode(RtcpMode mode) {
rtp_rtcp_->SetRTCPStatus(mode);
}
void RtpVideoStreamReceiver2::SetReferenceTimeReport(bool enabled) {
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
rtp_rtcp_->SetNonSenderRttMeasurement(enabled);
}
void RtpVideoStreamReceiver2::SetPacketSink(
RtpPacketSinkInterface* packet_sink) {
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);

View File

@ -185,6 +185,8 @@ class RtpVideoStreamReceiver2 : public LossNotificationSender,
// Forwards the call to set rtcp_sender_ to the RTCP mode of the rtcp sender.
void SetRtcpMode(RtcpMode mode);
void SetReferenceTimeReport(bool enabled);
// Sets or clears the callback sink that gets called for RTP packets. Used for
// packet handlers such as FlexFec. Must be called on the packet delivery
// thread (same context as `OnRtpPacket` is called on).

View File

@ -556,6 +556,12 @@ void VideoReceiveStream2::SetUlpfecPayloadType(int payload_type) {
rtp_video_stream_receiver_.set_ulpfec_payload_type(payload_type);
}
void VideoReceiveStream2::SetRtcpXr(Config::Rtp::RtcpXr rtcp_xr) {
RTC_DCHECK_RUN_ON(&packet_sequence_checker_);
rtp_video_stream_receiver_.SetReferenceTimeReport(
rtcp_xr.receiver_reference_time_report);
}
void VideoReceiveStream2::CreateAndRegisterExternalDecoder(
const Decoder& decoder) {
TRACE_EVENT0("webrtc",

View File

@ -152,6 +152,7 @@ class VideoReceiveStream2
void SetLossNotificationEnabled(bool enabled) override;
void SetNackHistory(TimeDelta history) override;
void SetUlpfecPayloadType(int payload_type) override;
void SetRtcpXr(Config::Rtp::RtcpXr rtcp_xr) override;
webrtc::VideoReceiveStreamInterface::Stats GetStats() const override;