Upstream version 7.35.144.0
[platform/framework/web/crosswalk.git] / src / third_party / webrtc / modules / remote_bitrate_estimator / include / rtp_to_ntp.h
1 /*
2  *  Copyright (c) 2012 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_REMOTE_BITRATE_ESTIMATOR_INCLUDE_RTP_TO_NTP_H_
12 #define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_RTP_TO_NTP_H_
13
14 #include <list>
15
16 #include "webrtc/typedefs.h"
17
18 namespace webrtc {
19
20 namespace synchronization {
21
22 struct RtcpMeasurement {
23   RtcpMeasurement();
24   RtcpMeasurement(uint32_t ntp_secs, uint32_t ntp_frac, uint32_t timestamp);
25   uint32_t ntp_secs;
26   uint32_t ntp_frac;
27   uint32_t rtp_timestamp;
28 };
29
30 typedef std::list<RtcpMeasurement> RtcpList;
31
32 // Converts an RTP timestamp to the NTP domain in milliseconds using two
33 // (RTP timestamp, NTP timestamp) pairs.
34 bool RtpToNtpMs(int64_t rtp_timestamp, const RtcpList& rtcp,
35                 int64_t* timestamp_in_ms);
36
37 // Returns 1 there has been a forward wrap around, 0 if there has been no wrap
38 // around and -1 if there has been a backwards wrap around (i.e. reordering).
39 int CheckForWrapArounds(uint32_t rtp_timestamp, uint32_t rtcp_rtp_timestamp);
40 }  // namespace synchronization
41 }  // namespace webrtc
42
43 #endif  // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_INCLUDE_RTP_TO_NTP_H_