rtpfb.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_RTPFB_H_
  12. #define MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_RTPFB_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. // RTPFB: Transport layer feedback message.
  19. // RFC4585, Section 6.2
  20. class Rtpfb : public RtcpPacket {
  21. public:
  22. static constexpr uint8_t kPacketType = 205;
  23. Rtpfb() = default;
  24. ~Rtpfb() override = default;
  25. void SetMediaSsrc(uint32_t ssrc) { media_ssrc_ = ssrc; }
  26. uint32_t media_ssrc() const { return media_ssrc_; }
  27. protected:
  28. static constexpr size_t kCommonFeedbackLength = 8;
  29. void ParseCommonFeedback(const uint8_t* payload);
  30. void CreateCommonFeedback(uint8_t* payload) const;
  31. private:
  32. uint32_t media_ssrc_ = 0;
  33. };
  34. } // namespace rtcp
  35. } // namespace webrtc
  36. #endif // MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_RTPFB_H_