danilchap | f8385ad | 2015-11-27 05:36:09 -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_PSFB_H_ |
| 13 | #define MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_PSFB_H_ |
danilchap | f8385ad | 2015-11-27 05:36:09 -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 | f8385ad | 2015-11-27 05:36:09 -0800 | [diff] [blame] | 19 | |
| 20 | namespace webrtc { |
| 21 | namespace rtcp { |
| 22 | |
| 23 | // PSFB: Payload-specific feedback message. |
| 24 | // RFC 4585, Section 6.3. |
| 25 | class Psfb : public RtcpPacket { |
| 26 | public: |
danilchap | 0fc37d7 | 2016-05-31 01:36:37 -0700 | [diff] [blame] | 27 | static constexpr uint8_t kPacketType = 206; |
Elad Alon | 74f0a51 | 2019-02-23 22:16:52 +0100 | [diff] [blame] | 28 | static constexpr uint8_t kAfbMessageType = 15; |
danilchap | f8385ad | 2015-11-27 05:36:09 -0800 | [diff] [blame] | 29 | |
Danil Chapovalov | cbbfd08 | 2019-10-10 09:56:29 +0200 | [diff] [blame] | 30 | Psfb() = default; |
| 31 | ~Psfb() override = default; |
danilchap | f8385ad | 2015-11-27 05:36:09 -0800 | [diff] [blame] | 32 | |
danilchap | 822a16f | 2016-09-27 09:27:47 -0700 | [diff] [blame] | 33 | void SetMediaSsrc(uint32_t ssrc) { media_ssrc_ = ssrc; } |
danilchap | f8385ad | 2015-11-27 05:36:09 -0800 | [diff] [blame] | 34 | |
danilchap | f8385ad | 2015-11-27 05:36:09 -0800 | [diff] [blame] | 35 | uint32_t media_ssrc() const { return media_ssrc_; } |
| 36 | |
| 37 | protected: |
danilchap | 0fc37d7 | 2016-05-31 01:36:37 -0700 | [diff] [blame] | 38 | static constexpr size_t kCommonFeedbackLength = 8; |
danilchap | f8385ad | 2015-11-27 05:36:09 -0800 | [diff] [blame] | 39 | void ParseCommonFeedback(const uint8_t* payload); |
| 40 | void CreateCommonFeedback(uint8_t* payload) const; |
| 41 | |
| 42 | private: |
Danil Chapovalov | cbbfd08 | 2019-10-10 09:56:29 +0200 | [diff] [blame] | 43 | uint32_t media_ssrc_ = 0; |
danilchap | f8385ad | 2015-11-27 05:36:09 -0800 | [diff] [blame] | 44 | }; |
| 45 | |
| 46 | } // namespace rtcp |
| 47 | } // namespace webrtc |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 48 | #endif // MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_PSFB_H_ |