Revert "Remove simulcast modules from ViEReceiver."
This reverts commit 14a97f0a9148be18a66a435a5933441eb023bc82. Introduces a deadlock due to acquiring simulcast_rtp_rtcp_ in ReceivedRTCPPacket. BUG=4568, chromium:478911 R=stefan@webrtc.org Review URL: https://webrtc-codereview.appspot.com/44289004 Cr-Commit-Position: refs/heads/master@{#9039}
This commit is contained in:
@ -509,6 +509,9 @@ 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();
|
||||
@ -520,6 +523,8 @@ 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
|
||||
@ -1597,16 +1602,7 @@ int32_t ViEChannel::ReceivedRTCPPacket(
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
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;
|
||||
return vie_receiver_.ReceivedRTCPPacket(rtcp_packet, rtcp_packet_length);
|
||||
}
|
||||
|
||||
int32_t ViEChannel::SetMTU(uint16_t mtu) {
|
||||
|
@ -151,6 +151,18 @@ 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(
|
||||
@ -407,6 +419,12 @@ 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);
|
||||
|
@ -60,6 +60,8 @@ 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);
|
||||
@ -111,6 +113,7 @@ 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_;
|
||||
|
||||
|
Reference in New Issue
Block a user