diff options
| author | Teng-Hui Zhu <ztenghui@google.com> | 2011-05-31 15:15:31 -0700 |
|---|---|---|
| committer | Teng-Hui Zhu <ztenghui@google.com> | 2011-06-01 13:42:46 -0700 |
| commit | 3fafd39d0776a15c3613795183043a2c28277691 (patch) | |
| tree | 2362b19c6829a0ccff61f49e7a0ebe658fe4243f /core/java/android/webkit/HTML5VideoViewProxy.java | |
| parent | 2978cef0a77550ea3a364ffbf42fc43f2029070e (diff) | |
The screen shot support for inline video on Java side
Basically, the GL texture bound with Surface Texture is not a singleton any
more. And the Surface Texture will be recreated every time a new video starts.
This can help to recycle the decoder's memory while using the GL texture to
show the screen shot.
The corresponding webkit change is: 112500
Change-Id: I3c35f6a0abc70b9039c316ca82b236c797d81c7e
Diffstat (limited to 'core/java/android/webkit/HTML5VideoViewProxy.java')
| -rw-r--r-- | core/java/android/webkit/HTML5VideoViewProxy.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/core/java/android/webkit/HTML5VideoViewProxy.java b/core/java/android/webkit/HTML5VideoViewProxy.java index 7d8669bffe7f..aa254d9d4353 100644 --- a/core/java/android/webkit/HTML5VideoViewProxy.java +++ b/core/java/android/webkit/HTML5VideoViewProxy.java @@ -106,12 +106,14 @@ class HTML5VideoViewProxy extends Handler public static void setBaseLayer(int layer) { // Don't do this for full screen mode. if (mHTML5VideoView != null - && !mHTML5VideoView.isFullScreenMode()) { + && !mHTML5VideoView.isFullScreenMode() + && !mHTML5VideoView.surfaceTextureDeleted()) { mBaseLayer = layer; - SurfaceTexture surfTexture = mHTML5VideoView.getSurfaceTexture(); - int textureName = mHTML5VideoView.getTextureName(); int currentVideoLayerId = mHTML5VideoView.getVideoLayerId(); + SurfaceTexture surfTexture = mHTML5VideoView.getSurfaceTexture(currentVideoLayerId); + int textureName = mHTML5VideoView.getTextureName(); + if (layer != 0 && surfTexture != null && currentVideoLayerId != -1) { int playerState = mHTML5VideoView.getCurrentState(); if (mHTML5VideoView.getPlayerBuffering()) @@ -177,8 +179,8 @@ class HTML5VideoViewProxy extends Handler } if (backFromFullScreenMode - || currentVideoLayerId != videoLayerId - || mHTML5VideoView.getSurfaceTexture() == null) { + || currentVideoLayerId != videoLayerId + || mHTML5VideoView.surfaceTextureDeleted()) { // Here, we handle the case when switching to a new video, // either inside a WebView or across WebViews // For switching videos within a WebView or across the WebView, |
