blob: fc47bf8939c8705af3d39c4bd7c343d407da2581 [file] [log] [blame]
wu@webrtc.org822fbd82013-08-15 23:38:54 +00001/*
2 * Copyright (c) 2013 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 WEBRTC_MODULES_RTP_RTCP_INTERFACE_RECEIVE_STATISTICS_H_
12#define WEBRTC_MODULES_RTP_RTCP_INTERFACE_RECEIVE_STATISTICS_H_
13
14#include "webrtc/modules/interface/module.h"
15#include "webrtc/modules/interface/module_common_types.h"
16#include "webrtc/typedefs.h"
17
18namespace webrtc {
19
20class Clock;
21
22class ReceiveStatistics : public Module {
23 public:
24 struct RtpReceiveStatistics {
25 uint8_t fraction_lost;
26 uint32_t cumulative_lost;
27 uint32_t extended_max_sequence_number;
28 uint32_t jitter;
29 uint32_t max_jitter;
30 };
31
32 virtual ~ReceiveStatistics() {}
33
34 static ReceiveStatistics* Create(Clock* clock);
35
36 virtual void IncomingPacket(const RTPHeader& rtp_header, size_t bytes,
37 bool retransmitted, bool in_order) = 0;
38
39 virtual bool Statistics(RtpReceiveStatistics* statistics, bool reset) = 0;
40
41 virtual bool Statistics(RtpReceiveStatistics* statistics, int32_t* missing,
42 bool reset) = 0;
43
44 virtual void GetDataCounters(uint32_t* bytes_received,
45 uint32_t* packets_received) const = 0;
46
47 virtual uint32_t BitrateReceived() = 0;
48
49 virtual void ResetStatistics() = 0;
50
51 virtual void ResetDataCounters() = 0;
52};
53} // namespace webrtc
54#endif // WEBRTC_MODULES_RTP_RTCP_INTERFACE_RECEIVE_STATISTICS_H_