Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtcp_sender.cc

Issue 1261323003: Use RtcpPacket to send FIR in RtcpSender (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
index 6967754fe62f737e73f450314da31bf1ebd9dcdd..e08c20bfd5a6894596fb73168a8f1f319a8ca867 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_sender.cc
@@ -564,36 +564,20 @@ RTCPSender::BuildResult RTCPSender::BuildPLI(RtcpContext* ctx) {
}
RTCPSender::BuildResult RTCPSender::BuildFIR(RtcpContext* ctx) {
- // sanity
- if (ctx->position + 20 >= IP_PACKET_SIZE)
- return BuildResult::kTruncated;
-
+ uint8_t seq = sequence_number_fir_;
if (!ctx->repeat)
- sequence_number_fir_++; // do not increase if repetition
+ ++seq; // Do not increase if repetition.
- // add full intra request indicator
- uint8_t FMT = 4;
- *ctx->AllocateData(1) = 0x80 + FMT;
- *ctx->AllocateData(1) = 206;
-
- //Length of 4
- *ctx->AllocateData(1) = 0;
- *ctx->AllocateData(1) = 4;
-
- // Add our own SSRC
- ByteWriter<uint32_t>::WriteBigEndian(ctx->AllocateData(4), ssrc_);
+ rtcp::Fir fir;
+ fir.From(ssrc_);
+ fir.To(remote_ssrc_);
+ fir.WithCommandSeqNum(seq);
- // RFC 5104 4.3.1.2. Semantics
- // SSRC of media source
- ByteWriter<uint32_t>::WriteBigEndian(ctx->AllocateData(4), 0);
-
- // Additional Feedback Control Information (FCI)
- ByteWriter<uint32_t>::WriteBigEndian(ctx->AllocateData(4), remote_ssrc_);
+ PacketBuiltCallback callback(ctx);
+ if (!callback.BuildPacket(fir))
+ return BuildResult::kTruncated;
- *ctx->AllocateData(1) = sequence_number_fir_;
- *ctx->AllocateData(1) = 0;
- *ctx->AllocateData(1) = 0;
- *ctx->AllocateData(1) = 0;
+ sequence_number_fir_ = seq; // Only update if we actually sent packet.
åsapersson 2015/08/04 12:07:27 Will the caller know if the FIR request is not sen
sprang_webrtc 2015/08/04 12:59:38 I updated the comment to the more clear "Update st
TRACE_EVENT_INSTANT0(TRACE_DISABLED_BY_DEFAULT("webrtc_rtp"),
"RTCPSender::FIR");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698