rtcp_nack_stats.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) 2017 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. #ifndef MODULES_RTP_RTCP_SOURCE_RTCP_NACK_STATS_H_
  11. #define MODULES_RTP_RTCP_SOURCE_RTCP_NACK_STATS_H_
  12. #include <stdint.h>
  13. namespace webrtc {
  14. class RtcpNackStats {
  15. public:
  16. RtcpNackStats();
  17. // Updates stats with requested sequence number.
  18. // This function should be called for each NACK request to calculate the
  19. // number of unique NACKed RTP packets.
  20. void ReportRequest(uint16_t sequence_number);
  21. // Gets the number of NACKed RTP packets.
  22. uint32_t requests() const { return requests_; }
  23. // Gets the number of unique NACKed RTP packets.
  24. uint32_t unique_requests() const { return unique_requests_; }
  25. private:
  26. uint16_t max_sequence_number_;
  27. uint32_t requests_;
  28. uint32_t unique_requests_;
  29. };
  30. } // namespace webrtc
  31. #endif // MODULES_RTP_RTCP_SOURCE_RTCP_NACK_STATS_H_