diff --git a/libraries/common/src/main/java/androidx/media3/common/util/GlUtil.java b/libraries/common/src/main/java/androidx/media3/common/util/GlUtil.java index 128f708d29..6737b2f37d 100644 --- a/libraries/common/src/main/java/androidx/media3/common/util/GlUtil.java +++ b/libraries/common/src/main/java/androidx/media3/common/util/GlUtil.java @@ -256,7 +256,7 @@ public final class GlUtil { } /** - * Returns a new {@link EGLSurface} wrapping the specified {@code surface}. + * Creates a new {@link EGLSurface} wrapping the specified {@code surface}. * *
The {@link EGLSurface} will configure with {@link #EGL_CONFIG_ATTRIBUTES_RGBA_8888} and * OpenGL ES 2.0. @@ -265,13 +265,13 @@ public final class GlUtil { * @param surface The surface to wrap; must be a surface, surface texture or surface holder. */ @RequiresApi(17) - public static EGLSurface getEglSurface(EGLDisplay eglDisplay, Object surface) throws GlException { - return Api17.getEglSurface( - eglDisplay, surface, EGL_CONFIG_ATTRIBUTES_RGBA_8888, EGL_WINDOW_SURFACE_ATTRIBUTES_NONE); + public static EGLSurface createEglSurface(EGLDisplay eglDisplay, Object surface) + throws GlException { + return Api17.createEglSurface(eglDisplay, surface, EGL_CONFIG_ATTRIBUTES_RGBA_8888); } /** - * Returns a new {@link EGLSurface} wrapping the specified {@code surface}. + * Creates a new {@link EGLSurface} wrapping the specified {@code surface}. * * @param eglDisplay The {@link EGLDisplay} to attach the surface to. * @param surface The surface to wrap; must be a surface, surface texture or surface holder. @@ -279,10 +279,9 @@ public final class GlUtil { * #EGL_CONFIG_ATTRIBUTES_RGBA_1010102} and {@link #EGL_CONFIG_ATTRIBUTES_RGBA_8888}. */ @RequiresApi(17) - public static EGLSurface getEglSurface( + public static EGLSurface createEglSurface( EGLDisplay eglDisplay, Object surface, int[] configAttributes) throws GlException { - return Api17.getEglSurface( - eglDisplay, surface, configAttributes, EGL_WINDOW_SURFACE_ATTRIBUTES_NONE); + return Api17.createEglSurface(eglDisplay, surface, configAttributes); } /** @@ -660,18 +659,14 @@ public final class GlUtil { } @DoNotInline - public static EGLSurface getEglSurface( - EGLDisplay eglDisplay, - Object surface, - int[] configAttributes, - int[] windowSurfaceAttributes) - throws GlException { + public static EGLSurface createEglSurface( + EGLDisplay eglDisplay, Object surface, int[] configAttributes) throws GlException { EGLSurface eglSurface = EGL14.eglCreateWindowSurface( eglDisplay, getEglConfig(eglDisplay, configAttributes), surface, - windowSurfaceAttributes, + EGL_WINDOW_SURFACE_ATTRIBUTES_NONE, /* offset= */ 0); checkEglException("Error creating surface"); return eglSurface; diff --git a/libraries/effect/src/main/java/androidx/media3/effect/FinalMatrixTextureProcessorWrapper.java b/libraries/effect/src/main/java/androidx/media3/effect/FinalMatrixTextureProcessorWrapper.java index 32ed0ae836..2f3125606d 100644 --- a/libraries/effect/src/main/java/androidx/media3/effect/FinalMatrixTextureProcessorWrapper.java +++ b/libraries/effect/src/main/java/androidx/media3/effect/FinalMatrixTextureProcessorWrapper.java @@ -317,7 +317,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; boolean colorInfoIsHdr = ColorInfo.isTransferHdr(colorInfo); outputEglSurface = - GlUtil.getEglSurface( + GlUtil.createEglSurface( eglDisplay, outputSurfaceInfo.surface, colorInfoIsHdr @@ -445,7 +445,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; if (eglSurface == null) { eglSurface = - GlUtil.getEglSurface( + GlUtil.createEglSurface( eglDisplay, surface, useHdr