| 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 <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // There is a causal relationship between these events in that these events | 32 // There is a causal relationship between these events in that these events |
| 33 // must happen in order. This class obtains the lower and upper bounds for | 33 // must happen in order. This class obtains the lower and upper bounds for |
| 34 // the offset by taking the difference of timestamps. | 34 // the offset by taking the difference of timestamps. |
| 35 class ReceiverTimeOffsetEstimatorImpl : public ReceiverTimeOffsetEstimator { | 35 class ReceiverTimeOffsetEstimatorImpl : public ReceiverTimeOffsetEstimator { |
| 36 public: | 36 public: |
| 37 ReceiverTimeOffsetEstimatorImpl(); | 37 ReceiverTimeOffsetEstimatorImpl(); |
| 38 | 38 |
| 39 virtual ~ReceiverTimeOffsetEstimatorImpl(); | 39 virtual ~ReceiverTimeOffsetEstimatorImpl(); |
| 40 | 40 |
| 41 // RawEventSubscriber implementations. | 41 // RawEventSubscriber implementations. |
| 42 virtual void OnReceiveFrameEvent(const FrameEvent& frame_event) OVERRIDE; | 42 virtual void OnReceiveFrameEvent(const FrameEvent& frame_event) override; |
| 43 virtual void OnReceivePacketEvent(const PacketEvent& packet_event) OVERRIDE; | 43 virtual void OnReceivePacketEvent(const PacketEvent& packet_event) override; |
| 44 | 44 |
| 45 // ReceiverTimeOffsetEstimator implementation. | 45 // ReceiverTimeOffsetEstimator implementation. |
| 46 virtual bool GetReceiverOffsetBounds(base::TimeDelta* lower_bound, | 46 virtual bool GetReceiverOffsetBounds(base::TimeDelta* lower_bound, |
| 47 base::TimeDelta* upper_bound) OVERRIDE; | 47 base::TimeDelta* upper_bound) override; |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 // This helper uses the difference between sent and recived event | 50 // This helper uses the difference between sent and recived event |
| 51 // to calculate an upper bound on the difference between the clocks | 51 // to calculate an upper bound on the difference between the clocks |
| 52 // on the sender and receiver. Note that this difference can take | 52 // on the sender and receiver. Note that this difference can take |
| 53 // very large positive or negative values, but the smaller value is | 53 // very large positive or negative values, but the smaller value is |
| 54 // always the better estimate, since a receive event cannot possibly | 54 // always the better estimate, since a receive event cannot possibly |
| 55 // happen before a send event. Note that we use this to calculate | 55 // happen before a send event. Note that we use this to calculate |
| 56 // both upper and lower bounds by reversing the sender/receiver | 56 // both upper and lower bounds by reversing the sender/receiver |
| 57 // relationship. | 57 // relationship. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 BoundCalculator lower_bound_; | 90 BoundCalculator lower_bound_; |
| 91 | 91 |
| 92 base::ThreadChecker thread_checker_; | 92 base::ThreadChecker thread_checker_; |
| 93 DISALLOW_COPY_AND_ASSIGN(ReceiverTimeOffsetEstimatorImpl); | 93 DISALLOW_COPY_AND_ASSIGN(ReceiverTimeOffsetEstimatorImpl); |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 } // namespace cast | 96 } // namespace cast |
| 97 } // namespace media | 97 } // namespace media |
| 98 | 98 |
| 99 #endif // MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_ | 99 #endif // MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_IMPL_H_ |
| OLD | NEW |