Commit 0ac262c4 by huangdarwin Committed by kim-vde

Misc refactoring.

Use @VisibleForTesting and add some comments for GL code.

Refactoring change only. No functional changes intended

PiperOrigin-RevId: 412428196
parent dbec03b5
......@@ -27,6 +27,7 @@ import androidx.annotation.CheckResult;
import androidx.annotation.GuardedBy;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.VisibleForTesting;
import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.Format;
import com.google.android.exoplayer2.util.Log;
......@@ -105,11 +106,8 @@ public final class MediaCodecUtil {
}
}
/**
* Clears the codec cache.
*
* <p>This method should only be called in tests.
*/
/* Clears the codec cache.*/
@VisibleForTesting
public static synchronized void clearDecoderInfoCache() {
decoderInfosCache.clear();
}
......
......@@ -176,7 +176,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
checkGlError();
// Render.
GLES20.glDrawArrays(meshData.drawMode, 0, meshData.vertexCount);
GLES20.glDrawArrays(meshData.drawMode, /* first= */ 0, meshData.vertexCount);
checkGlError();
GLES20.glDisableVertexAttribArray(positionHandle);
......
......@@ -143,7 +143,7 @@ import java.io.IOException;
inputSurfaceTexture.getTransformMatrix(textureTransformMatrix);
copyProgram.setFloatsUniform("tex_transform", textureTransformMatrix);
copyProgram.bindAttributesAndUniforms();
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, /* first= */ 0, /* count= */ 4);
long surfaceTextureTimestampNs = inputSurfaceTexture.getTimestamp();
EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, surfaceTextureTimestampNs);
EGL14.eglSwapBuffers(eglDisplay, eglSurface);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment