OLD | NEW |
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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 133 |
134 protected: | 134 protected: |
135 bool Create(uint8_t* packet, | 135 bool Create(uint8_t* packet, |
136 size_t* index, | 136 size_t* index, |
137 size_t max_length, | 137 size_t max_length, |
138 RtcpPacket::PacketReadyCallback* callback) const override; | 138 RtcpPacket::PacketReadyCallback* callback) const override; |
139 | 139 |
140 size_t BlockLength() const override; | 140 size_t BlockLength() const override; |
141 | 141 |
142 private: | 142 private: |
143 DISALLOW_COPY_AND_ASSIGN(Empty); | 143 RTC_DISALLOW_COPY_AND_ASSIGN(Empty); |
144 }; | 144 }; |
145 | 145 |
146 // From RFC 3550, RTP: A Transport Protocol for Real-Time Applications. | 146 // From RFC 3550, RTP: A Transport Protocol for Real-Time Applications. |
147 // | 147 // |
148 // RTCP report block (RFC 3550). | 148 // RTCP report block (RFC 3550). |
149 // | 149 // |
150 // 0 1 2 3 | 150 // 0 1 2 3 |
151 // 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 | 151 // 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 |
152 // +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | 152 // +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ |
153 // | SSRC_1 (SSRC of first source) | | 153 // | SSRC_1 (SSRC of first source) | |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 size_t BlockLength() const { | 261 size_t BlockLength() const { |
262 const size_t kSrHeaderLength = 8; | 262 const size_t kSrHeaderLength = 8; |
263 const size_t kSenderInfoLength = 20; | 263 const size_t kSenderInfoLength = 20; |
264 return kSrHeaderLength + kSenderInfoLength + | 264 return kSrHeaderLength + kSenderInfoLength + |
265 report_blocks_.size() * kReportBlockLength; | 265 report_blocks_.size() * kReportBlockLength; |
266 } | 266 } |
267 | 267 |
268 RTCPUtility::RTCPPacketSR sr_; | 268 RTCPUtility::RTCPPacketSR sr_; |
269 std::vector<RTCPUtility::RTCPPacketReportBlockItem> report_blocks_; | 269 std::vector<RTCPUtility::RTCPPacketReportBlockItem> report_blocks_; |
270 | 270 |
271 DISALLOW_COPY_AND_ASSIGN(SenderReport); | 271 RTC_DISALLOW_COPY_AND_ASSIGN(SenderReport); |
272 }; | 272 }; |
273 | 273 |
274 // | 274 // |
275 // RTCP receiver report (RFC 3550). | 275 // RTCP receiver report (RFC 3550). |
276 // | 276 // |
277 // 0 1 2 3 | 277 // 0 1 2 3 |
278 // 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 | 278 // 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 |
279 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 279 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
280 // |V=2|P| RC | PT=RR=201 | length | | 280 // |V=2|P| RC | PT=RR=201 | length | |
281 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 281 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
(...skipping 25 matching lines...) Expand all Loading... |
307 static const int kMaxNumberOfReportBlocks = 0x1F; | 307 static const int kMaxNumberOfReportBlocks = 0x1F; |
308 | 308 |
309 size_t BlockLength() const { | 309 size_t BlockLength() const { |
310 const size_t kRrHeaderLength = 8; | 310 const size_t kRrHeaderLength = 8; |
311 return kRrHeaderLength + report_blocks_.size() * kReportBlockLength; | 311 return kRrHeaderLength + report_blocks_.size() * kReportBlockLength; |
312 } | 312 } |
313 | 313 |
314 RTCPUtility::RTCPPacketRR rr_; | 314 RTCPUtility::RTCPPacketRR rr_; |
315 std::vector<RTCPUtility::RTCPPacketReportBlockItem> report_blocks_; | 315 std::vector<RTCPUtility::RTCPPacketReportBlockItem> report_blocks_; |
316 | 316 |
317 DISALLOW_COPY_AND_ASSIGN(ReceiverReport); | 317 RTC_DISALLOW_COPY_AND_ASSIGN(ReceiverReport); |
318 }; | 318 }; |
319 | 319 |
320 // Transmission Time Offsets in RTP Streams (RFC 5450). | 320 // Transmission Time Offsets in RTP Streams (RFC 5450). |
321 // | 321 // |
322 // 0 1 2 3 | 322 // 0 1 2 3 |
323 // 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 | 323 // 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 |
324 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 324 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
325 // hdr |V=2|P| RC | PT=IJ=195 | length | | 325 // hdr |V=2|P| RC | PT=IJ=195 | length | |
326 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 326 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
327 // | inter-arrival jitter | | 327 // | inter-arrival jitter | |
(...skipping 24 matching lines...) Expand all Loading... |
352 | 352 |
353 private: | 353 private: |
354 static const int kMaxNumberOfIjItems = 0x1f; | 354 static const int kMaxNumberOfIjItems = 0x1f; |
355 | 355 |
356 size_t BlockLength() const { | 356 size_t BlockLength() const { |
357 return kHeaderLength + 4 * ij_items_.size(); | 357 return kHeaderLength + 4 * ij_items_.size(); |
358 } | 358 } |
359 | 359 |
360 std::vector<uint32_t> ij_items_; | 360 std::vector<uint32_t> ij_items_; |
361 | 361 |
362 DISALLOW_COPY_AND_ASSIGN(Ij); | 362 RTC_DISALLOW_COPY_AND_ASSIGN(Ij); |
363 }; | 363 }; |
364 | 364 |
365 // Source Description (SDES) (RFC 3550). | 365 // Source Description (SDES) (RFC 3550). |
366 // | 366 // |
367 // 0 1 2 3 | 367 // 0 1 2 3 |
368 // 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 | 368 // 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 |
369 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 369 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
370 // header |V=2|P| SC | PT=SDES=202 | length | | 370 // header |V=2|P| SC | PT=SDES=202 | length | |
371 // +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | 371 // +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ |
372 // chunk | SSRC/CSRC_1 | | 372 // chunk | SSRC/CSRC_1 | |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 size_t max_length, | 408 size_t max_length, |
409 RtcpPacket::PacketReadyCallback* callback) const override; | 409 RtcpPacket::PacketReadyCallback* callback) const override; |
410 | 410 |
411 private: | 411 private: |
412 static const int kMaxNumberOfChunks = 0x1f; | 412 static const int kMaxNumberOfChunks = 0x1f; |
413 | 413 |
414 size_t BlockLength() const; | 414 size_t BlockLength() const; |
415 | 415 |
416 std::vector<Chunk> chunks_; | 416 std::vector<Chunk> chunks_; |
417 | 417 |
418 DISALLOW_COPY_AND_ASSIGN(Sdes); | 418 RTC_DISALLOW_COPY_AND_ASSIGN(Sdes); |
419 }; | 419 }; |
420 | 420 |
421 // | 421 // |
422 // Bye packet (BYE) (RFC 3550). | 422 // Bye packet (BYE) (RFC 3550). |
423 // | 423 // |
424 // 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 | 424 // 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 |
425 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 425 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
426 // |V=2|P| SC | PT=BYE=203 | length | | 426 // |V=2|P| SC | PT=BYE=203 | length | |
427 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 427 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
428 // | SSRC/CSRC | | 428 // | SSRC/CSRC | |
(...skipping 29 matching lines...) Expand all Loading... |
458 static const int kMaxNumberOfCsrcs = 0x1f - 1; // First item is sender SSRC. | 458 static const int kMaxNumberOfCsrcs = 0x1f - 1; // First item is sender SSRC. |
459 | 459 |
460 size_t BlockLength() const { | 460 size_t BlockLength() const { |
461 size_t source_count = 1 + csrcs_.size(); | 461 size_t source_count = 1 + csrcs_.size(); |
462 return kHeaderLength + 4 * source_count; | 462 return kHeaderLength + 4 * source_count; |
463 } | 463 } |
464 | 464 |
465 RTCPUtility::RTCPPacketBYE bye_; | 465 RTCPUtility::RTCPPacketBYE bye_; |
466 std::vector<uint32_t> csrcs_; | 466 std::vector<uint32_t> csrcs_; |
467 | 467 |
468 DISALLOW_COPY_AND_ASSIGN(Bye); | 468 RTC_DISALLOW_COPY_AND_ASSIGN(Bye); |
469 }; | 469 }; |
470 | 470 |
471 // Application-Defined packet (APP) (RFC 3550). | 471 // Application-Defined packet (APP) (RFC 3550). |
472 // | 472 // |
473 // 0 1 2 3 | 473 // 0 1 2 3 |
474 // 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 | 474 // 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 |
475 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 475 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
476 // |V=2|P| subtype | PT=APP=204 | length | | 476 // |V=2|P| subtype | PT=APP=204 | length | |
477 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 477 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
478 // | SSRC/CSRC | | 478 // | SSRC/CSRC | |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 RtcpPacket::PacketReadyCallback* callback) const override; | 517 RtcpPacket::PacketReadyCallback* callback) const override; |
518 | 518 |
519 private: | 519 private: |
520 size_t BlockLength() const { | 520 size_t BlockLength() const { |
521 return 12 + app_.Size; | 521 return 12 + app_.Size; |
522 } | 522 } |
523 | 523 |
524 uint32_t ssrc_; | 524 uint32_t ssrc_; |
525 RTCPUtility::RTCPPacketAPP app_; | 525 RTCPUtility::RTCPPacketAPP app_; |
526 | 526 |
527 DISALLOW_COPY_AND_ASSIGN(App); | 527 RTC_DISALLOW_COPY_AND_ASSIGN(App); |
528 }; | 528 }; |
529 | 529 |
530 // RFC 4585: Feedback format. | 530 // RFC 4585: Feedback format. |
531 // | 531 // |
532 // Common packet format: | 532 // Common packet format: |
533 // | 533 // |
534 // 0 1 2 3 | 534 // 0 1 2 3 |
535 // 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 | 535 // 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 |
536 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 536 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
537 // |V=2|P| FMT | PT | length | | 537 // |V=2|P| FMT | PT | length | |
(...skipping 30 matching lines...) Expand all Loading... |
568 size_t max_length, | 568 size_t max_length, |
569 RtcpPacket::PacketReadyCallback* callback) const override; | 569 RtcpPacket::PacketReadyCallback* callback) const override; |
570 | 570 |
571 private: | 571 private: |
572 size_t BlockLength() const { | 572 size_t BlockLength() const { |
573 return kCommonFbFmtLength; | 573 return kCommonFbFmtLength; |
574 } | 574 } |
575 | 575 |
576 RTCPUtility::RTCPPacketPSFBPLI pli_; | 576 RTCPUtility::RTCPPacketPSFBPLI pli_; |
577 | 577 |
578 DISALLOW_COPY_AND_ASSIGN(Pli); | 578 RTC_DISALLOW_COPY_AND_ASSIGN(Pli); |
579 }; | 579 }; |
580 | 580 |
581 // Slice loss indication (SLI) (RFC 4585). | 581 // Slice loss indication (SLI) (RFC 4585). |
582 // | 582 // |
583 // FCI: | 583 // FCI: |
584 // 0 1 2 3 | 584 // 0 1 2 3 |
585 // 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 | 585 // 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 |
586 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 586 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
587 // | First | Number | PictureID | | 587 // | First | Number | PictureID | |
588 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 588 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 | 623 |
624 private: | 624 private: |
625 size_t BlockLength() const { | 625 size_t BlockLength() const { |
626 const size_t kFciLength = 4; | 626 const size_t kFciLength = 4; |
627 return kCommonFbFmtLength + kFciLength; | 627 return kCommonFbFmtLength + kFciLength; |
628 } | 628 } |
629 | 629 |
630 RTCPUtility::RTCPPacketPSFBSLI sli_; | 630 RTCPUtility::RTCPPacketPSFBSLI sli_; |
631 RTCPUtility::RTCPPacketPSFBSLIItem sli_item_; | 631 RTCPUtility::RTCPPacketPSFBSLIItem sli_item_; |
632 | 632 |
633 DISALLOW_COPY_AND_ASSIGN(Sli); | 633 RTC_DISALLOW_COPY_AND_ASSIGN(Sli); |
634 }; | 634 }; |
635 | 635 |
636 // Generic NACK (RFC 4585). | 636 // Generic NACK (RFC 4585). |
637 // | 637 // |
638 // FCI: | 638 // FCI: |
639 // 0 1 2 3 | 639 // 0 1 2 3 |
640 // 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 | 640 // 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 |
641 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 641 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
642 // | PID | BLP | | 642 // | PID | BLP | |
643 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 643 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
(...skipping 20 matching lines...) Expand all Loading... |
664 size_t max_length, | 664 size_t max_length, |
665 RtcpPacket::PacketReadyCallback* callback) const override; | 665 RtcpPacket::PacketReadyCallback* callback) const override; |
666 | 666 |
667 size_t BlockLength() const override; | 667 size_t BlockLength() const override; |
668 | 668 |
669 private: | 669 private: |
670 | 670 |
671 RTCPUtility::RTCPPacketRTPFBNACK nack_; | 671 RTCPUtility::RTCPPacketRTPFBNACK nack_; |
672 std::vector<RTCPUtility::RTCPPacketRTPFBNACKItem> nack_fields_; | 672 std::vector<RTCPUtility::RTCPPacketRTPFBNACKItem> nack_fields_; |
673 | 673 |
674 DISALLOW_COPY_AND_ASSIGN(Nack); | 674 RTC_DISALLOW_COPY_AND_ASSIGN(Nack); |
675 }; | 675 }; |
676 | 676 |
677 // Reference picture selection indication (RPSI) (RFC 4585). | 677 // Reference picture selection indication (RPSI) (RFC 4585). |
678 // | 678 // |
679 // FCI: | 679 // FCI: |
680 // | 680 // |
681 // 0 1 2 3 | 681 // 0 1 2 3 |
682 // 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 | 682 // 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 |
683 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 683 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
684 // | PB |0| Payload Type| Native RPSI bit string | | 684 // | PB |0| Payload Type| Native RPSI bit string | |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 | 716 |
717 private: | 717 private: |
718 size_t BlockLength() const { | 718 size_t BlockLength() const { |
719 size_t fci_length = 2 + (rpsi_.NumberOfValidBits / 8) + padding_bytes_; | 719 size_t fci_length = 2 + (rpsi_.NumberOfValidBits / 8) + padding_bytes_; |
720 return kCommonFbFmtLength + fci_length; | 720 return kCommonFbFmtLength + fci_length; |
721 } | 721 } |
722 | 722 |
723 uint8_t padding_bytes_; | 723 uint8_t padding_bytes_; |
724 RTCPUtility::RTCPPacketPSFBRPSI rpsi_; | 724 RTCPUtility::RTCPPacketPSFBRPSI rpsi_; |
725 | 725 |
726 DISALLOW_COPY_AND_ASSIGN(Rpsi); | 726 RTC_DISALLOW_COPY_AND_ASSIGN(Rpsi); |
727 }; | 727 }; |
728 | 728 |
729 // Full intra request (FIR) (RFC 5104). | 729 // Full intra request (FIR) (RFC 5104). |
730 // | 730 // |
731 // FCI: | 731 // FCI: |
732 // | 732 // |
733 // 0 1 2 3 | 733 // 0 1 2 3 |
734 // 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 | 734 // 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 |
735 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 735 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
736 // | SSRC | | 736 // | SSRC | |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 | 816 |
817 private: | 817 private: |
818 size_t BlockLength() const { | 818 size_t BlockLength() const { |
819 const size_t kFciLen = 8; | 819 const size_t kFciLen = 8; |
820 return kCommonFbFmtLength + kFciLen; | 820 return kCommonFbFmtLength + kFciLen; |
821 } | 821 } |
822 | 822 |
823 RTCPUtility::RTCPPacketRTPFBTMMBR tmmbr_; | 823 RTCPUtility::RTCPPacketRTPFBTMMBR tmmbr_; |
824 RTCPUtility::RTCPPacketRTPFBTMMBRItem tmmbr_item_; | 824 RTCPUtility::RTCPPacketRTPFBTMMBRItem tmmbr_item_; |
825 | 825 |
826 DISALLOW_COPY_AND_ASSIGN(Tmmbr); | 826 RTC_DISALLOW_COPY_AND_ASSIGN(Tmmbr); |
827 }; | 827 }; |
828 | 828 |
829 // Temporary Maximum Media Stream Bit Rate Notification (TMMBN) (RFC 5104). | 829 // Temporary Maximum Media Stream Bit Rate Notification (TMMBN) (RFC 5104). |
830 // | 830 // |
831 // FCI: | 831 // FCI: |
832 // | 832 // |
833 // 0 1 2 3 | 833 // 0 1 2 3 |
834 // 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 | 834 // 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 |
835 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 835 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
836 // | SSRC | | 836 // | SSRC | |
(...skipping 25 matching lines...) Expand all Loading... |
862 static const int kMaxNumberOfTmmbrs = 50; | 862 static const int kMaxNumberOfTmmbrs = 50; |
863 | 863 |
864 size_t BlockLength() const { | 864 size_t BlockLength() const { |
865 const size_t kFciLen = 8; | 865 const size_t kFciLen = 8; |
866 return kCommonFbFmtLength + kFciLen * tmmbn_items_.size(); | 866 return kCommonFbFmtLength + kFciLen * tmmbn_items_.size(); |
867 } | 867 } |
868 | 868 |
869 RTCPUtility::RTCPPacketRTPFBTMMBN tmmbn_; | 869 RTCPUtility::RTCPPacketRTPFBTMMBN tmmbn_; |
870 std::vector<RTCPUtility::RTCPPacketRTPFBTMMBRItem> tmmbn_items_; | 870 std::vector<RTCPUtility::RTCPPacketRTPFBTMMBRItem> tmmbn_items_; |
871 | 871 |
872 DISALLOW_COPY_AND_ASSIGN(Tmmbn); | 872 RTC_DISALLOW_COPY_AND_ASSIGN(Tmmbn); |
873 }; | 873 }; |
874 | 874 |
875 // Receiver Estimated Max Bitrate (REMB) (draft-alvestrand-rmcat-remb). | 875 // Receiver Estimated Max Bitrate (REMB) (draft-alvestrand-rmcat-remb). |
876 // | 876 // |
877 // 0 1 2 3 | 877 // 0 1 2 3 |
878 // 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 | 878 // 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 |
879 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 879 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
880 // |V=2|P| FMT=15 | PT=206 | length | | 880 // |V=2|P| FMT=15 | PT=206 | length | |
881 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 881 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
882 // | SSRC of packet sender | | 882 // | SSRC of packet sender | |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
918 private: | 918 private: |
919 static const int kMaxNumberOfSsrcs = 0xff; | 919 static const int kMaxNumberOfSsrcs = 0xff; |
920 | 920 |
921 size_t BlockLength() const { | 921 size_t BlockLength() const { |
922 return (remb_item_.NumberOfSSRCs + 5) * 4; | 922 return (remb_item_.NumberOfSSRCs + 5) * 4; |
923 } | 923 } |
924 | 924 |
925 RTCPUtility::RTCPPacketPSFBAPP remb_; | 925 RTCPUtility::RTCPPacketPSFBAPP remb_; |
926 RTCPUtility::RTCPPacketPSFBREMBItem remb_item_; | 926 RTCPUtility::RTCPPacketPSFBREMBItem remb_item_; |
927 | 927 |
928 DISALLOW_COPY_AND_ASSIGN(Remb); | 928 RTC_DISALLOW_COPY_AND_ASSIGN(Remb); |
929 }; | 929 }; |
930 | 930 |
931 // From RFC 3611: RTP Control Protocol Extended Reports (RTCP XR). | 931 // From RFC 3611: RTP Control Protocol Extended Reports (RTCP XR). |
932 // | 932 // |
933 // Format for XR packets: | 933 // Format for XR packets: |
934 // | 934 // |
935 // 0 1 2 3 | 935 // 0 1 2 3 |
936 // 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 | 936 // 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 |
937 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 937 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
938 // |V=2|P|reserved | PT=XR=207 | length | | 938 // |V=2|P|reserved | PT=XR=207 | length | |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 size_t VoipMetricLength() const { | 986 size_t VoipMetricLength() const { |
987 const size_t kVoipMetricBlockLength = 36; | 987 const size_t kVoipMetricBlockLength = 36; |
988 return kVoipMetricBlockLength * voip_metric_blocks_.size(); | 988 return kVoipMetricBlockLength * voip_metric_blocks_.size(); |
989 } | 989 } |
990 | 990 |
991 RTCPUtility::RTCPPacketXR xr_header_; | 991 RTCPUtility::RTCPPacketXR xr_header_; |
992 std::vector<RTCPUtility::RTCPPacketXRReceiverReferenceTimeItem> rrtr_blocks_; | 992 std::vector<RTCPUtility::RTCPPacketXRReceiverReferenceTimeItem> rrtr_blocks_; |
993 std::vector<DlrrBlock> dlrr_blocks_; | 993 std::vector<DlrrBlock> dlrr_blocks_; |
994 std::vector<RTCPUtility::RTCPPacketXRVOIPMetricItem> voip_metric_blocks_; | 994 std::vector<RTCPUtility::RTCPPacketXRVOIPMetricItem> voip_metric_blocks_; |
995 | 995 |
996 DISALLOW_COPY_AND_ASSIGN(Xr); | 996 RTC_DISALLOW_COPY_AND_ASSIGN(Xr); |
997 }; | 997 }; |
998 | 998 |
999 // Receiver Reference Time Report Block (RFC 3611). | 999 // Receiver Reference Time Report Block (RFC 3611). |
1000 // | 1000 // |
1001 // 0 1 2 3 | 1001 // 0 1 2 3 |
1002 // 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 | 1002 // 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 |
1003 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1003 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1004 // | BT=4 | reserved | block length = 2 | | 1004 // | BT=4 | reserved | block length = 2 | |
1005 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1005 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1006 // | NTP timestamp, most significant word | | 1006 // | NTP timestamp, most significant word | |
(...skipping 12 matching lines...) Expand all Loading... |
1019 rrtr_block_.NTPMostSignificant = sec; | 1019 rrtr_block_.NTPMostSignificant = sec; |
1020 } | 1020 } |
1021 void WithNtpFrac(uint32_t frac) { | 1021 void WithNtpFrac(uint32_t frac) { |
1022 rrtr_block_.NTPLeastSignificant = frac; | 1022 rrtr_block_.NTPLeastSignificant = frac; |
1023 } | 1023 } |
1024 | 1024 |
1025 private: | 1025 private: |
1026 friend class Xr; | 1026 friend class Xr; |
1027 RTCPUtility::RTCPPacketXRReceiverReferenceTimeItem rrtr_block_; | 1027 RTCPUtility::RTCPPacketXRReceiverReferenceTimeItem rrtr_block_; |
1028 | 1028 |
1029 DISALLOW_COPY_AND_ASSIGN(Rrtr); | 1029 RTC_DISALLOW_COPY_AND_ASSIGN(Rrtr); |
1030 }; | 1030 }; |
1031 | 1031 |
1032 // DLRR Report Block (RFC 3611). | 1032 // DLRR Report Block (RFC 3611). |
1033 // | 1033 // |
1034 // 0 1 2 3 | 1034 // 0 1 2 3 |
1035 // 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 | 1035 // 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 |
1036 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1036 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1037 // | BT=5 | reserved | block length | | 1037 // | BT=5 | reserved | block length | |
1038 // +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ | 1038 // +=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ |
1039 // | SSRC_1 (SSRC of first receiver) | sub- | 1039 // | SSRC_1 (SSRC of first receiver) | sub- |
(...skipping 13 matching lines...) Expand all Loading... |
1053 | 1053 |
1054 // Max 100 DLRR Items can be added per DLRR report block. | 1054 // Max 100 DLRR Items can be added per DLRR report block. |
1055 bool WithDlrrItem(uint32_t ssrc, uint32_t last_rr, uint32_t delay_last_rr); | 1055 bool WithDlrrItem(uint32_t ssrc, uint32_t last_rr, uint32_t delay_last_rr); |
1056 | 1056 |
1057 private: | 1057 private: |
1058 friend class Xr; | 1058 friend class Xr; |
1059 static const int kMaxNumberOfDlrrItems = 100; | 1059 static const int kMaxNumberOfDlrrItems = 100; |
1060 | 1060 |
1061 std::vector<RTCPUtility::RTCPPacketXRDLRRReportBlockItem> dlrr_block_; | 1061 std::vector<RTCPUtility::RTCPPacketXRDLRRReportBlockItem> dlrr_block_; |
1062 | 1062 |
1063 DISALLOW_COPY_AND_ASSIGN(Dlrr); | 1063 RTC_DISALLOW_COPY_AND_ASSIGN(Dlrr); |
1064 }; | 1064 }; |
1065 | 1065 |
1066 // VoIP Metrics Report Block (RFC 3611). | 1066 // VoIP Metrics Report Block (RFC 3611). |
1067 // | 1067 // |
1068 // 0 1 2 3 | 1068 // 0 1 2 3 |
1069 // 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 | 1069 // 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 |
1070 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1070 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1071 // | BT=7 | reserved | block length = 8 | | 1071 // | BT=7 | reserved | block length = 8 | |
1072 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 1072 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
1073 // | SSRC of source | | 1073 // | SSRC of source | |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1123 void MosCq(uint8_t moscq) { metric_.MOSCQ = moscq; } | 1123 void MosCq(uint8_t moscq) { metric_.MOSCQ = moscq; } |
1124 void RxConfig(uint8_t rxconfig) { metric_.RXconfig = rxconfig; } | 1124 void RxConfig(uint8_t rxconfig) { metric_.RXconfig = rxconfig; } |
1125 void JbNominal(uint16_t jbnominal) { metric_.JBnominal = jbnominal; } | 1125 void JbNominal(uint16_t jbnominal) { metric_.JBnominal = jbnominal; } |
1126 void JbMax(uint16_t jbmax) { metric_.JBmax = jbmax; } | 1126 void JbMax(uint16_t jbmax) { metric_.JBmax = jbmax; } |
1127 void JbAbsMax(uint16_t jbabsmax) { metric_.JBabsMax = jbabsmax; } | 1127 void JbAbsMax(uint16_t jbabsmax) { metric_.JBabsMax = jbabsmax; } |
1128 | 1128 |
1129 private: | 1129 private: |
1130 friend class Xr; | 1130 friend class Xr; |
1131 RTCPUtility::RTCPPacketXRVOIPMetricItem metric_; | 1131 RTCPUtility::RTCPPacketXRVOIPMetricItem metric_; |
1132 | 1132 |
1133 DISALLOW_COPY_AND_ASSIGN(VoipMetric); | 1133 RTC_DISALLOW_COPY_AND_ASSIGN(VoipMetric); |
1134 }; | 1134 }; |
1135 | 1135 |
1136 // Class holding a RTCP packet. | 1136 // Class holding a RTCP packet. |
1137 // | 1137 // |
1138 // Takes a built rtcp packet. | 1138 // Takes a built rtcp packet. |
1139 // RawPacket raw_packet(buffer, length); | 1139 // RawPacket raw_packet(buffer, length); |
1140 // | 1140 // |
1141 // To access the raw packet: | 1141 // To access the raw packet: |
1142 // raw_packet.Buffer(); - pointer to the raw packet | 1142 // raw_packet.Buffer(); - pointer to the raw packet |
1143 // raw_packet.BufferLength(); - the length of the raw packet | 1143 // raw_packet.BufferLength(); - the length of the raw packet |
(...skipping 11 matching lines...) Expand all Loading... |
1155 | 1155 |
1156 private: | 1156 private: |
1157 const size_t buffer_length_; | 1157 const size_t buffer_length_; |
1158 size_t length_; | 1158 size_t length_; |
1159 rtc::scoped_ptr<uint8_t[]> buffer_; | 1159 rtc::scoped_ptr<uint8_t[]> buffer_; |
1160 }; | 1160 }; |
1161 | 1161 |
1162 } // namespace rtcp | 1162 } // namespace rtcp |
1163 } // namespace webrtc | 1163 } // namespace webrtc |
1164 #endif // WEBRTC_MODULES_RTP_RTCP_RTCP_PACKET_H_ | 1164 #endif // WEBRTC_MODULES_RTP_RTCP_RTCP_PACKET_H_ |
OLD | NEW |