Remove simulcast modules from ViEReceiver.

Instead of maintaining two lists of simulcast modules, deliver RTCP
packets to simulcast modules inside ViEChannel.

BUG=1695
R=stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/48119004

Cr-Commit-Position: refs/heads/master@{#9027}
This commit is contained in:
Peter Boström 2015-04-17 15:14:01 +02:00
parent 1d19893f3a
commit 14a97f0a91
3 changed files with 10 additions and 27 deletions

View File

@ -509,9 +509,6 @@ int32_t ViEChannel::SetSendCodec(const VideoCodec& video_codec,
rtp_rtcp->RegisterSendChannelRtpStatisticsCallback(
rtp_rtcp_->GetSendChannelRtpStatisticsCallback());
}
// |RegisterSimulcastRtpRtcpModules| resets all old weak pointers and old
// modules can be deleted after this step.
vie_receiver_.RegisterSimulcastRtpRtcpModules(simulcast_rtp_rtcp_);
} else {
while (!simulcast_rtp_rtcp_.empty()) {
RtpRtcp* rtp_rtcp = simulcast_rtp_rtcp_.back();
@ -523,8 +520,6 @@ int32_t ViEChannel::SetSendCodec(const VideoCodec& video_codec,
simulcast_rtp_rtcp_.pop_back();
removed_rtp_rtcp_.push_front(rtp_rtcp);
}
// Clear any previous modules.
vie_receiver_.RegisterSimulcastRtpRtcpModules(simulcast_rtp_rtcp_);
}
// Don't log this error, no way to check in advance if this pl_type is
@ -1602,7 +1597,16 @@ int32_t ViEChannel::ReceivedRTCPPacket(
return -1;
}
}
return vie_receiver_.ReceivedRTCPPacket(rtcp_packet, rtcp_packet_length);
int ret = vie_receiver_.ReceivedRTCPPacket(rtcp_packet, rtcp_packet_length);
if (ret != 0)
return ret;
CriticalSectionScoped cs(rtp_rtcp_cs_.get());
for (RtpRtcp* rtp_rtcp : simulcast_rtp_rtcp_) {
rtp_rtcp->IncomingRtcpPacket(static_cast<const uint8_t*>(rtcp_packet),
rtcp_packet_length);
}
return 0;
}
int32_t ViEChannel::SetMTU(uint16_t mtu) {

View File

@ -151,18 +151,6 @@ RtpReceiver* ViEReceiver::GetRtpReceiver() const {
return rtp_receiver_.get();
}
void ViEReceiver::RegisterSimulcastRtpRtcpModules(
const std::list<RtpRtcp*>& rtp_modules) {
CriticalSectionScoped cs(receive_cs_.get());
rtp_rtcp_simulcast_.clear();
if (!rtp_modules.empty()) {
rtp_rtcp_simulcast_.insert(rtp_rtcp_simulcast_.begin(),
rtp_modules.begin(),
rtp_modules.end());
}
}
bool ViEReceiver::SetReceiveTimestampOffsetStatus(bool enable, int id) {
if (enable) {
return rtp_header_parser_->RegisterRtpHeaderExtension(
@ -419,12 +407,6 @@ int ViEReceiver::InsertRTCPPacket(const uint8_t* rtcp_packet,
if (rtp_dump_) {
rtp_dump_->DumpPacket(rtcp_packet, rtcp_packet_length);
}
std::list<RtpRtcp*>::iterator it = rtp_rtcp_simulcast_.begin();
while (it != rtp_rtcp_simulcast_.end()) {
RtpRtcp* rtp_rtcp = *it++;
rtp_rtcp->IncomingRtcpPacket(rtcp_packet, rtcp_packet_length);
}
}
assert(rtp_rtcp_); // Should be set by owner at construction time.
int ret = rtp_rtcp_->IncomingRtcpPacket(rtcp_packet, rtcp_packet_length);

View File

@ -60,8 +60,6 @@ class ViEReceiver : public RtpData {
RtpReceiver* GetRtpReceiver() const;
void RegisterSimulcastRtpRtcpModules(const std::list<RtpRtcp*>& rtp_modules);
bool SetReceiveTimestampOffsetStatus(bool enable, int id);
bool SetReceiveAbsoluteSendTimeStatus(bool enable, int id);
bool SetReceiveVideoRotationStatus(bool enable, int id);
@ -113,7 +111,6 @@ class ViEReceiver : public RtpData {
rtc::scoped_ptr<ReceiveStatistics> rtp_receive_statistics_;
rtc::scoped_ptr<FecReceiver> fec_receiver_;
RtpRtcp* rtp_rtcp_;
std::list<RtpRtcp*> rtp_rtcp_simulcast_;
VideoCodingModule* vcm_;
RemoteBitrateEstimator* remote_bitrate_estimator_;