| 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 #include "content/renderer/media/android/webmediaplayer_android.h" | 5 #include "content/renderer/media/android/webmediaplayer_android.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
| 13 #include "cc/layers/video_layer.h" | 13 #include "cc/layers/video_layer.h" |
| 14 #include "content/renderer/media/android/proxy_media_keys.h" | 14 #include "content/renderer/media/android/proxy_media_keys.h" |
| 15 #include "content/renderer/media/android/webmediaplayer_manager_android.h" | 15 #include "content/renderer/media/android/webmediaplayer_manager_android.h" |
| 16 #include "content/renderer/media/android/webmediaplayer_proxy_android.h" | 16 #include "content/renderer/media/android/webmediaplayer_proxy_android.h" |
| 17 #include "content/renderer/media/webmediaplayer_delegate.h" |
| 18 #include "content/renderer/media/webmediaplayer_util.h" |
| 17 #include "gpu/GLES2/gl2extchromium.h" | 19 #include "gpu/GLES2/gl2extchromium.h" |
| 18 #include "media/base/android/media_player_android.h" | 20 #include "media/base/android/media_player_android.h" |
| 19 #include "media/base/bind_to_loop.h" | 21 #include "media/base/bind_to_loop.h" |
| 20 #include "media/base/media_switches.h" | 22 #include "media/base/media_switches.h" |
| 21 #include "media/base/video_frame.h" | 23 #include "media/base/video_frame.h" |
| 22 #include "net/base/mime_util.h" | 24 #include "net/base/mime_util.h" |
| 23 #include "third_party/WebKit/public/platform/WebString.h" | 25 #include "third_party/WebKit/public/platform/WebString.h" |
| 24 #include "third_party/WebKit/public/web/WebDocument.h" | 26 #include "third_party/WebKit/public/web/WebDocument.h" |
| 25 #include "third_party/WebKit/public/web/WebFrame.h" | 27 #include "third_party/WebKit/public/web/WebFrame.h" |
| 26 #include "third_party/WebKit/public/web/WebMediaPlayerClient.h" | 28 #include "third_party/WebKit/public/web/WebMediaPlayerClient.h" |
| 27 #include "third_party/WebKit/public/web/WebMediaSource.h" | 29 #include "third_party/WebKit/public/web/WebMediaSource.h" |
| 28 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 30 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
| 29 #include "third_party/WebKit/public/web/WebView.h" | 31 #include "third_party/WebKit/public/web/WebView.h" |
| 30 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" | 32 #include "webkit/renderer/compositor_bindings/web_layer_impl.h" |
| 31 #include "webkit/renderer/media/crypto/key_systems.h" | 33 #include "webkit/renderer/media/crypto/key_systems.h" |
| 32 #include "webkit/renderer/media/webmediaplayer_delegate.h" | |
| 33 #include "webkit/renderer/media/webmediaplayer_util.h" | |
| 34 | 34 |
| 35 #if defined(GOOGLE_TV) | 35 #if defined(GOOGLE_TV) |
| 36 #include "webkit/renderer/media/media_stream_audio_renderer.h" | 36 #include "content/renderer/media/media_stream_audio_renderer.h" |
| 37 #include "webkit/renderer/media/media_stream_client.h" | 37 #include "content/renderer/media/media_stream_client.h" |
| 38 #endif | 38 #endif |
| 39 | 39 |
| 40 static const uint32 kGLTextureExternalOES = 0x8D65; | 40 static const uint32 kGLTextureExternalOES = 0x8D65; |
| 41 | 41 |
| 42 using WebKit::WebMediaPlayer; | 42 using WebKit::WebMediaPlayer; |
| 43 using WebKit::WebMediaSource; | 43 using WebKit::WebMediaSource; |
| 44 using WebKit::WebSize; | 44 using WebKit::WebSize; |
| 45 using WebKit::WebString; | 45 using WebKit::WebString; |
| 46 using WebKit::WebTimeRanges; | 46 using WebKit::WebTimeRanges; |
| 47 using WebKit::WebURL; | 47 using WebKit::WebURL; |
| 48 using media::MediaPlayerAndroid; | 48 using media::MediaPlayerAndroid; |
| 49 using media::VideoFrame; | 49 using media::VideoFrame; |
| 50 using webkit_media::ConvertSecondsToTimestamp; | |
| 51 using webkit_media::IsSupportedKeySystem; | |
| 52 using webkit_media::KeySystemNameForUMA; | |
| 53 using webkit_media::ProxyDecryptor; | |
| 54 using webkit_media::WebMediaPlayerDelegate; | |
| 55 | 50 |
| 56 namespace { | 51 namespace { |
| 57 // Prefix for histograms related to Encrypted Media Extensions. | 52 // Prefix for histograms related to Encrypted Media Extensions. |
| 58 const char* kMediaEme = "Media.EME."; | 53 const char* kMediaEme = "Media.EME."; |
| 59 } // namespace | 54 } // namespace |
| 60 | 55 |
| 61 namespace content { | 56 namespace content { |
| 62 | 57 |
| 63 #define BIND_TO_RENDER_LOOP(function) \ | 58 #define BIND_TO_RENDER_LOOP(function) \ |
| 64 media::BindToLoop(main_loop_, base::Bind(function, AsWeakPtr())) | 59 media::BindToLoop(main_loop_, base::Bind(function, AsWeakPtr())) |
| (...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1149 | 1144 |
| 1150 void WebMediaPlayerAndroid::exitFullscreen() { | 1145 void WebMediaPlayerAndroid::exitFullscreen() { |
| 1151 proxy_->ExitFullscreen(player_id_); | 1146 proxy_->ExitFullscreen(player_id_); |
| 1152 } | 1147 } |
| 1153 | 1148 |
| 1154 bool WebMediaPlayerAndroid::canEnterFullscreen() const { | 1149 bool WebMediaPlayerAndroid::canEnterFullscreen() const { |
| 1155 return manager_->CanEnterFullscreen(frame_); | 1150 return manager_->CanEnterFullscreen(frame_); |
| 1156 } | 1151 } |
| 1157 | 1152 |
| 1158 } // namespace content | 1153 } // namespace content |
| OLD | NEW |