| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 |
| 11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_TMMB_ITEM_H_ | 11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_TMMB_ITEM_H_ |
| 12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_TMMB_ITEM_H_ | 12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_TMMB_ITEM_H_ |
| 13 | 13 |
| 14 #include "webrtc/base/basictypes.h" | 14 #include "webrtc/base/basictypes.h" |
| 15 | 15 |
| 16 namespace webrtc { | 16 namespace webrtc { |
| 17 namespace rtcp { | 17 namespace rtcp { |
| 18 // RFC5104, Section 3.5.4 | 18 // RFC5104, Section 3.5.4 |
| 19 // Temporary Maximum Media Stream Bitrate Request/Notification. | 19 // Temporary Maximum Media Stream Bitrate Request/Notification. |
| 20 // Used both by TMMBR and TMMBN rtcp packets. | 20 // Used both by TMMBR and TMMBN rtcp packets. |
| 21 class TmmbItem { | 21 class TmmbItem { |
| 22 public: | 22 public: |
| 23 static const size_t kLength = 8; | 23 static const size_t kLength = 8; |
| 24 | 24 |
| 25 TmmbItem() : ssrc_(0), bitrate_bps_(0), packet_overhead_(0) {} | 25 TmmbItem() : ssrc_(0), bitrate_bps_(0), packet_overhead_(0) {} |
| 26 TmmbItem(uint32_t ssrc, uint32_t bitrate_bps, uint16_t overhead); | 26 TmmbItem(uint32_t ssrc, uint64_t bitrate_bps, uint16_t overhead); |
| 27 | 27 |
| 28 void Parse(const uint8_t* buffer); | 28 bool Parse(const uint8_t* buffer); |
| 29 void Create(uint8_t* buffer) const; | 29 void Create(uint8_t* buffer) const; |
| 30 | 30 |
| 31 void set_ssrc(uint32_t ssrc) { ssrc_ = ssrc; } | 31 void set_ssrc(uint32_t ssrc) { ssrc_ = ssrc; } |
| 32 void set_bitrate_bps(uint32_t bitrate_bps) { bitrate_bps_ = bitrate_bps; } | 32 void set_bitrate_bps(uint64_t bitrate_bps) { bitrate_bps_ = bitrate_bps; } |
| 33 void set_packet_overhead(uint16_t overhead); | 33 void set_packet_overhead(uint16_t overhead); |
| 34 | 34 |
| 35 uint32_t ssrc() const { return ssrc_; } | 35 uint32_t ssrc() const { return ssrc_; } |
| 36 uint32_t bitrate_bps() const { return bitrate_bps_; } | 36 uint64_t bitrate_bps() const { return bitrate_bps_; } |
| 37 uint16_t packet_overhead() const { return packet_overhead_; } | 37 uint16_t packet_overhead() const { return packet_overhead_; } |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 // Media stream id. | 40 // Media stream id. |
| 41 uint32_t ssrc_; | 41 uint32_t ssrc_; |
| 42 // Maximum total media bit rate that the media receiver is | 42 // Maximum total media bit rate that the media receiver is |
| 43 // currently prepared to accept for this media stream. | 43 // currently prepared to accept for this media stream. |
| 44 uint32_t bitrate_bps_; | 44 uint64_t bitrate_bps_; |
| 45 // Per-packet overhead that the media receiver has observed | 45 // Per-packet overhead that the media receiver has observed |
| 46 // for this media stream at its chosen reference protocol layer. | 46 // for this media stream at its chosen reference protocol layer. |
| 47 uint16_t packet_overhead_; | 47 uint16_t packet_overhead_; |
| 48 }; | 48 }; |
| 49 } // namespace rtcp | 49 } // namespace rtcp |
| 50 } // namespace webrtc | 50 } // namespace webrtc |
| 51 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_TMMB_ITEM_H_ | 51 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_TMMB_ITEM_H_ |
| OLD | NEW |