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 <lndmrk@webrtc.org>
Auto-Submit: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#37093}
This commit is contained in:
Danil Chapovalov
2022-06-02 12:59:53 +02:00
committed by WebRTC LUCI CQ
parent 917ebd40c9
commit 3eedc90052
2 changed files with 9 additions and 11 deletions

View File

@ -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;
}

View File

@ -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);