Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_H_ | |
| 6 #define MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_H_ | |
| 7 | |
| 8 #include "base/time/time.h" | |
| 9 #include "media/cast/logging/raw_event_subscriber.h" | |
| 10 | |
| 11 namespace media { | |
| 12 namespace cast { | |
| 13 | |
| 14 // Estimates receiver time offset based on raw events received. | |
| 15 // In most cases, the sender and receiver run on different time lines. | |
| 16 // In order to convert receiver time back to sender time (or vice versa) | |
| 17 // a certain time offset has to be applied. | |
| 18 // This interface listens to raw events to figure out the bounds for the | |
|
miu
2014/04/17 02:14:14
s/This interface listens to/An implementation of t
imcheng
2014/04/17 19:19:06
Done.
| |
| 19 // offset value (assuming the true offset value is constant over the lifetime of | |
| 20 // a cast session). | |
| 21 // The offset values provided here should be used as follows: | |
| 22 // - Convert from sender to receiver time: add offset value to sender timestamp. | |
| 23 // - Convert from receiver to sender time: receiver offset value from receiver | |
|
miu
2014/04/17 02:14:14
s/receiver offset/subtract offset/
imcheng
2014/04/17 19:19:06
Done.
| |
| 24 // timestamp. | |
| 25 class ReceiverTimeOffsetEstimator : public RawEventSubscriber { | |
| 26 public: | |
| 27 virtual ~ReceiverTimeOffsetEstimator() {} | |
| 28 | |
| 29 // If bounds are known, assigns |lower_bound| and |upper_bound| with the | |
| 30 // lower bound and upper bound for the offset value, respectively. | |
| 31 // Returns true if bounds are known. | |
| 32 virtual bool GetReceiverOffsetBounds(base::TimeDelta* lower_bound, | |
| 33 base::TimeDelta* upper_bound) = 0; | |
| 34 }; | |
| 35 | |
| 36 } // namespace cast | |
| 37 } // namespace media | |
| 38 | |
| 39 #endif // MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_H_ | |
| OLD | NEW |