diff options
Diffstat (limited to 'third_party/libwebrtc/video/rtp_video_stream_receiver2.cc')
-rw-r--r-- | third_party/libwebrtc/video/rtp_video_stream_receiver2.cc | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/third_party/libwebrtc/video/rtp_video_stream_receiver2.cc b/third_party/libwebrtc/video/rtp_video_stream_receiver2.cc index 077f522d41..ae78ef8eef 100644 --- a/third_party/libwebrtc/video/rtp_video_stream_receiver2.cc +++ b/third_party/libwebrtc/video/rtp_video_stream_receiver2.cc @@ -302,8 +302,12 @@ RtpVideoStreamReceiver2::RtpVideoStreamReceiver2( frames_decryptable_(false), absolute_capture_time_interpolator_(clock) { packet_sequence_checker_.Detach(); - if (packet_router_) - packet_router_->AddReceiveRtpModule(rtp_rtcp_.get(), config_.rtp.remb); + if (packet_router_) { + // Do not register as REMB candidate, this is only done when starting to + // receive. + packet_router_->AddReceiveRtpModule(rtp_rtcp_.get(), + /*remb_candidate=*/false); + } RTC_DCHECK(config_.rtp.rtcp_mode != RtcpMode::kOff) << "A stream should not be configured with RTCP disabled. This value is " @@ -814,6 +818,7 @@ void RtpVideoStreamReceiver2::OnInsertedPacket( if (packet->is_last_packet_in_frame()) { auto depacketizer_it = payload_type_map_.find(first_packet->payload_type); RTC_CHECK(depacketizer_it != payload_type_map_.end()); + RTC_CHECK(depacketizer_it->second); rtc::scoped_refptr<EncodedImageBuffer> bitstream = depacketizer_it->second->AssembleFrame(payloads); @@ -1278,11 +1283,23 @@ void RtpVideoStreamReceiver2::SignalNetworkState(NetworkState state) { void RtpVideoStreamReceiver2::StartReceive() { RTC_DCHECK_RUN_ON(&packet_sequence_checker_); + if (!receiving_ && packet_router_) { + // Change REMB candidate egibility. + packet_router_->RemoveReceiveRtpModule(rtp_rtcp_.get()); + packet_router_->AddReceiveRtpModule(rtp_rtcp_.get(), + /*remb_candidate=*/config_.rtp.remb); + } receiving_ = true; } void RtpVideoStreamReceiver2::StopReceive() { RTC_DCHECK_RUN_ON(&packet_sequence_checker_); + if (receiving_ && packet_router_) { + // Change REMB candidate egibility. + packet_router_->RemoveReceiveRtpModule(rtp_rtcp_.get()); + packet_router_->AddReceiveRtpModule(rtp_rtcp_.get(), + /*remb_candidate=*/false); + } receiving_ = false; } |