Chromium Code Reviews| Index: media/base/media_content_type.cc |
| diff --git a/media/base/media_content_type.cc b/media/base/media_content_type.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3b8c8e2ef60f7a4e0dd10753c9f4edef514b5b4d |
| --- /dev/null |
| +++ b/media/base/media_content_type.cc |
| @@ -0,0 +1,20 @@ |
| +// 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 "media/base/media_content_type.h" |
| + |
| +namespace media { |
| + |
| +namespace { |
| +const int kMinimumContentDurationSecs = 5; |
| +} // anonymous namespace |
| + |
| +MediaContentType DurationToMediaContentType(base::TimeDelta duration) { |
| + return (duration.is_zero() || |
|
DaleCurtis
2016/08/22 17:37:22
Should probably add a comment about the zero case.
|
| + duration > base::TimeDelta::FromSeconds(kMinimumContentDurationSecs)) |
| + ? MediaContentType::Persistent |
| + : MediaContentType::Transient; |
| +} |
| + |
| +} // namespace media |