From 1c82884e315ea4223ce33a746d1f6f106ec29bae Mon Sep 17 00:00:00 2001 From: sakal Date: Wed, 23 Nov 2016 06:12:26 -0800 Subject: [PATCH] Remove binding framebuffer from GlTextureFrameBuffer.setSize. There shouldn't be a need to bind the framebuffer to modify the texture size. Binding the framebuffer causes a crash on Samsung Galaxy S3 mini for some reason. BUG=webrtc:6470 Review-Url: https://codereview.webrtc.org/2524003002 Cr-Commit-Position: refs/heads/master@{#15210} --- .../java/src/org/webrtc/GlTextureFrameBuffer.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/webrtc/api/android/java/src/org/webrtc/GlTextureFrameBuffer.java b/webrtc/api/android/java/src/org/webrtc/GlTextureFrameBuffer.java index f1b13bee58..7e65acefdc 100644 --- a/webrtc/api/android/java/src/org/webrtc/GlTextureFrameBuffer.java +++ b/webrtc/api/android/java/src/org/webrtc/GlTextureFrameBuffer.java @@ -75,25 +75,13 @@ public class GlTextureFrameBuffer { this.width = width; this.height = height; - // Bind our framebuffer. - GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, frameBufferId); - GlUtil.checkNoGLES2Error("glBindFramebuffer"); - // Allocate texture. GLES20.glActiveTexture(GLES20.GL_TEXTURE0); GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureId); GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, pixelFormat, width, height, 0, pixelFormat, GLES20.GL_UNSIGNED_BYTE, null); - - // Check that the framebuffer is in a good state. - final int status = GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER); - if (status != GLES20.GL_FRAMEBUFFER_COMPLETE) { - throw new IllegalStateException("Framebuffer not complete, status: " + status); - } - - // Restore normal framebuffer. - GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0); GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0); + GlUtil.checkNoGLES2Error("GlTextureFrameBuffer setSize"); } public int getWidth() {