Delete OnIncomingCSRCChanged and related code.
Bug: webrtc:8995
Change-Id: I1987d1527cce5a0c315b2d15cfffa76e7343b1fa
Reviewed-on: https://webrtc-review.googlesource.com/64220
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22626}diff --git a/audio/channel.cc b/audio/channel.cc
index 7dd04d6..a7325c3 100644
--- a/audio/channel.cc
+++ b/audio/channel.cc
@@ -362,10 +362,6 @@
_rtpRtcpModule->SetRemoteSSRC(ssrc);
}
-void Channel::OnIncomingCSRCChanged(uint32_t CSRC, bool added) {
- // TODO(saza): remove.
-}
-
int32_t Channel::OnReceivedPayloadData(const uint8_t* payloadData,
size_t payloadSize,
const WebRtcRTPHeader* rtpHeader) {
diff --git a/audio/channel.h b/audio/channel.h
index dbb670a..ab25aad 100644
--- a/audio/channel.h
+++ b/audio/channel.h
@@ -250,7 +250,6 @@
// From RtpFeedback in the RTP/RTCP module
void OnIncomingSSRCChanged(uint32_t ssrc) override;
- void OnIncomingCSRCChanged(uint32_t CSRC, bool added) override;
// From Transport (called by the RTP/RTCP module)
bool SendRtp(const uint8_t* data,
diff --git a/modules/rtp_rtcp/include/rtp_rtcp_defines.h b/modules/rtp_rtcp/include/rtp_rtcp_defines.h
index f66ebb3..28ee47b 100644
--- a/modules/rtp_rtcp/include/rtp_rtcp_defines.h
+++ b/modules/rtp_rtcp/include/rtp_rtcp_defines.h
@@ -257,8 +257,6 @@
virtual ~RtpFeedback() {}
virtual void OnIncomingSSRCChanged(uint32_t ssrc) = 0;
-
- virtual void OnIncomingCSRCChanged(uint32_t csrc, bool added) = 0;
};
class RtcpIntraFrameObserver {
@@ -443,7 +441,6 @@
~NullRtpFeedback() override {}
void OnIncomingSSRCChanged(uint32_t ssrc) override {}
- void OnIncomingCSRCChanged(uint32_t csrc, bool added) override {}
};
// Statistics about packet loss for a single directional connection. All values
diff --git a/modules/rtp_rtcp/source/rtp_receiver_audio.cc b/modules/rtp_rtcp/source/rtp_receiver_audio.cc
index 26410ae..e3bbdd5 100644
--- a/modules/rtp_rtcp/source/rtp_receiver_audio.cc
+++ b/modules/rtp_rtcp/source/rtp_receiver_audio.cc
@@ -71,11 +71,6 @@
payload_type == cng_fb_payload_type_;
}
-bool RTPReceiverAudio::ShouldReportCsrcChanges(uint8_t payload_type) const {
- // Don't do this for DTMF packets, otherwise it's fine.
- return !TelephoneEventPayloadType(payload_type);
-}
-
// - Sample based or frame based codecs based on RFC 3551
// -
// - NOTE! There is one error in the RFC, stating G.722 uses 8 bits/samples.
diff --git a/modules/rtp_rtcp/source/rtp_receiver_audio.h b/modules/rtp_rtcp/source/rtp_receiver_audio.h
index 6e6cfc1..ded9d42 100644
--- a/modules/rtp_rtcp/source/rtp_receiver_audio.h
+++ b/modules/rtp_rtcp/source/rtp_receiver_audio.h
@@ -52,8 +52,6 @@
RTPAliveType ProcessDeadOrAlive(uint16_t last_payload_length) const override;
- bool ShouldReportCsrcChanges(uint8_t payload_type) const override;
-
int32_t OnNewPayloadTypeCreated(int payload_type,
const SdpAudioFormat& audio_format) override;
diff --git a/modules/rtp_rtcp/source/rtp_receiver_impl.cc b/modules/rtp_rtcp/source/rtp_receiver_impl.cc
index 1fd45bd..60056c8 100644
--- a/modules/rtp_rtcp/source/rtp_receiver_impl.cc
+++ b/modules/rtp_rtcp/source/rtp_receiver_impl.cc
@@ -102,11 +102,7 @@
memset(current_remote_csrc_, 0, sizeof(current_remote_csrc_));
}
-RtpReceiverImpl::~RtpReceiverImpl() {
- for (int i = 0; i < num_csrcs_; ++i) {
- cb_rtp_feedback_->OnIncomingCSRCChanged(current_remote_csrc_[i], false);
- }
-}
+RtpReceiverImpl::~RtpReceiverImpl() {}
int32_t RtpReceiverImpl::RegisterReceivePayload(
int payload_type,
@@ -342,84 +338,21 @@
// Implementation note: must not hold critsect when called.
void RtpReceiverImpl::CheckCSRC(const WebRtcRTPHeader& rtp_header) {
- int32_t num_csrcs_diff = 0;
- uint32_t old_remote_csrc[kRtpCsrcSize];
- uint8_t old_num_csrcs = 0;
-
+ const uint8_t num_csrcs = rtp_header.header.numCSRCs;
+ if (num_csrcs > kRtpCsrcSize) {
+ // Ignore.
+ return;
+ }
{
rtc::CritScope lock(&critical_section_rtp_receiver_);
- if (!rtp_media_receiver_->ShouldReportCsrcChanges(
- rtp_header.header.payloadType)) {
- return;
- }
- old_num_csrcs = num_csrcs_;
- if (old_num_csrcs > 0) {
- // Make a copy of old.
- memcpy(old_remote_csrc, current_remote_csrc_,
- num_csrcs_ * sizeof(uint32_t));
- }
- const uint8_t num_csrcs = rtp_header.header.numCSRCs;
- if ((num_csrcs > 0) && (num_csrcs <= kRtpCsrcSize)) {
- // Copy new.
- memcpy(current_remote_csrc_,
- rtp_header.header.arrOfCSRCs,
- num_csrcs * sizeof(uint32_t));
- }
- if (num_csrcs > 0 || old_num_csrcs > 0) {
- num_csrcs_diff = num_csrcs - old_num_csrcs;
- num_csrcs_ = num_csrcs; // Update stored CSRCs.
- } else {
- // No change.
- return;
- }
+ // Copy new.
+ memcpy(current_remote_csrc_,
+ rtp_header.header.arrOfCSRCs,
+ num_csrcs * sizeof(uint32_t));
+
+ num_csrcs_ = num_csrcs;
} // End critsect.
-
- bool have_called_callback = false;
- // Search for new CSRC in old array.
- for (uint8_t i = 0; i < rtp_header.header.numCSRCs; ++i) {
- const uint32_t csrc = rtp_header.header.arrOfCSRCs[i];
-
- bool found_match = false;
- for (uint8_t j = 0; j < old_num_csrcs; ++j) {
- if (csrc == old_remote_csrc[j]) { // old list
- found_match = true;
- break;
- }
- }
- if (!found_match && csrc) {
- // Didn't find it, report it as new.
- have_called_callback = true;
- cb_rtp_feedback_->OnIncomingCSRCChanged(csrc, true);
- }
- }
- // Search for old CSRC in new array.
- for (uint8_t i = 0; i < old_num_csrcs; ++i) {
- const uint32_t csrc = old_remote_csrc[i];
-
- bool found_match = false;
- for (uint8_t j = 0; j < rtp_header.header.numCSRCs; ++j) {
- if (csrc == rtp_header.header.arrOfCSRCs[j]) {
- found_match = true;
- break;
- }
- }
- if (!found_match && csrc) {
- // Did not find it, report as removed.
- have_called_callback = true;
- cb_rtp_feedback_->OnIncomingCSRCChanged(csrc, false);
- }
- }
- if (!have_called_callback) {
- // If the CSRC list contain non-unique entries we will end up here.
- // Using CSRC 0 to signal this event, not interop safe, other
- // implementations might have CSRC 0 as a valid value.
- if (num_csrcs_diff > 0) {
- cb_rtp_feedback_->OnIncomingCSRCChanged(0, true);
- } else if (num_csrcs_diff < 0) {
- cb_rtp_feedback_->OnIncomingCSRCChanged(0, false);
- }
- }
}
void RtpReceiverImpl::UpdateSources(
diff --git a/modules/rtp_rtcp/source/rtp_receiver_strategy.h b/modules/rtp_rtcp/source/rtp_receiver_strategy.h
index d5c51a2..52cb593 100644
--- a/modules/rtp_rtcp/source/rtp_receiver_strategy.h
+++ b/modules/rtp_rtcp/source/rtp_receiver_strategy.h
@@ -49,10 +49,6 @@
virtual RTPAliveType ProcessDeadOrAlive(
uint16_t last_payload_length) const = 0;
- // Returns true if we should report CSRC changes for this payload type.
- // TODO(phoglund): should move out of here along with other payload stuff.
- virtual bool ShouldReportCsrcChanges(uint8_t payload_type) const = 0;
-
// Notifies the strategy that we have created a new non-RED audio payload type
// in the payload registry.
virtual int32_t OnNewPayloadTypeCreated(
diff --git a/modules/rtp_rtcp/source/rtp_receiver_video.cc b/modules/rtp_rtcp/source/rtp_receiver_video.cc
index 6efe6b5..454d3ef 100644
--- a/modules/rtp_rtcp/source/rtp_receiver_video.cc
+++ b/modules/rtp_rtcp/source/rtp_receiver_video.cc
@@ -38,11 +38,6 @@
RTPReceiverVideo::~RTPReceiverVideo() {
}
-bool RTPReceiverVideo::ShouldReportCsrcChanges(uint8_t payload_type) const {
- // Always do this for video packets.
- return true;
-}
-
int32_t RTPReceiverVideo::OnNewPayloadTypeCreated(
int payload_type,
const SdpAudioFormat& audio_format) {
diff --git a/modules/rtp_rtcp/source/rtp_receiver_video.h b/modules/rtp_rtcp/source/rtp_receiver_video.h
index 3e95456..d9404d1 100644
--- a/modules/rtp_rtcp/source/rtp_receiver_video.h
+++ b/modules/rtp_rtcp/source/rtp_receiver_video.h
@@ -35,8 +35,6 @@
RTPAliveType ProcessDeadOrAlive(uint16_t last_payload_length) const override;
- bool ShouldReportCsrcChanges(uint8_t payload_type) const override;
-
int32_t OnNewPayloadTypeCreated(int payload_type,
const SdpAudioFormat& audio_format) override;
diff --git a/video/rtp_video_stream_receiver.h b/video/rtp_video_stream_receiver.h
index 83d52d6..b101e03 100644
--- a/video/rtp_video_stream_receiver.h
+++ b/video/rtp_video_stream_receiver.h
@@ -109,7 +109,6 @@
// Implements RtpFeedback.
void OnIncomingSSRCChanged(uint32_t ssrc) override {}
- void OnIncomingCSRCChanged(uint32_t CSRC, bool added) override {}
// Implements VCMFrameTypeCallback.
int32_t RequestKeyFrame() override;