// Copyright 2014 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_ #define MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_ #include <stddef.h> #include <stdint.h> #include <map> #include "base/threading/thread_checker.h" #include "base/time/time.h" #include "media/cast/common/mod_util.h" #include "media/cast/logging/logging_defines.h" #include "media/cast/logging/receiver_time_offset_estimator.h" namespace media { namespace cast { // This should be large enough so that we can collect all 3 events before // the entry gets removed from the map. const size_t kMaxEventTimesMapSize = …; // The lower, this is, the faster we adjust to clock drift. // (But with more jitter.) const size_t kClockDriftSpeed = …; // This implementation listens to two pair of events // 1. FRAME_ACK_SENT / FRAME_ACK_RECEIVED (receiver->sender) // 2. PACKET_SENT_TO_NETWORK / PACKET_RECEIVED (sender->receiver) // There is a causal relationship between these events in that these events // must happen in order. This class obtains the lower and upper bounds for // the offset by taking the difference of timestamps. class ReceiverTimeOffsetEstimatorImpl final : public ReceiverTimeOffsetEstimator { … }; } // namespace cast } // namespace media #endif // MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_