blob: d9e2622abc500f8771d59a99a03f1ef2f1cac61c [file] [log] [blame]
danilchap84432382017-02-09 05:21:42 -08001/*
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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_RTP_RTCP_SOURCE_RTCP_NACK_STATS_H_
12#define MODULES_RTP_RTCP_SOURCE_RTCP_NACK_STATS_H_
danilchap84432382017-02-09 05:21:42 -080013
14#include <stdint.h>
15
16namespace webrtc {
17
18class RtcpNackStats {
19 public:
20 RtcpNackStats();
21
22 // Updates stats with requested sequence number.
23 // This function should be called for each NACK request to calculate the
24 // number of unique NACKed RTP packets.
25 void ReportRequest(uint16_t sequence_number);
26
27 // Gets the number of NACKed RTP packets.
28 uint32_t requests() const { return requests_; }
29
30 // Gets the number of unique NACKed RTP packets.
31 uint32_t unique_requests() const { return unique_requests_; }
32
33 private:
34 uint16_t max_sequence_number_;
35 uint32_t requests_;
36 uint32_t unique_requests_;
37};
38
39} // namespace webrtc
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020040#endif // MODULES_RTP_RTCP_SOURCE_RTCP_NACK_STATS_H_