Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Unified Diff: talk/app/webrtc/java/src/org/webrtc/MediaCodecVideoDecoder.java

Issue 1303373005: Android GlUtil: Add helper functions generateTexture/deleteTexture (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698