henrik.lundin@webrtc.org | d94659d | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2011 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 Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef MODULES_AUDIO_CODING_NETEQ_RTCP_H_ |
| 12 | #define MODULES_AUDIO_CODING_NETEQ_RTCP_H_ |
henrik.lundin@webrtc.org | d94659d | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 13 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 14 | #include "modules/audio_coding/neteq/include/neteq.h" |
| 15 | #include "rtc_base/constructormagic.h" |
Mirko Bonadei | 7120742 | 2017-09-15 13:58:09 +0200 | [diff] [blame] | 16 | #include "typedefs.h" // NOLINT(build/include) |
henrik.lundin@webrtc.org | d94659d | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 17 | |
| 18 | namespace webrtc { |
| 19 | |
| 20 | // Forward declaration. |
| 21 | struct RTPHeader; |
| 22 | |
| 23 | class Rtcp { |
| 24 | public: |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame^] | 25 | Rtcp() { Init(0); } |
henrik.lundin@webrtc.org | d94659d | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 26 | |
| 27 | ~Rtcp() {} |
| 28 | |
| 29 | // Resets the RTCP statistics, and sets the first received sequence number. |
| 30 | void Init(uint16_t start_sequence_number); |
| 31 | |
| 32 | // Updates the RTCP statistics with a new received packet. |
| 33 | void Update(const RTPHeader& rtp_header, uint32_t receive_timestamp); |
| 34 | |
| 35 | // Returns the current RTCP statistics. If |no_reset| is true, the statistics |
| 36 | // are not reset, otherwise they are. |
| 37 | void GetStatistics(bool no_reset, RtcpStatistics* stats); |
| 38 | |
| 39 | private: |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame^] | 40 | uint16_t cycles_; // The number of wrap-arounds for the sequence number. |
| 41 | uint16_t max_seq_no_; // The maximum sequence number received. Starts over |
| 42 | // from 0 after wrap-around. |
henrik.lundin@webrtc.org | d94659d | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 43 | uint16_t base_seq_no_; // The sequence number of the first received packet. |
| 44 | uint32_t received_packets_; // The number of packets that have been received. |
| 45 | uint32_t received_packets_prior_; // Number of packets received when last |
| 46 | // report was generated. |
| 47 | uint32_t expected_prior_; // Expected number of packets, at the time of the |
| 48 | // last report. |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame^] | 49 | int64_t jitter_; // Current jitter value in Q4. |
| 50 | int32_t transit_; // Clock difference for previous packet. |
henrik.lundin@webrtc.org | d94659d | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 51 | |
henrikg | 3c089d7 | 2015-09-16 05:37:44 -0700 | [diff] [blame] | 52 | RTC_DISALLOW_COPY_AND_ASSIGN(Rtcp); |
henrik.lundin@webrtc.org | d94659d | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 53 | }; |
| 54 | |
| 55 | } // namespace webrtc |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 56 | #endif // MODULES_AUDIO_CODING_NETEQ_RTCP_H_ |