Skip to content

Commit 337b7f7

Browse files
dway123icbaker
authored andcommitted
GL: Update exoplayer to use bindTexture.
Refactoring change only. PiperOrigin-RevId: 446475708
1 parent c8c7ec6 commit 337b7f7

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

Diff for: libraries/common/src/main/java/androidx/media3/common/util/GlUtil.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ private static int generateTexture() {
463463
* GLES20#GL_TEXTURE_2D} for a two-dimensional texture or {@link
464464
* GLES11Ext#GL_TEXTURE_EXTERNAL_OES} for an external texture.
465465
*/
466-
/* package */ static void bindTexture(int textureTarget, int texId) {
466+
public static void bindTexture(int textureTarget, int texId) {
467467
GLES20.glBindTexture(textureTarget, texId);
468468
checkGlError();
469469
GLES20.glTexParameteri(textureTarget, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);

Diff for: libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/VideoDecoderGLSurfaceView.java

+2-10
Original file line numberDiff line numberDiff line change
@@ -300,19 +300,11 @@ public void setOutputBuffer(VideoDecoderOutputBuffer outputBuffer) {
300300

301301
@RequiresNonNull("program")
302302
private void setupTextures() {
303-
GLES20.glGenTextures(3, yuvTextures, /* offset= */ 0);
303+
GLES20.glGenTextures(/* n= */ 3, yuvTextures, /* offset= */ 0);
304304
for (int i = 0; i < 3; i++) {
305305
GLES20.glUniform1i(program.getUniformLocation(TEXTURE_UNIFORMS[i]), i);
306306
GLES20.glActiveTexture(GLES20.GL_TEXTURE0 + i);
307-
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, yuvTextures[i]);
308-
GLES20.glTexParameterf(
309-
GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
310-
GLES20.glTexParameterf(
311-
GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
312-
GLES20.glTexParameterf(
313-
GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
314-
GLES20.glTexParameterf(
315-
GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
307+
GlUtil.bindTexture(GLES20.GL_TEXTURE_2D, yuvTextures[i]);
316308
}
317309
GlUtil.checkGlError();
318310
}

0 commit comments

Comments
 (0)