Autofill: Port changes to iOS JS code.
[chromium-blink-merge.git] / media / blink / webmediaplayer_util.h
blob005fbb958a7c9d4c9082de34937bd0925d1ef943
1 // Copyright 2013 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.
5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_UTIL_H_
6 #define MEDIA_BLINK_WEBMEDIAPLAYER_UTIL_H_
8 #include "base/time/time.h"
9 #include "media/base/eme_constants.h"
10 #include "media/base/media_export.h"
11 #include "media/base/pipeline_status.h"
12 #include "media/base/ranges.h"
13 #include "third_party/WebKit/public/platform/WebEncryptedMediaTypes.h"
14 #include "third_party/WebKit/public/platform/WebMediaPlayer.h"
15 #include "third_party/WebKit/public/platform/WebTimeRange.h"
16 #include "url/gurl.h"
18 namespace media {
20 // Platform independent method for converting and rounding floating point
21 // seconds to an int64 timestamp.
23 // Refer to https://bugs.webkit.org/show_bug.cgi?id=52697 for details.
24 base::TimeDelta MEDIA_EXPORT ConvertSecondsToTimestamp(double seconds);
26 blink::WebTimeRanges MEDIA_EXPORT ConvertToWebTimeRanges(
27 const Ranges<base::TimeDelta>& ranges);
29 blink::WebMediaPlayer::NetworkState MEDIA_EXPORT PipelineErrorToNetworkState(
30 PipelineStatus error);
32 // Report the scheme of Media URIs.
33 void MEDIA_EXPORT ReportMediaSchemeUma(const GURL& url);
35 // Convert Initialization Data Types.
36 EmeInitDataType MEDIA_EXPORT
37 ConvertToEmeInitDataType(blink::WebEncryptedMediaInitDataType init_data_type);
38 blink::WebEncryptedMediaInitDataType MEDIA_EXPORT
39 ConvertToWebInitDataType(EmeInitDataType init_data_type);
41 } // namespace media
43 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_UTIL_H_