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

Unified Diff: media/base/media_content_type.cc

Issue 1996043002: Split MediaContentType and AudioFocusType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed nits Created 4 years, 4 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/media_content_type.h ('k') | media/blink/webmediaplayer_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..3fc666b1f473614f7e8d84b8f6b3f7502b04371f
--- /dev/null
+++ b/media/base/media_content_type.cc
@@ -0,0 +1,22 @@
+// 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) {
+ // A zero duration indicates that the duration is unknown. "Persistent" type
+ // should be used in this case.
+ return (duration.is_zero() ||
+ duration > base::TimeDelta::FromSeconds(kMinimumContentDurationSecs))
+ ? MediaContentType::Persistent
+ : MediaContentType::Transient;
+}
+
+} // namespace media
« no previous file with comments | « media/base/media_content_type.h ('k') | media/blink/webmediaplayer_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698