From 3eedc90052e3123d818fe3698b048ab98ea2fa5c Mon Sep 17 00:00:00 2001 From: Danil Chapovalov Date: Thu, 2 Jun 2022 12:59:53 +0200 Subject: [PATCH] Review RtcpTransciverConfig warnings Move warning about missing receive_statistics to AddReceiver to avoid producing it for rtp send only endpoints. Remove warning about missing cname as unimportant. Bug: webrtc:8239 Change-Id: I8a90aa4b378284b9c68f67678b2392b9461c95b4 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/264825 Reviewed-by: Emil Lundmark Auto-Submit: Danil Chapovalov Commit-Queue: Danil Chapovalov Cr-Commit-Position: refs/heads/main@{#37093} --- .../rtp_rtcp/source/rtcp_transceiver_config.cc | 15 ++++----------- modules/rtp_rtcp/source/rtcp_transceiver_impl.cc | 5 +++++ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/modules/rtp_rtcp/source/rtcp_transceiver_config.cc b/modules/rtp_rtcp/source/rtcp_transceiver_config.cc index ebf9a2820e..7acaa0f600 100644 --- a/modules/rtp_rtcp/source/rtcp_transceiver_config.cc +++ b/modules/rtp_rtcp/source/rtcp_transceiver_config.cc @@ -23,13 +23,11 @@ RtcpTransceiverConfig& RtcpTransceiverConfig::operator=( RtcpTransceiverConfig::~RtcpTransceiverConfig() = default; bool RtcpTransceiverConfig::Validate() const { - if (feedback_ssrc == 0) + if (feedback_ssrc == 0) { RTC_LOG(LS_WARNING) << debug_id << "Ssrc 0 may be treated by some implementation as invalid."; - if (cname.empty()) - RTC_LOG(LS_WARNING) << debug_id << "missing cname for ssrc " - << feedback_ssrc; + } if (cname.size() > 255) { RTC_LOG(LS_ERROR) << debug_id << "cname can be maximum 255 characters."; return false; @@ -71,16 +69,11 @@ bool RtcpTransceiverConfig::Validate() const { RTC_LOG(LS_ERROR) << debug_id << "unsupported rtcp mode"; return false; } - if (non_sender_rtt_measurement && !network_link_observer) + if (non_sender_rtt_measurement && !network_link_observer) { RTC_LOG(LS_WARNING) << debug_id << "Enabled special feature to calculate rtt, but no " "rtt observer is provided."; - // TODO(danilchap): Remove or update the warning when RtcpTransceiver supports - // send-only sessions. - if (receive_statistics == nullptr) - RTC_LOG(LS_WARNING) - << debug_id - << "receive statistic should be set to generate rtcp report blocks."; + } return true; } diff --git a/modules/rtp_rtcp/source/rtcp_transceiver_impl.cc b/modules/rtp_rtcp/source/rtcp_transceiver_impl.cc index 80cb8b9e4d..f6c9085b02 100644 --- a/modules/rtp_rtcp/source/rtcp_transceiver_impl.cc +++ b/modules/rtp_rtcp/source/rtcp_transceiver_impl.cc @@ -112,6 +112,11 @@ RtcpTransceiverImpl::~RtcpTransceiverImpl() = default; void RtcpTransceiverImpl::AddMediaReceiverRtcpObserver( uint32_t remote_ssrc, MediaReceiverRtcpObserver* observer) { + if (config_.receive_statistics == nullptr && remote_senders_.empty()) { + RTC_LOG(LS_WARNING) << config_.debug_id + << "receive statistic is not set. RTCP report blocks " + "will not be generated."; + } auto& stored = remote_senders_[remote_ssrc].observers; RTC_DCHECK(!absl::c_linear_search(stored, observer)); stored.push_back(observer);