mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
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:
parent
dbec03b543
commit
0ac262c472
3 changed files with 5 additions and 7 deletions
|
|
@ -27,6 +27,7 @@ import androidx.annotation.CheckResult;
|
||||||
import androidx.annotation.GuardedBy;
|
import androidx.annotation.GuardedBy;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.annotation.RequiresApi;
|
import androidx.annotation.RequiresApi;
|
||||||
|
import androidx.annotation.VisibleForTesting;
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.Format;
|
import com.google.android.exoplayer2.Format;
|
||||||
import com.google.android.exoplayer2.util.Log;
|
import com.google.android.exoplayer2.util.Log;
|
||||||
|
|
@ -105,11 +106,8 @@ public final class MediaCodecUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/* Clears the codec cache.*/
|
||||||
* Clears the codec cache.
|
@VisibleForTesting
|
||||||
*
|
|
||||||
* <p>This method should only be called in tests.
|
|
||||||
*/
|
|
||||||
public static synchronized void clearDecoderInfoCache() {
|
public static synchronized void clearDecoderInfoCache() {
|
||||||
decoderInfosCache.clear();
|
decoderInfosCache.clear();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -176,7 +176,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||||
checkGlError();
|
checkGlError();
|
||||||
|
|
||||||
// Render.
|
// Render.
|
||||||
GLES20.glDrawArrays(meshData.drawMode, 0, meshData.vertexCount);
|
GLES20.glDrawArrays(meshData.drawMode, /* first= */ 0, meshData.vertexCount);
|
||||||
checkGlError();
|
checkGlError();
|
||||||
|
|
||||||
GLES20.glDisableVertexAttribArray(positionHandle);
|
GLES20.glDisableVertexAttribArray(positionHandle);
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ import java.io.IOException;
|
||||||
inputSurfaceTexture.getTransformMatrix(textureTransformMatrix);
|
inputSurfaceTexture.getTransformMatrix(textureTransformMatrix);
|
||||||
copyProgram.setFloatsUniform("tex_transform", textureTransformMatrix);
|
copyProgram.setFloatsUniform("tex_transform", textureTransformMatrix);
|
||||||
copyProgram.bindAttributesAndUniforms();
|
copyProgram.bindAttributesAndUniforms();
|
||||||
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
|
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, /* first= */ 0, /* count= */ 4);
|
||||||
long surfaceTextureTimestampNs = inputSurfaceTexture.getTimestamp();
|
long surfaceTextureTimestampNs = inputSurfaceTexture.getTimestamp();
|
||||||
EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, surfaceTextureTimestampNs);
|
EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, surfaceTextureTimestampNs);
|
||||||
EGL14.eglSwapBuffers(eglDisplay, eglSurface);
|
EGL14.eglSwapBuffers(eglDisplay, eglSurface);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue