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

Unified Diff: media/base/stream_position.cc

Issue 2366373003: Not for submission. fastSeek prototype. (Closed)
Patch Set: Created 4 years, 3 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
« no previous file with comments | « media/base/stream_position.h ('k') | media/base/video_renderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/stream_position.cc
diff --git a/media/base/stream_position.cc b/media/base/stream_position.cc
new file mode 100644
index 0000000000000000000000000000000000000000..801b476a1b9db6367e7fbc6f2d7157aeb58d7362
--- /dev/null
+++ b/media/base/stream_position.cc
@@ -0,0 +1,34 @@
+// Copyright 2016 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.
+
+#include <sstream>
+
+#include "media/base/stream_position.h"
+
+namespace media {
+
+// static
+StreamPosition StreamPosition::Precise(base::TimeDelta time) {
+ return {Kind::PRECISE, time};
+}
+
+// static
+StreamPosition StreamPosition::KeyFramePrecedingTime(base::TimeDelta time) {
+ return {Kind::KEY_FRAME_PRECEDING_TIME, time};
+}
+
+bool StreamPosition::operator==(const StreamPosition& other) {
+ return kind == other.kind && time == other.time;
+}
+
+std::string ToString(StreamPosition position) {
+ std::ostringstream s;
+ s << "[" << (position.kind == StreamPosition::Kind::PRECISE
+ ? "PRECISE: "
+ : "KEY_FRAME_PRECEDING_TIME: ")
+ << position.time.InMicroseconds() << " us]";
+ return s.str();
+}
+
+} // namespace media
« no previous file with comments | « media/base/stream_position.h ('k') | media/base/video_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698