Misc refactoring.

Use @VisibleForTesting and add some comments for GL code.

Refactoring change only. No functional changes intended

PiperOrigin-RevId: 412428196
This commit is contained in:
huangdarwin 2021-11-26 12:54:50 +00:00 committed by kim-vde
parent dbec03b543
commit 0ac262c472
3 changed files with 5 additions and 7 deletions

View file

@ -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();
}

View file

@ -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);

View file

@ -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);