2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
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.
11 #ifndef WEBRTC_MODULES_VIDEO_CODING_TIMESTAMP_EXTRAPOLATOR_H_
12 #define WEBRTC_MODULES_VIDEO_CODING_TIMESTAMP_EXTRAPOLATOR_H_
14 #include "webrtc/system_wrappers/interface/rw_lock_wrapper.h"
15 #include "webrtc/typedefs.h"
22 class VCMTimestampExtrapolator
25 VCMTimestampExtrapolator(Clock* clock,
27 int32_t receiverId = 0);
28 ~VCMTimestampExtrapolator();
29 void Update(int64_t tMs, uint32_t ts90khz, bool trace = true);
30 int64_t ExtrapolateLocalTime(uint32_t timestamp90khz);
34 void CheckForWrapArounds(uint32_t ts90khz);
35 bool DelayChangeDetection(double error, bool trace = true);
36 RWLockWrapper* _rwLock;
44 uint32_t _firstTimestamp;
46 int64_t _prevUnwrappedTimestamp;
47 int64_t _prevWrapTimestamp;
49 bool _firstAfterReset;
50 uint32_t _packetCount;
51 const uint32_t _startUpFilterDelayInPackets;
53 double _detectorAccumulatorPos;
54 double _detectorAccumulatorNeg;
55 const double _alarmThreshold;
56 const double _accDrift;
57 const double _accMaxError;
63 #endif // WEBRTC_MODULES_VIDEO_CODING_TIMESTAMP_EXTRAPOLATOR_H_