From a98e796615ddb42b07ae5513d5ed4be30ec5c556 Mon Sep 17 00:00:00 2001 From: "mflodman@webrtc.org" Date: Wed, 11 Feb 2015 15:45:56 +0000 Subject: [PATCH] Remove default RTP module functionality for setting CSRC. ViECapturer is always calling DeliverFrame with an empty CSRC vector, so this is basically a dead path already. I added a DCHECK in ViEEncoder to verify this is true. BUG=769 TEST=Manually verified in Chromium. R=pbos@webrtc.org Review URL: https://webrtc-codereview.appspot.com/39059004 Cr-Commit-Position: refs/heads/master@{#8335} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8335 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc | 16 +--------------- webrtc/video_engine/vie_encoder.cc | 14 +------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc index 8bde0a80f..3dcbac5cf 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc @@ -381,21 +381,7 @@ void ModuleRtpRtcpImpl::SetSSRC(const uint32_t ssrc) { } void ModuleRtpRtcpImpl::SetCsrcs(const std::vector& csrcs) { - if (IsDefaultModule()) { - // For default we need to update all child modules too. - CriticalSectionScoped lock(critical_section_module_ptrs_.get()); - - std::vector::iterator it = child_modules_.begin(); - while (it != child_modules_.end()) { - RtpRtcp* module = *it; - if (module) { - module->SetCsrcs(csrcs); - } - it++; - } - return; - } - + assert(!IsDefaultModule()); rtcp_sender_.SetCsrcs(csrcs); rtp_sender_.SetCsrcs(csrcs); } diff --git a/webrtc/video_engine/vie_encoder.cc b/webrtc/video_engine/vie_encoder.cc index 19aff0a6e..3afe758f9 100644 --- a/webrtc/video_engine/vie_encoder.cc +++ b/webrtc/video_engine/vie_encoder.cc @@ -518,6 +518,7 @@ void ViEEncoder::DeliverFrame(int id, I420VideoFrame* video_frame, const std::vector& csrcs) { DCHECK(send_payload_router_ != NULL); + DCHECK(csrcs.empty()); if (!default_rtp_rtcp_->SendingMedia() || !send_payload_router_->active()) { // We've paused or we have no channels attached, don't waste resources on // encoding. @@ -543,19 +544,6 @@ void ViEEncoder::DeliverFrame(int id, "Encode"); video_frame->set_timestamp(time_stamp); - // Make sure the CSRC list is correct. - if (csrcs.size() > 0) { - std::vector temp_csrcs(csrcs.size()); - for (size_t i = 0; i < csrcs.size(); i++) { - if (csrcs[i] == 1) { - temp_csrcs[i] = default_rtp_rtcp_->SSRC(); - } else { - temp_csrcs[i] = csrcs[i]; - } - } - default_rtp_rtcp_->SetCsrcs(temp_csrcs); - } - I420VideoFrame* decimated_frame = NULL; // TODO(wuchengli): support texture frames. if (video_frame->native_handle() == NULL) {