LCOV - code coverage report
Current view: top level - media/webrtc/trunk/webrtc/modules/rtp_rtcp/include - receive_statistics.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 4 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 6 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /*
       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_INCLUDE_RECEIVE_STATISTICS_H_
      12             : #define WEBRTC_MODULES_RTP_RTCP_INCLUDE_RECEIVE_STATISTICS_H_
      13             : 
      14             : #include <map>
      15             : 
      16             : #include "webrtc/modules/include/module.h"
      17             : #include "webrtc/modules/include/module_common_types.h"
      18             : #include "webrtc/typedefs.h"
      19             : 
      20             : namespace webrtc {
      21             : 
      22             : class Clock;
      23             : 
      24           0 : class StreamStatistician {
      25             :  public:
      26             :   virtual ~StreamStatistician();
      27             : 
      28             :   virtual bool GetStatistics(RtcpStatistics* statistics, bool reset) = 0;
      29             :   virtual void GetDataCounters(size_t* bytes_received,
      30             :                                uint32_t* packets_received) const = 0;
      31             : 
      32             :   // Gets received stream data counters (includes reset counter values).
      33             :   virtual void GetReceiveStreamDataCounters(
      34             :       StreamDataCounters* data_counters) const = 0;
      35             : 
      36             :   virtual uint32_t BitrateReceived() const = 0;
      37             : 
      38             :   // Returns true if the packet with RTP header |header| is likely to be a
      39             :   // retransmitted packet, false otherwise.
      40             :   virtual bool IsRetransmitOfOldPacket(const RTPHeader& header,
      41             :                                        int64_t min_rtt) const = 0;
      42             : 
      43             :   // Returns true if |sequence_number| is received in order, false otherwise.
      44             :   virtual bool IsPacketInOrder(uint16_t sequence_number) const = 0;
      45             : };
      46             : 
      47             : typedef std::map<uint32_t, StreamStatistician*> StatisticianMap;
      48             : 
      49           0 : class ReceiveStatistics {
      50             :  public:
      51           0 :   virtual ~ReceiveStatistics() {}
      52             : 
      53             :   static ReceiveStatistics* Create(Clock* clock);
      54             : 
      55             :   // Updates the receive statistics with this packet.
      56             :   virtual void IncomingPacket(const RTPHeader& rtp_header,
      57             :                               size_t packet_length,
      58             :                               bool retransmitted) = 0;
      59             : 
      60             :   // Increment counter for number of FEC packets received.
      61             :   virtual void FecPacketReceived(const RTPHeader& header,
      62             :                                  size_t packet_length) = 0;
      63             : 
      64             :   // Returns a map of all statisticians which have seen an incoming packet
      65             :   // during the last two seconds.
      66             :   virtual StatisticianMap GetActiveStatisticians() const = 0;
      67             : 
      68             :   // Returns a pointer to the statistician of an ssrc.
      69             :   virtual StreamStatistician* GetStatistician(uint32_t ssrc) const = 0;
      70             : 
      71             :   // Sets the max reordering threshold in number of packets.
      72             :   virtual void SetMaxReorderingThreshold(int max_reordering_threshold) = 0;
      73             : 
      74             :   // Called on new RTCP stats creation.
      75             :   virtual void RegisterRtcpStatisticsCallback(
      76             :       RtcpStatisticsCallback* callback) = 0;
      77             : 
      78             :   // Called on new RTP stats creation.
      79             :   virtual void RegisterRtpStatisticsCallback(
      80             :       StreamDataCountersCallback* callback) = 0;
      81             : };
      82             : 
      83           0 : class NullReceiveStatistics : public ReceiveStatistics {
      84             :  public:
      85             :   void IncomingPacket(const RTPHeader& rtp_header,
      86             :                       size_t packet_length,
      87             :                       bool retransmitted) override;
      88             :   void FecPacketReceived(const RTPHeader& header,
      89             :                          size_t packet_length) override;
      90             :   StatisticianMap GetActiveStatisticians() const override;
      91             :   StreamStatistician* GetStatistician(uint32_t ssrc) const override;
      92             :   void SetMaxReorderingThreshold(int max_reordering_threshold) override;
      93             :   void RegisterRtcpStatisticsCallback(
      94             :       RtcpStatisticsCallback* callback) override;
      95             :   void RegisterRtpStatisticsCallback(
      96             :       StreamDataCountersCallback* callback) override;
      97             : };
      98             : 
      99             : }  // namespace webrtc
     100             : #endif  // WEBRTC_MODULES_RTP_RTCP_INCLUDE_RECEIVE_STATISTICS_H_

Generated by: LCOV version 1.13