tmmbn.h (1646B)
1 /* 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 3 * 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 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #ifndef MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_TMMBN_H_ 12 #define MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_TMMBN_H_ 13 14 #include <cstddef> 15 #include <cstdint> 16 #include <vector> 17 18 #include "modules/rtp_rtcp/source/rtcp_packet/rtpfb.h" 19 #include "modules/rtp_rtcp/source/rtcp_packet/tmmb_item.h" 20 21 namespace webrtc { 22 namespace rtcp { 23 class CommonHeader; 24 25 // Temporary Maximum Media Stream Bit Rate Notification (TMMBN). 26 // RFC 5104, Section 4.2.2. 27 class Tmmbn : public Rtpfb { 28 public: 29 static constexpr uint8_t kFeedbackMessageType = 4; 30 31 Tmmbn(); 32 ~Tmmbn() override; 33 34 // Parse assumes header is already parsed and validated. 35 bool Parse(const CommonHeader& packet); 36 37 void AddTmmbr(const TmmbItem& item); 38 39 const std::vector<TmmbItem>& items() const { return items_; } 40 41 size_t BlockLength() const override; 42 43 bool Create(uint8_t* packet, 44 size_t* index, 45 size_t max_length, 46 PacketReadyCallback callback) const override; 47 48 private: 49 // Media ssrc is unused, shadow base class setter and getter. 50 void SetMediaSsrc(uint32_t ssrc); 51 uint32_t media_ssrc() const; 52 53 std::vector<TmmbItem> items_; 54 }; 55 } // namespace rtcp 56 } // namespace webrtc 57 #endif // MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_TMMBN_H_