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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_packet/tmmbn.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
(Empty)
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
12 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_TMMBN_H_
13 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_TMMBN_H_
14
15 #include <vector>
16 #include "webrtc/base/basictypes.h"
17 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h"
18 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
19
20 namespace webrtc {
21 namespace rtcp {
22
23 // Temporary Maximum Media Stream Bit Rate Notification (TMMBN) (RFC 5104).
24 class Tmmbn : public RtcpPacket {
25 public:
26 Tmmbn() : RtcpPacket() {
27 memset(&tmmbn_, 0, sizeof(tmmbn_));
tommi 2016/01/11 15:45:40 fyi - I think you should be able to do the same th
28 }
29
30 virtual ~Tmmbn() {}
tommi 2016/01/11 15:45:40 override
31
32 void From(uint32_t ssrc) {
33 tmmbn_.SenderSSRC = ssrc;
tommi 2016/01/11 15:45:40 doesn't look like this is thread safe. On which th
34 }
35 // Max 50 TMMBR can be added per TMMBN.
36 bool WithTmmbr(uint32_t ssrc, uint32_t bitrate_kbps, uint16_t overhead);
37
38 protected:
39 bool Create(uint8_t* packet,
40 size_t* index,
41 size_t max_length,
42 RtcpPacket::PacketReadyCallback* callback) const override;
43
44 private:
45 static const int kMaxNumberOfTmmbrs = 50;
46
47 size_t BlockLength() const {
48 const size_t kFciLen = 8;
49 return kCommonFbFmtLength + kFciLen * tmmbn_items_.size();
50 }
51
52 RTCPUtility::RTCPPacketRTPFBTMMBN tmmbn_;
53 std::vector<RTCPUtility::RTCPPacketRTPFBTMMBRItem> tmmbn_items_;
54
55 RTC_DISALLOW_COPY_AND_ASSIGN(Tmmbn);
56 };
57
58 } // namespace rtcp
59 } // namespace webrtc
60 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_TMMBN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698