| 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
|
|
|