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

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

Issue 1581983003: [rtp_rtcp] rtcp::Fir moved into own file (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase 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) 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
11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_REMB_H_ 12 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_FIR_H_
12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_REMB_H_ 13 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_FIR_H_
13 14
14 #include <vector>
15 #include "webrtc/base/basictypes.h" 15 #include "webrtc/base/basictypes.h"
16 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h" 16 #include "webrtc/modules/rtp_rtcp/source/rtcp_packet.h"
17 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h" 17 #include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
18 18
19 namespace webrtc { 19 namespace webrtc {
20 namespace rtcp { 20 namespace rtcp {
21 // Receiver Estimated Max Bitrate (REMB) (draft-alvestrand-rmcat-remb). 21
22 class Remb : public RtcpPacket { 22 // Full intra request (FIR) (RFC 5104).
23 class Fir : public RtcpPacket {
23 public: 24 public:
24 Remb() : RtcpPacket() { 25 Fir() : RtcpPacket() {
25 memset(&remb_, 0, sizeof(remb_)); 26 memset(&fir_, 0, sizeof(fir_));
26 memset(&remb_item_, 0, sizeof(remb_item_)); 27 memset(&fir_item_, 0, sizeof(fir_item_));
27 } 28 }
28 29
29 virtual ~Remb() {} 30 virtual ~Fir() {}
30 31
31 void From(uint32_t ssrc) { 32 void From(uint32_t ssrc) {
32 remb_.SenderSSRC = ssrc; 33 fir_.SenderSSRC = ssrc;
33 } 34 }
34 void AppliesTo(uint32_t ssrc); 35 void To(uint32_t ssrc) {
35 36 fir_item_.SSRC = ssrc;
36 void WithBitrateBps(uint32_t bitrate_bps) { 37 }
37 remb_item_.BitRate = bitrate_bps; 38 void WithCommandSeqNum(uint8_t seq_num) {
39 fir_item_.CommandSequenceNumber = seq_num;
38 } 40 }
39 41
40 protected: 42 protected:
41 bool Create(uint8_t* packet, 43 bool Create(uint8_t* packet,
42 size_t* index, 44 size_t* index,
43 size_t max_length, 45 size_t max_length,
44 RtcpPacket::PacketReadyCallback* callback) const override; 46 RtcpPacket::PacketReadyCallback* callback) const override;
45 47
46 private: 48 private:
47 static const int kMaxNumberOfSsrcs = 0xff;
48
49 size_t BlockLength() const { 49 size_t BlockLength() const {
50 return (remb_item_.NumberOfSSRCs + 5) * 4; 50 const size_t kFciLength = 8;
51 return kCommonFbFmtLength + kFciLength;
51 } 52 }
52 53
53 RTCPUtility::RTCPPacketPSFBAPP remb_; 54 RTCPUtility::RTCPPacketPSFBFIR fir_;
54 RTCPUtility::RTCPPacketPSFBREMBItem remb_item_; 55 RTCPUtility::RTCPPacketPSFBFIRItem fir_item_;
56 };
55 57
56 RTC_DISALLOW_COPY_AND_ASSIGN(Remb);
57 };
58 } // namespace rtcp 58 } // namespace rtcp
59 } // namespace webrtc 59 } // namespace webrtc
60 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_REMB_H_ 60 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_FIR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698