1 /*
2  *  Copyright (c) 2015 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 MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_RTPFB_H_
13 #define MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_RTPFB_H_
14 
15 #include <stddef.h>
16 #include <stdint.h>
17 
18 #include "modules/rtp_rtcp/source/rtcp_packet.h"
19 
20 namespace webrtc {
21 namespace rtcp {
22 
23 // RTPFB: Transport layer feedback message.
24 // RFC4585, Section 6.2
25 class Rtpfb : public RtcpPacket {
26  public:
27   static constexpr uint8_t kPacketType = 205;
28 
29   Rtpfb() = default;
30   ~Rtpfb() override = default;
31 
SetMediaSsrc(uint32_t ssrc)32   void SetMediaSsrc(uint32_t ssrc) { media_ssrc_ = ssrc; }
33 
media_ssrc()34   uint32_t media_ssrc() const { return media_ssrc_; }
35 
36  protected:
37   static constexpr size_t kCommonFeedbackLength = 8;
38   void ParseCommonFeedback(const uint8_t* payload);
39   void CreateCommonFeedback(uint8_t* payload) const;
40 
41  private:
42   uint32_t media_ssrc_ = 0;
43 };
44 
45 }  // namespace rtcp
46 }  // namespace webrtc
47 #endif  // MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_RTPFB_H_
48