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

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: 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
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 // Receiver Estimated Max Bitrate (REMB) (draft-alvestrand-rmcat-remb). 309 // Receiver Estimated Max Bitrate (REMB) (draft-alvestrand-rmcat-remb).
357 // 310 //
358 // 0 1 2 3 311 // 0 1 2 3
359 // 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 312 // 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
360 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 313 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
361 // |V=2|P| FMT=15 | PT=206 | length | 314 // |V=2|P| FMT=15 | PT=206 | length |
362 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 315 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
363 // | SSRC of packet sender | 316 // | SSRC of packet sender |
364 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 317 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
365 // | SSRC of media source | 318 // | SSRC of media source |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 448
496 private: 449 private:
497 const size_t buffer_length_; 450 const size_t buffer_length_;
498 size_t length_; 451 size_t length_;
499 rtc::scoped_ptr<uint8_t[]> buffer_; 452 rtc::scoped_ptr<uint8_t[]> buffer_;
500 }; 453 };
501 454
502 } // namespace rtcp 455 } // namespace rtcp
503 } // namespace webrtc 456 } // namespace webrtc
504 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_ 457 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698