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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4582 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
stefan@webrtc.org
2013-08-21 16:22:21 +00:00
parent fbf0f69bf8
commit 1a65d6c36b
22 changed files with 994 additions and 757 deletions

View File

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