danilchap | a8890a5 | 2015-12-22 03:43:04 -0800 | [diff] [blame] | 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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 12 | #ifndef MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_RTPFB_H_ |
| 13 | #define MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_RTPFB_H_ |
danilchap | a8890a5 | 2015-12-22 03:43:04 -0800 | [diff] [blame] | 14 | |
Yves Gerey | 988cc08 | 2018-10-23 12:03:01 +0200 | [diff] [blame] | 15 | #include <stddef.h> |
| 16 | #include <stdint.h> |
| 17 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 18 | #include "modules/rtp_rtcp/source/rtcp_packet.h" |
danilchap | a8890a5 | 2015-12-22 03:43:04 -0800 | [diff] [blame] | 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: |
danilchap | 6ce1adc | 2016-05-26 05:29:14 -0700 | [diff] [blame] | 27 | static constexpr uint8_t kPacketType = 205; |
danilchap | a8890a5 | 2015-12-22 03:43:04 -0800 | [diff] [blame] | 28 | |
Danil Chapovalov | cbbfd08 | 2019-10-10 09:56:29 +0200 | [diff] [blame] | 29 | Rtpfb() = default; |
| 30 | ~Rtpfb() override = default; |
danilchap | a8890a5 | 2015-12-22 03:43:04 -0800 | [diff] [blame] | 31 | |
danilchap | 822a16f | 2016-09-27 09:27:47 -0700 | [diff] [blame] | 32 | void SetMediaSsrc(uint32_t ssrc) { media_ssrc_ = ssrc; } |
danilchap | a8890a5 | 2015-12-22 03:43:04 -0800 | [diff] [blame] | 33 | |
danilchap | a8890a5 | 2015-12-22 03:43:04 -0800 | [diff] [blame] | 34 | uint32_t media_ssrc() const { return media_ssrc_; } |
| 35 | |
| 36 | protected: |
danilchap | 6ce1adc | 2016-05-26 05:29:14 -0700 | [diff] [blame] | 37 | static constexpr size_t kCommonFeedbackLength = 8; |
danilchap | a8890a5 | 2015-12-22 03:43:04 -0800 | [diff] [blame] | 38 | void ParseCommonFeedback(const uint8_t* payload); |
| 39 | void CreateCommonFeedback(uint8_t* payload) const; |
| 40 | |
| 41 | private: |
Danil Chapovalov | cbbfd08 | 2019-10-10 09:56:29 +0200 | [diff] [blame] | 42 | uint32_t media_ssrc_ = 0; |
danilchap | a8890a5 | 2015-12-22 03:43:04 -0800 | [diff] [blame] | 43 | }; |
| 44 | |
| 45 | } // namespace rtcp |
| 46 | } // namespace webrtc |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 47 | #endif // MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_RTPFB_H_ |