OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "webkit/media/android/webmediaplayer_android.h" | 5 #include "webkit/media/android/webmediaplayer_android.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "cc/layers/video_layer.h" | 10 #include "cc/layers/video_layer.h" |
11 #include "gpu/GLES2/gl2extchromium.h" | |
11 #include "media/base/android/media_player_bridge.h" | 12 #include "media/base/android/media_player_bridge.h" |
12 #include "media/base/video_frame.h" | 13 #include "media/base/video_frame.h" |
13 #include "net/base/mime_util.h" | 14 #include "net/base/mime_util.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerClient. h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerClient. h" |
15 #include "webkit/compositor_bindings/web_layer_impl.h" | 16 #include "webkit/compositor_bindings/web_layer_impl.h" |
16 #include "webkit/media/android/webmediaplayer_manager_android.h" | 17 #include "webkit/media/android/webmediaplayer_manager_android.h" |
17 #include "webkit/media/media_switches.h" | 18 #include "webkit/media/media_switches.h" |
18 #include "webkit/media/webmediaplayer_util.h" | 19 #include "webkit/media/webmediaplayer_util.h" |
19 | 20 |
20 static const uint32 kGLTextureExternalOES = 0x8D65; | 21 static const uint32 kGLTextureExternalOES = 0x8D65; |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
239 | 240 |
240 void WebMediaPlayerAndroid::setSize(const WebKit::WebSize& size) { | 241 void WebMediaPlayerAndroid::setSize(const WebKit::WebSize& size) { |
241 } | 242 } |
242 | 243 |
243 void WebMediaPlayerAndroid::paint(WebKit::WebCanvas* canvas, | 244 void WebMediaPlayerAndroid::paint(WebKit::WebCanvas* canvas, |
244 const WebKit::WebRect& rect, | 245 const WebKit::WebRect& rect, |
245 uint8_t alpha) { | 246 uint8_t alpha) { |
246 NOTIMPLEMENTED(); | 247 NOTIMPLEMENTED(); |
247 } | 248 } |
248 | 249 |
250 bool WebMediaPlayerAndroid::copyVideoTextureToPlatformTexture( | |
251 WebKit::WebGraphicsContext3D* web_graphics_context, | |
252 unsigned int texture, | |
253 unsigned int level, | |
254 unsigned int internal_format, | |
255 bool premultiply_alpha, | |
256 bool flip_y) { | |
257 if (!texture_id_) return false; | |
scherkus (not reviewing)
2013/04/10 00:05:08
drop return to next line
hkuang1
2013/04/10 01:32:35
Done.
| |
258 | |
259 // The video is stored in a unmultiplied format, so premultiply if | |
260 // necessary. | |
261 web_graphics_context->pixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM, | |
262 premultiply_alpha); | |
scherkus (not reviewing)
2013/04/10 00:05:08
this should be aligned with (
hkuang1
2013/04/10 01:32:35
Done.
| |
263 | |
264 // Application itself needs to take care of setting the right flip_y | |
265 // value down to get the expected result. | |
266 // flip_y==true means to reverse the video orientation while | |
267 // flip_y==false means to keep the intrinsic orientation. | |
268 web_graphics_context->pixelStorei(GL_UNPACK_FLIP_Y_CHROMIUM, flip_y); | |
269 web_graphics_context->copyTextureCHROMIUM(GL_TEXTURE_2D, texture_id_, | |
270 texture, level, internal_format); | |
271 web_graphics_context->pixelStorei(GL_UNPACK_FLIP_Y_CHROMIUM, false); | |
272 web_graphics_context->pixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM, | |
273 false); | |
274 return true; | |
275 } | |
276 | |
249 bool WebMediaPlayerAndroid::hasSingleSecurityOrigin() const { | 277 bool WebMediaPlayerAndroid::hasSingleSecurityOrigin() const { |
250 return false; | 278 return false; |
251 } | 279 } |
252 | 280 |
253 bool WebMediaPlayerAndroid::didPassCORSAccessCheck() const { | 281 bool WebMediaPlayerAndroid::didPassCORSAccessCheck() const { |
254 return false; | 282 return false; |
255 } | 283 } |
256 | 284 |
257 WebMediaPlayer::MovieLoadType WebMediaPlayerAndroid::movieLoadType() const { | 285 WebMediaPlayer::MovieLoadType WebMediaPlayerAndroid::movieLoadType() const { |
258 // Deprecated. | 286 // Deprecated. |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
474 | 502 |
475 void WebMediaPlayerAndroid::SetNeedsEstablishPeer(bool needs_establish_peer) { | 503 void WebMediaPlayerAndroid::SetNeedsEstablishPeer(bool needs_establish_peer) { |
476 needs_establish_peer_ = needs_establish_peer; | 504 needs_establish_peer_ = needs_establish_peer; |
477 } | 505 } |
478 | 506 |
479 void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) { | 507 void WebMediaPlayerAndroid::UpdatePlayingState(bool is_playing) { |
480 is_playing_ = is_playing; | 508 is_playing_ = is_playing; |
481 } | 509 } |
482 | 510 |
483 } // namespace webkit_media | 511 } // namespace webkit_media |
OLD | NEW |