Rename InternalTextureManager to BitmapTextureManager

A new texture manager will be created for input by texture ID so this texture manager won't be the only one to handle internal (i.e. non-external) textures.

PiperOrigin-RevId: 525116460
This commit is contained in:
tofunmi 2023-04-18 13:18:25 +01:00 committed by Rohit Singh
parent c623b965c5
commit fae8111f59
2 changed files with 10 additions and 10 deletions

View File

@ -38,7 +38,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* <p>Public methods in this class can be called from any thread.
*/
@UnstableApi
/* package */ final class InternalTextureManager implements GlShaderProgram.InputListener {
/* package */ final class BitmapTextureManager implements GlShaderProgram.InputListener {
private final GlShaderProgram shaderProgram;
private final VideoFrameProcessingTaskExecutor videoFrameProcessingTaskExecutor;
// The queue holds all bitmaps with one or more frames pending to be sent downstream.
@ -55,12 +55,12 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
/**
* Creates a new instance.
*
* @param shaderProgram The {@link GlShaderProgram} for which this {@code InternalTextureManager}
* @param shaderProgram The {@link GlShaderProgram} for which this {@code BitmapTextureManager}
* will be set as the {@link GlShaderProgram.InputListener}.
* @param videoFrameProcessingTaskExecutor The {@link VideoFrameProcessingTaskExecutor} that the
* methods of this class run on.
*/
public InternalTextureManager(
public BitmapTextureManager(
GlShaderProgram shaderProgram,
VideoFrameProcessingTaskExecutor videoFrameProcessingTaskExecutor) {
this.shaderProgram = shaderProgram;

View File

@ -252,7 +252,7 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
private final EGLDisplay eglDisplay;
private final EGLContext eglContext;
private final VideoFrameProcessingTaskExecutor videoFrameProcessingTaskExecutor;
private @MonotonicNonNull InternalTextureManager inputInternalTextureManager;
private @MonotonicNonNull BitmapTextureManager inputBitmapTextureManager;
private @MonotonicNonNull ExternalTextureManager inputExternalTextureManager;
private final boolean releaseFramesAutomatically;
private final FinalShaderProgramWrapper finalShaderProgramWrapper;
@ -287,9 +287,9 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
(ExternalShaderProgram) inputShaderProgram, videoFrameProcessingTaskExecutor);
inputShaderProgram.setInputListener(inputExternalTextureManager);
} else {
inputInternalTextureManager =
new InternalTextureManager(inputShaderProgram, videoFrameProcessingTaskExecutor);
inputShaderProgram.setInputListener(inputInternalTextureManager);
inputBitmapTextureManager =
new BitmapTextureManager(inputShaderProgram, videoFrameProcessingTaskExecutor);
inputShaderProgram.setInputListener(inputBitmapTextureManager);
}
finalShaderProgramWrapper = (FinalShaderProgramWrapper) getLast(shaderPrograms);
@ -323,7 +323,7 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
@Override
public void queueInputBitmap(Bitmap inputBitmap, long durationUs, float frameRate) {
checkNotNull(inputInternalTextureManager)
checkNotNull(inputBitmapTextureManager)
.queueInputBitmap(inputBitmap, durationUs, frameRate, /* useHdr= */ false);
}
@ -369,8 +369,8 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
public void signalEndOfInput() {
checkState(!inputStreamEnded);
inputStreamEnded = true;
if (inputInternalTextureManager != null) {
videoFrameProcessingTaskExecutor.submit(inputInternalTextureManager::signalEndOfInput);
if (inputBitmapTextureManager != null) {
videoFrameProcessingTaskExecutor.submit(inputBitmapTextureManager::signalEndOfInput);
}
if (inputExternalTextureManager != null) {
videoFrameProcessingTaskExecutor.submit(inputExternalTextureManager::signalEndOfInput);