Revert 4582 "Reverts a second set of reverts caused by a bug in ..."

> Reverts a second set of reverts caused by a bug in a dependency.
> 
> Revert "Revert r4328"
> 
> Revert "Revert r4322 "Support sending multiple report blocks and keeping track
> of statistics on"
> 
> BUG=1811
> R=henrika@webrtc.org, pbos@webrtc.org, tina.legrand@webrtc.org
> 
> Review URL: https://webrtc-codereview.appspot.com/2072004

TBR=stefan@webrtc.org

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4585 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
henrike@webrtc.org
2013-08-21 19:44:13 +00:00
parent cc39484770
commit a0218a84d1
22 changed files with 757 additions and 994 deletions

View File

@@ -41,7 +41,7 @@ RtpRtcp::Configuration::Configuration()
audio(false),
clock(NULL),
default_module(NULL),
receive_statistics(NullObjectReceiveStatistics()),
receive_statistics(NULL),
outgoing_transport(NULL),
rtcp_feedback(NULL),
intra_frame_callback(NULL),
@@ -74,9 +74,10 @@ ModuleRtpRtcpImpl::ModuleRtpRtcpImpl(const Configuration& configuration)
configuration.audio_messages,
configuration.paced_sender),
rtcp_sender_(configuration.id, configuration.audio, configuration.clock,
this, configuration.receive_statistics),
this),
rtcp_receiver_(configuration.id, configuration.clock, this),
clock_(configuration.clock),
receive_statistics_(configuration.receive_statistics),
id_(configuration.id),
audio_(configuration.audio),
collision_detected_(false),
@@ -241,7 +242,13 @@ int32_t ModuleRtpRtcpImpl::Process() {
}
}
if (rtcp_sender_.TimeToSendRTCPReport()) {
rtcp_sender_.SendRTCP(kRtcpReport);
ReceiveStatistics::RtpReceiveStatistics receive_stats;
if (receive_statistics_ &&
receive_statistics_->Statistics(&receive_stats, true)) {
rtcp_sender_.SendRTCP(kRtcpReport, &receive_stats);
} else {
rtcp_sender_.SendRTCP(kRtcpReport, NULL);
}
}
}
@@ -570,7 +577,13 @@ int32_t ModuleRtpRtcpImpl::SendOutgoingData(
if (!have_child_modules) {
// Don't send RTCP from default module.
if (rtcp_sender_.TimeToSendRTCPReport(kVideoFrameKey == frame_type)) {
rtcp_sender_.SendRTCP(kRtcpReport);
ReceiveStatistics::RtpReceiveStatistics receive_stats;
if (receive_statistics_ &&
receive_statistics_->Statistics(&receive_stats, true)) {
rtcp_sender_.SendRTCP(kRtcpReport, &receive_stats);
} else {
rtcp_sender_.SendRTCP(kRtcpReport, NULL);
}
}
return rtp_sender_.SendOutgoingData(frame_type,
payload_type,
@@ -912,7 +925,19 @@ int32_t ModuleRtpRtcpImpl::ResetSendDataCountersRTP() {
int32_t ModuleRtpRtcpImpl::SendRTCP(uint32_t rtcp_packet_type) {
WEBRTC_TRACE(kTraceModuleCall, kTraceRtpRtcp, id_, "SendRTCP(0x%x)",
rtcp_packet_type);
return rtcp_sender_.SendRTCP(kRtcpReport);
ReceiveStatistics::RtpReceiveStatistics receive_stats;
if (rtcp_sender_.Status() == kRtcpCompound ||
(rtcp_packet_type & kRtcpReport) ||
(rtcp_packet_type & kRtcpSr) ||
(rtcp_packet_type & kRtcpRr)) {
if (receive_statistics_ &&
receive_statistics_->Statistics(&receive_stats, true)) {
return rtcp_sender_.SendRTCP(rtcp_packet_type, &receive_stats);
} else {
return rtcp_sender_.SendRTCP(rtcp_packet_type, NULL);
}
}
return rtcp_sender_.SendRTCP(rtcp_packet_type, NULL);
}
int32_t ModuleRtpRtcpImpl::SetRTCPApplicationSpecificData(
@@ -968,14 +993,14 @@ int32_t ModuleRtpRtcpImpl::AddRTCPReportBlock(
const RTCPReportBlock* report_block) {
WEBRTC_TRACE(kTraceModuleCall, kTraceRtpRtcp, id_, "AddRTCPReportBlock()");
return rtcp_sender_.AddExternalReportBlock(ssrc, report_block);
return rtcp_sender_.AddReportBlock(ssrc, report_block);
}
int32_t ModuleRtpRtcpImpl::RemoveRTCPReportBlock(
const uint32_t ssrc) {
WEBRTC_TRACE(kTraceModuleCall, kTraceRtpRtcp, id_, "RemoveRTCPReportBlock()");
return rtcp_sender_.RemoveExternalReportBlock(ssrc);
return rtcp_sender_.RemoveReportBlock(ssrc);
}
// (REMB) Receiver Estimated Max Bitrate.
@@ -1129,7 +1154,15 @@ int32_t ModuleRtpRtcpImpl::SendNACK(const uint16_t* nack_list,
}
nack_last_seq_number_sent_ = nack_list[start_id + nackLength - 1];
return rtcp_sender_.SendRTCP(kRtcpNack, nackLength, &nack_list[start_id]);
ReceiveStatistics::RtpReceiveStatistics receive_stats;
if (rtcp_sender_.Status() == kRtcpCompound && receive_statistics_ &&
receive_statistics_->Statistics(&receive_stats, true)) {
return rtcp_sender_.SendRTCP(kRtcpNack, &receive_stats, nackLength,
&nack_list[start_id]);
} else {
return rtcp_sender_.SendRTCP(kRtcpNack, NULL, nackLength,
&nack_list[start_id]);
}
}
// Store the sent packets, needed to answer to a Negative acknowledgment
@@ -1324,8 +1357,14 @@ int32_t ModuleRtpRtcpImpl::SendRTCPSliceLossIndication(
id_,
"SendRTCPSliceLossIndication (picture_id:%d)",
picture_id);
return rtcp_sender_.SendRTCP(kRtcpSli, 0, 0, false, picture_id);
ReceiveStatistics::RtpReceiveStatistics receive_stats;
if (rtcp_sender_.Status() == kRtcpCompound && receive_statistics_ &&
receive_statistics_->Statistics(&receive_stats, true)) {
return rtcp_sender_.SendRTCP(kRtcpSli, &receive_stats, 0, 0, false,
picture_id);
} else {
return rtcp_sender_.SendRTCP(kRtcpSli, NULL, 0, 0, false, picture_id);
}
}
int32_t ModuleRtpRtcpImpl::SetCameraDelay(const int32_t delay_ms) {
@@ -1523,7 +1562,14 @@ void ModuleRtpRtcpImpl::OnRequestSendReport() {
int32_t ModuleRtpRtcpImpl::SendRTCPReferencePictureSelection(
const uint64_t picture_id) {
return rtcp_sender_.SendRTCP(kRtcpRpsi, 0, 0, false, picture_id);
ReceiveStatistics::RtpReceiveStatistics receive_stats;
if (rtcp_sender_.Status() == kRtcpCompound && receive_statistics_ &&
receive_statistics_->Statistics(&receive_stats, true)) {
return rtcp_sender_.SendRTCP(kRtcpRpsi, &receive_stats, 0, 0, false,
picture_id);
} else {
return rtcp_sender_.SendRTCP(kRtcpRpsi, NULL, 0, 0, false, picture_id);
}
}
uint32_t ModuleRtpRtcpImpl::SendTimeOfSendReport(