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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_packet.h

Issue 1581983003: [rtp_rtcp] rtcp::Fir moved into own file (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/rtp_rtcp.gypi ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 * 9 *
10 */ 10 */
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 size_t fci_length = 2 + (rpsi_.NumberOfValidBits / 8) + padding_bytes_; 299 size_t fci_length = 2 + (rpsi_.NumberOfValidBits / 8) + padding_bytes_;
300 return kCommonFbFmtLength + fci_length; 300 return kCommonFbFmtLength + fci_length;
301 } 301 }
302 302
303 uint8_t padding_bytes_; 303 uint8_t padding_bytes_;
304 RTCPUtility::RTCPPacketPSFBRPSI rpsi_; 304 RTCPUtility::RTCPPacketPSFBRPSI rpsi_;
305 305
306 RTC_DISALLOW_COPY_AND_ASSIGN(Rpsi); 306 RTC_DISALLOW_COPY_AND_ASSIGN(Rpsi);
307 }; 307 };
308 308
309 // Full intra request (FIR) (RFC 5104).
310 //
311 // FCI:
312 //
313 // 0 1 2 3
314 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
315 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
316 // | SSRC |
317 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
318 // | Seq nr. | Reserved |
319 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
320
321 class Fir : public RtcpPacket {
322 public:
323 Fir() : RtcpPacket() {
324 memset(&fir_, 0, sizeof(fir_));
325 memset(&fir_item_, 0, sizeof(fir_item_));
326 }
327
328 virtual ~Fir() {}
329
330 void From(uint32_t ssrc) {
331 fir_.SenderSSRC = ssrc;
332 }
333 void To(uint32_t ssrc) {
334 fir_item_.SSRC = ssrc;
335 }
336 void WithCommandSeqNum(uint8_t seq_num) {
337 fir_item_.CommandSequenceNumber = seq_num;
338 }
339
340 protected:
341 bool Create(uint8_t* packet,
342 size_t* index,
343 size_t max_length,
344 RtcpPacket::PacketReadyCallback* callback) const override;
345
346 private:
347 size_t BlockLength() const {
348 const size_t kFciLength = 8;
349 return kCommonFbFmtLength + kFciLength;
350 }
351
352 RTCPUtility::RTCPPacketPSFBFIR fir_;
353 RTCPUtility::RTCPPacketPSFBFIRItem fir_item_;
354 };
355
356 // From RFC 3611: RTP Control Protocol Extended Reports (RTCP XR). 309 // From RFC 3611: RTP Control Protocol Extended Reports (RTCP XR).
357 // 310 //
358 // Format for XR packets: 311 // Format for XR packets:
359 // 312 //
360 // 0 1 2 3 313 // 0 1 2 3
361 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 314 // 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
362 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 315 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
363 // |V=2|P|reserved | PT=XR=207 | length | 316 // |V=2|P|reserved | PT=XR=207 | length |
364 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 317 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
365 // | SSRC | 318 // | SSRC |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 392
440 private: 393 private:
441 const size_t buffer_length_; 394 const size_t buffer_length_;
442 size_t length_; 395 size_t length_;
443 rtc::scoped_ptr<uint8_t[]> buffer_; 396 rtc::scoped_ptr<uint8_t[]> buffer_;
444 }; 397 };
445 398
446 } // namespace rtcp 399 } // namespace rtcp
447 } // namespace webrtc 400 } // namespace webrtc
448 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_ 401 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/rtp_rtcp.gypi ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698