| OLD | NEW |
| (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 |
| OLD | NEW |