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}
This commit is contained in:
@ -362,10 +362,6 @@ void Channel::OnIncomingSSRCChanged(uint32_t ssrc) {
|
||||
_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) {
|
||||
|
||||
@ -250,7 +250,6 @@ class Channel
|
||||
|
||||
// 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,
|
||||
|
||||
@ -257,8 +257,6 @@ class RtpFeedback {
|
||||
virtual ~RtpFeedback() {}
|
||||
|
||||
virtual void OnIncomingSSRCChanged(uint32_t ssrc) = 0;
|
||||
|
||||
virtual void OnIncomingCSRCChanged(uint32_t csrc, bool added) = 0;
|
||||
};
|
||||
|
||||
class RtcpIntraFrameObserver {
|
||||
@ -443,7 +441,6 @@ class NullRtpFeedback : public RtpFeedback {
|
||||
~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
|
||||
|
||||
@ -71,11 +71,6 @@ bool RTPReceiverAudio::CNGPayloadType(int8_t payload_type) {
|
||||
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.
|
||||
|
||||
@ -52,8 +52,6 @@ class RTPReceiverAudio : public RTPReceiverStrategy,
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@ -102,11 +102,7 @@ RtpReceiverImpl::RtpReceiverImpl(Clock* clock,
|
||||
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 @@ int32_t RtpReceiverImpl::CheckPayloadChanged(const RTPHeader& rtp_header,
|
||||
|
||||
// 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(
|
||||
|
||||
@ -49,10 +49,6 @@ class RTPReceiverStrategy {
|
||||
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(
|
||||
|
||||
@ -38,11 +38,6 @@ RTPReceiverVideo::RTPReceiverVideo(RtpData* data_callback)
|
||||
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) {
|
||||
|
||||
@ -35,8 +35,6 @@ class RTPReceiverVideo : public RTPReceiverStrategy {
|
||||
|
||||
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;
|
||||
|
||||
|
||||
@ -109,7 +109,6 @@ class RtpVideoStreamReceiver : public RtpData,
|
||||
|
||||
// Implements RtpFeedback.
|
||||
void OnIncomingSSRCChanged(uint32_t ssrc) override {}
|
||||
void OnIncomingCSRCChanged(uint32_t CSRC, bool added) override {}
|
||||
|
||||
// Implements VCMFrameTypeCallback.
|
||||
int32_t RequestKeyFrame() override;
|
||||
|
||||
Reference in New Issue
Block a user