rtcp::ReportBlock refactored to contain parsing

Review URL: https://codereview.webrtc.org/1420283022

Cr-Commit-Position: refs/heads/master@{#10633}
This commit is contained in:
danilchap
2015-11-13 03:03:13 -08:00
committed by Commit bot
parent 0a41893e36
commit df948f03b3
9 changed files with 262 additions and 72 deletions

View File

@ -459,7 +459,10 @@ int32_t RTCPSender::AddReportBlock(const RTCPReportBlock& report_block) {
rtcp::ReportBlock* block = &report_blocks_[report_block.remoteSSRC];
block->To(report_block.remoteSSRC);
block->WithFractionLost(report_block.fractionLost);
block->WithCumulativeLost(report_block.cumulativeLost);
if (!block->WithCumulativeLost(report_block.cumulativeLost)) {
LOG(LS_WARNING) << "Cumulative lost is oversized.";
return -1;
}
block->WithExtHighestSeqNum(report_block.extendedHighSeqNum);
block->WithJitter(report_block.jitter);
block->WithLastSr(report_block.lastSR);
@ -1024,6 +1027,8 @@ int RTCPSender::PrepareRTCP(const FeedbackState& feedback_state,
RTCPReportBlock report_block;
if (PrepareReport(feedback_state, it->first, it->second,
&report_block)) {
// TODO(danilchap) AddReportBlock may fail (for 2 different reasons).
// Probably it shouldn't be ignored.
AddReportBlock(report_block);
}
}