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

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

Issue 1578713002: [rtp_rtcp] rtcp::Tmmbn 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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 const size_t kFciLen = 8; 472 const size_t kFciLen = 8;
473 return kCommonFbFmtLength + kFciLen; 473 return kCommonFbFmtLength + kFciLen;
474 } 474 }
475 475
476 RTCPUtility::RTCPPacketRTPFBTMMBR tmmbr_; 476 RTCPUtility::RTCPPacketRTPFBTMMBR tmmbr_;
477 RTCPUtility::RTCPPacketRTPFBTMMBRItem tmmbr_item_; 477 RTCPUtility::RTCPPacketRTPFBTMMBRItem tmmbr_item_;
478 478
479 RTC_DISALLOW_COPY_AND_ASSIGN(Tmmbr); 479 RTC_DISALLOW_COPY_AND_ASSIGN(Tmmbr);
480 }; 480 };
481 481
482 // Temporary Maximum Media Stream Bit Rate Notification (TMMBN) (RFC 5104).
483 //
484 // FCI:
485 //
486 // 0 1 2 3
487 // 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
488 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
489 // | SSRC |
490 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
491 // | MxTBR Exp | MxTBR Mantissa |Measured Overhead|
492 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
493
494 class Tmmbn : public RtcpPacket {
495 public:
496 Tmmbn() : RtcpPacket() {
497 memset(&tmmbn_, 0, sizeof(tmmbn_));
498 }
499
500 virtual ~Tmmbn() {}
501
502 void From(uint32_t ssrc) {
503 tmmbn_.SenderSSRC = ssrc;
504 }
505 // Max 50 TMMBR can be added per TMMBN.
506 bool WithTmmbr(uint32_t ssrc, uint32_t bitrate_kbps, uint16_t overhead);
507
508 protected:
509 bool Create(uint8_t* packet,
510 size_t* index,
511 size_t max_length,
512 RtcpPacket::PacketReadyCallback* callback) const override;
513
514 private:
515 static const int kMaxNumberOfTmmbrs = 50;
516
517 size_t BlockLength() const {
518 const size_t kFciLen = 8;
519 return kCommonFbFmtLength + kFciLen * tmmbn_items_.size();
520 }
521
522 RTCPUtility::RTCPPacketRTPFBTMMBN tmmbn_;
523 std::vector<RTCPUtility::RTCPPacketRTPFBTMMBRItem> tmmbn_items_;
524
525 RTC_DISALLOW_COPY_AND_ASSIGN(Tmmbn);
526 };
527
528 // Receiver Estimated Max Bitrate (REMB) (draft-alvestrand-rmcat-remb). 482 // Receiver Estimated Max Bitrate (REMB) (draft-alvestrand-rmcat-remb).
529 // 483 //
530 // 0 1 2 3 484 // 0 1 2 3
531 // 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 485 // 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
532 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 486 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
533 // |V=2|P| FMT=15 | PT=206 | length | 487 // |V=2|P| FMT=15 | PT=206 | length |
534 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 488 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
535 // | SSRC of packet sender | 489 // | SSRC of packet sender |
536 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 490 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
537 // | SSRC of media source | 491 // | SSRC of media source |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 621
668 private: 622 private:
669 const size_t buffer_length_; 623 const size_t buffer_length_;
670 size_t length_; 624 size_t length_;
671 rtc::scoped_ptr<uint8_t[]> buffer_; 625 rtc::scoped_ptr<uint8_t[]> buffer_;
672 }; 626 };
673 627
674 } // namespace rtcp 628 } // namespace rtcp
675 } // namespace webrtc 629 } // namespace webrtc
676 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_ 630 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698