diff --git a/call/video_receive_stream.h b/call/video_receive_stream.h index f4ed0a9196..79edf9d5fd 100644 --- a/call/video_receive_stream.h +++ b/call/video_receive_stream.h @@ -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() {} }; diff --git a/media/engine/fake_webrtc_call.h b/media/engine/fake_webrtc_call.h index b076fd9ee7..f34bb5b1a6 100644 --- a/media/engine/fake_webrtc_call.h +++ b/media/engine/fake_webrtc_call.h @@ -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; diff --git a/media/engine/webrtc_video_engine.cc b/media/engine/webrtc_video_engine.cc index c39bf67fbd..b02fa4dc51 100644 --- a/media/engine/webrtc_video_engine.cc +++ b/media/engine/webrtc_video_engine.cc @@ -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) { diff --git a/video/rtp_video_stream_receiver2.cc b/video/rtp_video_stream_receiver2.cc index 9aa5f0a5ba..2b765d9d1c 100644 --- a/video/rtp_video_stream_receiver2.cc +++ b/video/rtp_video_stream_receiver2.cc @@ -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_); diff --git a/video/rtp_video_stream_receiver2.h b/video/rtp_video_stream_receiver2.h index 4fa216c113..ab84007113 100644 --- a/video/rtp_video_stream_receiver2.h +++ b/video/rtp_video_stream_receiver2.h @@ -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). diff --git a/video/video_receive_stream2.cc b/video/video_receive_stream2.cc index 5015c2d080..1b8c5194f5 100644 --- a/video/video_receive_stream2.cc +++ b/video/video_receive_stream2.cc @@ -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", diff --git a/video/video_receive_stream2.h b/video/video_receive_stream2.h index fccec055d5..01cbf73c57 100644 --- a/video/video_receive_stream2.h +++ b/video/video_receive_stream2.h @@ -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;