OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_UTIL_H_ | 5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_UTIL_H_ |
6 #define MEDIA_BLINK_WEBMEDIAPLAYER_UTIL_H_ | 6 #define MEDIA_BLINK_WEBMEDIAPLAYER_UTIL_H_ |
7 | 7 |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "media/base/audio_renderer_sink.h" | 9 #include "media/base/audio_renderer_sink.h" |
10 #include "media/base/eme_constants.h" | 10 #include "media/base/eme_constants.h" |
11 #include "media/base/media_export.h" | |
12 #include "media/base/pipeline_status.h" | 11 #include "media/base/pipeline_status.h" |
13 #include "media/base/ranges.h" | 12 #include "media/base/ranges.h" |
| 13 #include "media/blink/media_blink_export.h" |
14 #include "third_party/WebKit/public/platform/WebCallbacks.h" | 14 #include "third_party/WebKit/public/platform/WebCallbacks.h" |
15 #include "third_party/WebKit/public/platform/WebEncryptedMediaTypes.h" | 15 #include "third_party/WebKit/public/platform/WebEncryptedMediaTypes.h" |
16 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" | 16 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" |
17 #include "third_party/WebKit/public/platform/WebSetSinkIdError.h" | 17 #include "third_party/WebKit/public/platform/WebSetSinkIdError.h" |
18 #include "third_party/WebKit/public/platform/WebTimeRange.h" | 18 #include "third_party/WebKit/public/platform/WebTimeRange.h" |
19 #include "url/gurl.h" | 19 #include "url/gurl.h" |
20 | 20 |
21 namespace media { | 21 namespace media { |
22 | 22 |
23 blink::WebTimeRanges MEDIA_EXPORT ConvertToWebTimeRanges( | 23 blink::WebTimeRanges MEDIA_BLINK_EXPORT |
24 const Ranges<base::TimeDelta>& ranges); | 24 ConvertToWebTimeRanges(const Ranges<base::TimeDelta>& ranges); |
25 | 25 |
26 blink::WebMediaPlayer::NetworkState MEDIA_EXPORT PipelineErrorToNetworkState( | 26 blink::WebMediaPlayer::NetworkState MEDIA_BLINK_EXPORT |
27 PipelineStatus error); | 27 PipelineErrorToNetworkState(PipelineStatus error); |
28 | 28 |
29 // Report various metrics to UMA and RAPPOR. | 29 // Report various metrics to UMA and RAPPOR. |
30 void MEDIA_EXPORT ReportMetrics(blink::WebMediaPlayer::LoadType load_type, | 30 void MEDIA_BLINK_EXPORT ReportMetrics(blink::WebMediaPlayer::LoadType load_type, |
31 const GURL& url, | 31 const GURL& url, |
32 const GURL& origin_url); | 32 const GURL& origin_url); |
33 | 33 |
34 // Record a RAPPOR metric for the origin of an HLS playback. | 34 // Record a RAPPOR metric for the origin of an HLS playback. |
35 void MEDIA_EXPORT RecordOriginOfHLSPlayback(const GURL& origin_url); | 35 void MEDIA_BLINK_EXPORT RecordOriginOfHLSPlayback(const GURL& origin_url); |
36 | 36 |
37 // Convert Initialization Data Types. | 37 // Convert Initialization Data Types. |
38 EmeInitDataType MEDIA_EXPORT | 38 EmeInitDataType MEDIA_BLINK_EXPORT |
39 ConvertToEmeInitDataType(blink::WebEncryptedMediaInitDataType init_data_type); | 39 ConvertToEmeInitDataType(blink::WebEncryptedMediaInitDataType init_data_type); |
40 blink::WebEncryptedMediaInitDataType MEDIA_EXPORT | 40 blink::WebEncryptedMediaInitDataType MEDIA_BLINK_EXPORT |
41 ConvertToWebInitDataType(EmeInitDataType init_data_type); | 41 ConvertToWebInitDataType(EmeInitDataType init_data_type); |
42 | 42 |
43 typedef blink::WebCallbacks<void, blink::WebSetSinkIdError*> WebSetSinkIdCB; | 43 typedef blink::WebCallbacks<void, blink::WebSetSinkIdError*> WebSetSinkIdCB; |
44 | 44 |
45 // Wraps a WebSetSinkIdCB into a media::SwitchOutputDeviceCB | 45 // Wraps a WebSetSinkIdCB into a media::SwitchOutputDeviceCB |
46 // and binds it to the current thread | 46 // and binds it to the current thread |
47 SwitchOutputDeviceCB MEDIA_EXPORT | 47 SwitchOutputDeviceCB MEDIA_BLINK_EXPORT |
48 ConvertToSwitchOutputDeviceCB(WebSetSinkIdCB* web_callbacks); | 48 ConvertToSwitchOutputDeviceCB(WebSetSinkIdCB* web_callbacks); |
49 | 49 |
50 } // namespace media | 50 } // namespace media |
51 | 51 |
52 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_UTIL_H_ | 52 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_UTIL_H_ |
OLD | NEW |