Index: talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoDecoder.java |
diff --git a/talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoDecoder.java b/talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoDecoder.java |
index 17e98b7a48bff0c995fcab965d2cee551d39aba3..a5d7b7fe78785c0b156ebfb3e64f285e0b459bc3 100644 |
--- a/talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoDecoder.java |
+++ b/talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoDecoder.java |
@@ -225,22 +225,7 @@ public class MediaCodecVideoDecoder { |
eglBase.makeCurrent(); |
// Create output surface |
- int[] textures = new int[1]; |
- GLES20.glGenTextures(1, textures, 0); |
- GlUtil.checkNoGLES2Error("glGenTextures"); |
- textureID = textures[0]; |
- GLES20.glBindTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, textureID); |
- GlUtil.checkNoGLES2Error("glBindTexture mTextureID"); |
- |
- GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, |
- GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST); |
- GLES20.glTexParameterf(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, |
- GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR); |
- GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, |
- GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE); |
- GLES20.glTexParameteri(GLES11Ext.GL_TEXTURE_EXTERNAL_OES, |
- GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE); |
- GlUtil.checkNoGLES2Error("glTexParameter"); |
+ textureID = GlUtil.generateTexture(GLES11Ext.GL_TEXTURE_EXTERNAL_OES); |
Log.d(TAG, "Video decoder TextureID = " + textureID); |
surfaceTexture = new SurfaceTexture(textureID); |
surface = new Surface(surfaceTexture); |
@@ -285,11 +270,9 @@ public class MediaCodecVideoDecoder { |
if (useSurface) { |
surface.release(); |
if (textureID >= 0) { |
- int[] textures = new int[1]; |
- textures[0] = textureID; |
Log.d(TAG, "Delete video decoder TextureID " + textureID); |
- GLES20.glDeleteTextures(1, textures, 0); |
- GlUtil.checkNoGLES2Error("glDeleteTextures"); |
+ GlUtil.deleteTexture(textureID); |
+ textureID = -1; |
} |
eglBase.release(); |
eglBase = null; |