diff --git a/library/common/src/main/java/com/google/android/exoplayer2/util/GlUtil.java b/library/common/src/main/java/com/google/android/exoplayer2/util/GlUtil.java index ca0968e823..1254bb3f99 100644 --- a/library/common/src/main/java/com/google/android/exoplayer2/util/GlUtil.java +++ b/library/common/src/main/java/com/google/android/exoplayer2/util/GlUtil.java @@ -255,7 +255,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. @@ -264,13 +264,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. @@ -278,10 +278,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); } /** @@ -659,18 +658,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/library/effect/src/main/java/com/google/android/exoplayer2/effect/FinalMatrixTextureProcessorWrapper.java b/library/effect/src/main/java/com/google/android/exoplayer2/effect/FinalMatrixTextureProcessorWrapper.java index 416a732d43..cd0c474e93 100644 --- a/library/effect/src/main/java/com/google/android/exoplayer2/effect/FinalMatrixTextureProcessorWrapper.java +++ b/library/effect/src/main/java/com/google/android/exoplayer2/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