| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_ | 5 #ifndef MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_ |
| 6 #define MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_ | 6 #define MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_ |
| 7 | 7 |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "base/threading/thread_checker.h" | 9 #include "base/threading/thread_checker.h" |
| 10 #include "media/cast/logging/logging_defines.h" | 10 #include "media/cast/logging/logging_defines.h" |
| 11 #include "media/cast/logging/receiver_time_offset_estimator.h" | 11 #include "media/cast/logging/receiver_time_offset_estimator.h" |
| 12 | 12 |
| 13 namespace media { | 13 namespace media { |
| 14 namespace cast { | 14 namespace cast { |
| 15 | 15 |
| 16 // This implementation listens to three types of events: | 16 // This implementation listens to three types of video events: |
| 17 // 1. kVideoFrameEncoded (sender side) | 17 // 1. FRAME_ENCODED (sender side) |
| 18 // 2. kVideoAckSent (receiver side) | 18 // 2. FRAME_ACK_SENT (receiver side) |
| 19 // 3. kVideoAckReceived (sender side) | 19 // 3. FRAME_ACK_RECEIVED (sender side) |
| 20 // There is a causal relationship between these events in that these events | 20 // There is a causal relationship between these events in that these events |
| 21 // must happen in order. This class obtains the lower and upper bounds for | 21 // must happen in order. This class obtains the lower and upper bounds for |
| 22 // the offset by taking the difference of timestamps (2) - (1) and (2) - (3), | 22 // the offset by taking the difference of timestamps (2) - (1) and (2) - (3), |
| 23 // respectively. | 23 // respectively. |
| 24 // The bound will become better as the latency between the events decreases. | 24 // The bound will become better as the latency between the events decreases. |
| 25 class ReceiverTimeOffsetEstimatorImpl : public ReceiverTimeOffsetEstimator { | 25 class ReceiverTimeOffsetEstimatorImpl : public ReceiverTimeOffsetEstimator { |
| 26 public: | 26 public: |
| 27 ReceiverTimeOffsetEstimatorImpl(); | 27 ReceiverTimeOffsetEstimatorImpl(); |
| 28 | 28 |
| 29 virtual ~ReceiverTimeOffsetEstimatorImpl(); | 29 virtual ~ReceiverTimeOffsetEstimatorImpl(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 55 base::TimeDelta offset_upper_bound_; | 55 base::TimeDelta offset_upper_bound_; |
| 56 | 56 |
| 57 base::ThreadChecker thread_checker_; | 57 base::ThreadChecker thread_checker_; |
| 58 DISALLOW_COPY_AND_ASSIGN(ReceiverTimeOffsetEstimatorImpl); | 58 DISALLOW_COPY_AND_ASSIGN(ReceiverTimeOffsetEstimatorImpl); |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 } // namespace cast | 61 } // namespace cast |
| 62 } // namespace media | 62 } // namespace media |
| 63 | 63 |
| 64 #endif // MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_ | 64 #endif // MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_ |
| OLD | NEW |