Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(973)

Unified Diff: media/cast/logging/receiver_time_offset_estimator.h

Issue 236123003: Cast: Provide more meaningful stats. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/cast/logging/receiver_time_offset_estimator.h
diff --git a/media/cast/logging/receiver_time_offset_estimator.h b/media/cast/logging/receiver_time_offset_estimator.h
new file mode 100644
index 0000000000000000000000000000000000000000..5880a8d5ac33a56c3f826b87291ed90b1d001ccf
--- /dev/null
+++ b/media/cast/logging/receiver_time_offset_estimator.h
@@ -0,0 +1,39 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// 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_H_
+#define MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_H_
+
+#include "base/time/time.h"
+#include "media/cast/logging/raw_event_subscriber.h"
+
+namespace media {
+namespace cast {
+
+// Estimates receiver time offset based on raw events received.
+// In most cases, the sender and receiver run on different time lines.
+// In order to convert receiver time back to sender time (or vice versa)
+// a certain time offset has to be applied.
+// An implementation of this interface listens to raw events to figure out
+// the bounds for the offset value (assuming the true offset value is constant
+// over the lifetime of a cast session).
+// The offset values provided here should be used as follows:
+// - Convert from sender to receiver time: add offset value to sender timestamp.
+// - Convert from receiver to sender time: subtract offset value from receiver
+// timestamp.
+class ReceiverTimeOffsetEstimator : public RawEventSubscriber {
+ public:
+ virtual ~ReceiverTimeOffsetEstimator() {}
+
+ // If bounds are known, assigns |lower_bound| and |upper_bound| with the
+ // lower bound and upper bound for the offset value, respectively.
+ // Returns true if bounds are known.
+ virtual bool GetReceiverOffsetBounds(base::TimeDelta* lower_bound,
+ base::TimeDelta* upper_bound) = 0;
+};
+
+} // namespace cast
+} // namespace media
+
+#endif // MEDIA_CAST_LOGGING_RECEIVER_TIME_OFFSET_ESTIMATOR_H_
« no previous file with comments | « media/cast/logging/raw_event_subscriber_bundle.cc ('k') | media/cast/logging/receiver_time_offset_estimator_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698