Chromium Code Reviews| Index: webrtc/modules/rtp_rtcp/source/report_block_information.h |
| diff --git a/webrtc/modules/rtp_rtcp/source/report_block_information.h b/webrtc/modules/rtp_rtcp/source/report_block_information.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..feafb67322d077f718401b75103be83e6962de01 |
| --- /dev/null |
| +++ b/webrtc/modules/rtp_rtcp/source/report_block_information.h |
| @@ -0,0 +1,65 @@ |
| +/* |
| + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
| + * |
| + * Use of this source code is governed by a BSD-style license |
| + * that can be found in the LICENSE file in the root of the source |
| + * tree. An additional intellectual property rights grant can be found |
| + * in the file PATENTS. All contributing project authors may |
| + * be found in the AUTHORS file in the root of the source tree. |
| + */ |
| + |
| +#ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_REPORT_BLOCK_INFORMATION_H_ |
| +#define WEBRTC_MODULES_RTP_RTCP_SOURCE_REPORT_BLOCK_INFORMATION_H_ |
| + |
| +#include "webrtc/base/basictypes.h" |
| +#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
| +#include "webrtc/system_wrappers/include/ntp_time.h" |
| + |
| +namespace webrtc { |
| +namespace RTCPUtility { |
| +struct RTCPPacketReportBlockItem; |
| +} // namespace RTCPUtility |
| + |
| +namespace rtcp { |
| +class ReportBlock; |
| + |
| +// Keeps last received report block and some additional statistic information. |
| +class ReportBlockInformation { |
| + public: |
| + ReportBlockInformation(); |
| + ReportBlockInformation(const ReportBlockInformation&) = default; |
| + ~ReportBlockInformation() {} |
| + |
| + ReportBlockInformation& operator=(const ReportBlockInformation&) = default; |
| + // TODO(danilchap): Remove this version of the |
| + // function when RTCP parsing would switch from RTCPUtility. |
| + void AddBlock(const RTCPUtility::RTCPPacketReportBlockItem& block, |
| + uint32_t remote_ssrc, |
| + NtpTime now); |
| + void AddBlock(const rtcp::ReportBlock& block, |
| + uint32_t remote_ssrc, |
| + NtpTime now); |
| + |
| + const RTCPReportBlock& LastBlock() const; |
| + bool HasRtt() const; |
| + uint32_t LastRttMs() const; |
| + uint32_t MinRttMs() const; |
| + uint32_t MaxRttMs() const; |
| + uint32_t AvgRttMs() const; |
| + |
| + private: |
| + // TODO(danilchap): Incorporate this function into AddBlock when only one |
| + // version would be left. |
| + void AddRtt(uint32_t now); |
|
philipel
2016/03/03 14:00:59
(int64_t now) for storing thing related to time.
danilchap
2016/03/03 14:44:49
changed to NtpTime from compact ntp time for clari
|
| + // Number of blocks received where rtt could be calculated. |
| + size_t number_rtt_; |
| + // rtt is stored in 1/2^16 seconds (compact ntp representation). |
| + uint32_t last_rtt_; |
| + uint32_t min_rtt_; |
| + uint32_t max_rtt_; |
| + uint64_t sum_rtt_; |
| + RTCPReportBlock last_received_block_; |
| +}; |
| +} // namespace rtcp |
| +} // namespace webrtc |
| +#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_REPORT_BLOCK_INFORMATION_H_ |