Chromium Code Reviews| Index: webkit/media/android/webmediaplayer_android.cc |
| diff --git a/webkit/media/android/webmediaplayer_android.cc b/webkit/media/android/webmediaplayer_android.cc |
| index 5b00e5dbd3c31626a8eb0ff1563c1f33463dccee..adeb30661ccddb4bedcb55808d907ca9113bc5fc 100644 |
| --- a/webkit/media/android/webmediaplayer_android.cc |
| +++ b/webkit/media/android/webmediaplayer_android.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/files/file_path.h" |
| #include "base/logging.h" |
| #include "cc/layers/video_layer.h" |
| +#include "gpu/GLES2/gl2extchromium.h" |
| #include "media/base/android/media_player_bridge.h" |
| #include "media/base/video_frame.h" |
| #include "net/base/mime_util.h" |
| @@ -246,6 +247,32 @@ void WebMediaPlayerAndroid::paint(WebKit::WebCanvas* canvas, |
| NOTIMPLEMENTED(); |
| } |
| +bool WebMediaPlayerAndroid::copyVideoTextureToPlatformTexture( |
| + WebKit::WebGraphicsContext3D* web_graphics_context, |
| + unsigned int texture, |
| + unsigned int level, |
| + unsigned int internal_format, |
| + bool premultiply_alpha, |
| + bool flip_y) { |
| + // TODO(hkuang): Check if there is valid frame uploaded to the texture? |
| + uint32 source_texture = texture_id_; |
| + // The video is stored in a unmultiplied format, so premultiply |
|
fgalligan1
2013/04/04 20:38:10
nit: newline before //
hkuang
2013/04/04 22:56:45
Done.
|
| + // if necessary. |
| + web_graphics_context->pixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM, |
| + premultiply_alpha); |
|
fgalligan1
2013/04/04 20:38:10
nit: align to (
hkuang
2013/04/04 22:56:45
Done.
|
| + // Application itself needs to take care of setting the right flip_y |
| + // value down to get the expected result. |
| + // flip_y==true means to reverse the video orientation while |
| + // flip_y==false means to keep the intrinsic orientation. |
| + web_graphics_context->pixelStorei(GL_UNPACK_FLIP_Y_CHROMIUM, flip_y); |
| + web_graphics_context->copyTextureCHROMIUM(GL_TEXTURE_2D, |
| + source_texture, texture, level, internal_format); |
|
fgalligan1
2013/04/04 20:38:10
nit: align to (
hkuang
2013/04/04 22:56:45
Done.
|
| + web_graphics_context->pixelStorei(GL_UNPACK_FLIP_Y_CHROMIUM, false); |
| + web_graphics_context->pixelStorei(GL_UNPACK_PREMULTIPLY_ALPHA_CHROMIUM, |
| + false); |
|
fgalligan1
2013/04/04 20:38:10
nit: align to (
hkuang
2013/04/04 22:56:45
Done.
|
| + return true; |
| +} |
| + |
| bool WebMediaPlayerAndroid::hasSingleSecurityOrigin() const { |
| return false; |
| } |