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: |
| 25 | Rtcp() { |
| 26 | Init(0); |
| 27 | } |
| 28 | |
| 29 | ~Rtcp() {} |
| 30 | |
| 31 | // Resets the RTCP statistics, and sets the first received sequence number. |
| 32 | void Init(uint16_t start_sequence_number); |
| 33 | |
| 34 | // Updates the RTCP statistics with a new received packet. |
| 35 | void Update(const RTPHeader& rtp_header, uint32_t receive_timestamp); |
| 36 | |
| 37 | // Returns the current RTCP statistics. If |no_reset| is true, the statistics |
| 38 | // are not reset, otherwise they are. |
| 39 | void GetStatistics(bool no_reset, RtcpStatistics* stats); |
| 40 | |
| 41 | private: |
| 42 | uint16_t cycles_; // The number of wrap-arounds for the sequence number. |
| 43 | uint16_t max_seq_no_; // The maximum sequence number received. Starts over |
| 44 | // from 0 after wrap-around. |
| 45 | uint16_t base_seq_no_; // The sequence number of the first received packet. |
| 46 | uint32_t received_packets_; // The number of packets that have been received. |
| 47 | uint32_t received_packets_prior_; // Number of packets received when last |
| 48 | // report was generated. |
| 49 | uint32_t expected_prior_; // Expected number of packets, at the time of the |
| 50 | // last report. |
ossu | 6b6c88f | 2016-10-31 08:59:26 -0700 | [diff] [blame] | 51 | int64_t jitter_; // Current jitter value in Q4. |
henrik.lundin@webrtc.org | d94659d | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 52 | int32_t transit_; // Clock difference for previous packet. |
| 53 | |
henrikg | 3c089d7 | 2015-09-16 05:37:44 -0700 | [diff] [blame] | 54 | RTC_DISALLOW_COPY_AND_ASSIGN(Rtcp); |
henrik.lundin@webrtc.org | d94659d | 2013-01-29 12:09:21 +0000 | [diff] [blame] | 55 | }; |
| 56 | |
| 57 | } // namespace webrtc |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 58 | #endif // MODULES_AUDIO_CODING_NETEQ_RTCP_H_ |