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. 4 5#ifndef MEDIA_BLINK_WEBMEDIAPLAYER_UTIL_H_ 6#define MEDIA_BLINK_WEBMEDIAPLAYER_UTIL_H_ 7 8#include "base/time/time.h" 9#include "media/base/media_export.h" 10#include "media/base/pipeline_status.h" 11#include "media/base/ranges.h" 12#include "third_party/WebKit/public/platform/WebMediaPlayer.h" 13#include "third_party/WebKit/public/platform/WebTimeRange.h" 14#include "url/gurl.h" 15 16namespace media { 17 18// Platform independent method for converting and rounding floating point 19// seconds to an int64 timestamp. 20// 21// Refer to https://bugs.webkit.org/show_bug.cgi?id=52697 for details. 22base::TimeDelta MEDIA_EXPORT ConvertSecondsToTimestamp(double seconds); 23 24blink::WebTimeRanges MEDIA_EXPORT ConvertToWebTimeRanges( 25 const Ranges<base::TimeDelta>& ranges); 26 27blink::WebMediaPlayer::NetworkState MEDIA_EXPORT PipelineErrorToNetworkState( 28 PipelineStatus error); 29 30// Report the scheme of Media URIs. 31void MEDIA_EXPORT ReportMediaSchemeUma(const GURL& url); 32 33} // namespace media 34 35#endif // MEDIA_BLINK_WEBMEDIAPLAYER_UTIL_H_ 36