mirror of
https://github.com/androidx/media.git
synced 2025-05-14 19:19:58 +08:00
GL: Update exoplayer to use bindTexture.
Refactoring change only. PiperOrigin-RevId: 446475708
This commit is contained in:
parent
e62338e871
commit
3730c1e4d4
@ -462,7 +462,7 @@ public final class GlUtil {
|
||||
* GLES20#GL_TEXTURE_2D} for a two-dimensional texture or {@link
|
||||
* GLES11Ext#GL_TEXTURE_EXTERNAL_OES} for an external texture.
|
||||
*/
|
||||
/* package */ static void bindTexture(int textureTarget, int texId) {
|
||||
public static void bindTexture(int textureTarget, int texId) {
|
||||
GLES20.glBindTexture(textureTarget, texId);
|
||||
checkGlError();
|
||||
GLES20.glTexParameteri(textureTarget, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
|
||||
|
@ -298,19 +298,11 @@ public final class VideoDecoderGLSurfaceView extends GLSurfaceView
|
||||
|
||||
@RequiresNonNull("program")
|
||||
private void setupTextures() {
|
||||
GLES20.glGenTextures(3, yuvTextures, /* offset= */ 0);
|
||||
GLES20.glGenTextures(/* n= */ 3, yuvTextures, /* offset= */ 0);
|
||||
for (int i = 0; i < 3; i++) {
|
||||
GLES20.glUniform1i(program.getUniformLocation(TEXTURE_UNIFORMS[i]), i);
|
||||
GLES20.glActiveTexture(GLES20.GL_TEXTURE0 + i);
|
||||
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, yuvTextures[i]);
|
||||
GLES20.glTexParameterf(
|
||||
GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
|
||||
GLES20.glTexParameterf(
|
||||
GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
|
||||
GLES20.glTexParameterf(
|
||||
GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
|
||||
GLES20.glTexParameterf(
|
||||
GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
|
||||
GlUtil.bindTexture(GLES20.GL_TEXTURE_2D, yuvTextures[i]);
|
||||
}
|
||||
GlUtil.checkGlError();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user