Merge "Create GL texture when it is missing for video layer" into ics-mr1

This commit is contained in:
Teng-Hui Zhu
2011-11-03 11:43:16 -07:00
committed by Android (Google) Code Review

View File

@@ -74,11 +74,13 @@ public class HTML5VideoInline extends HTML5VideoView{
public SurfaceTexture getSurfaceTexture(int videoLayerId) {
// Create the surface texture.
if (videoLayerId != mVideoLayerUsingSurfaceTexture
|| mSurfaceTexture == null) {
if (mTextureNames == null) {
mTextureNames = new int[1];
GLES20.glGenTextures(1, mTextureNames, 0);
|| mSurfaceTexture == null
|| mTextureNames == null) {
if (mTextureNames != null) {
GLES20.glDeleteTextures(1, mTextureNames, 0);
}
mTextureNames = new int[1];
GLES20.glGenTextures(1, mTextureNames, 0);
mSurfaceTexture = new SurfaceTexture(mTextureNames[0]);
}
mVideoLayerUsingSurfaceTexture = videoLayerId;