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

Side by Side Diff: media/base/stream_position.cc

Issue 2366373003: Not for submission. fastSeek prototype. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « media/base/stream_position.h ('k') | media/base/video_renderer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 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 #include <sstream>
6
7 #include "media/base/stream_position.h"
8
9 namespace media {
10
11 // static
12 StreamPosition StreamPosition::Precise(base::TimeDelta time) {
13 return {Kind::PRECISE, time};
14 }
15
16 // static
17 StreamPosition StreamPosition::KeyFramePrecedingTime(base::TimeDelta time) {
18 return {Kind::KEY_FRAME_PRECEDING_TIME, time};
19 }
20
21 bool StreamPosition::operator==(const StreamPosition& other) {
22 return kind == other.kind && time == other.time;
23 }
24
25 std::string ToString(StreamPosition position) {
26 std::ostringstream s;
27 s << "[" << (position.kind == StreamPosition::Kind::PRECISE
28 ? "PRECISE: "
29 : "KEY_FRAME_PRECEDING_TIME: ")
30 << position.time.InMicroseconds() << " us]";
31 return s.str();
32 }
33
34 } // namespace media
OLDNEW
« 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