psfb.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #ifndef MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_PSFB_H_
  12. #define MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_PSFB_H_
  13. #include <stddef.h>
  14. #include <stdint.h>
  15. #include "modules/rtp_rtcp/source/rtcp_packet.h"
  16. namespace webrtc {
  17. namespace rtcp {
  18. // PSFB: Payload-specific feedback message.
  19. // RFC 4585, Section 6.3.
  20. class Psfb : public RtcpPacket {
  21. public:
  22. static constexpr uint8_t kPacketType = 206;
  23. static constexpr uint8_t kAfbMessageType = 15;
  24. Psfb() = default;
  25. ~Psfb() override = default;
  26. void SetMediaSsrc(uint32_t ssrc) { media_ssrc_ = ssrc; }
  27. uint32_t media_ssrc() const { return media_ssrc_; }
  28. protected:
  29. static constexpr size_t kCommonFeedbackLength = 8;
  30. void ParseCommonFeedback(const uint8_t* payload);
  31. void CreateCommonFeedback(uint8_t* payload) const;
  32. private:
  33. uint32_t media_ssrc_ = 0;
  34. };
  35. } // namespace rtcp
  36. } // namespace webrtc
  37. #endif // MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_PSFB_H_