Commit 75583371 by tofunmi Committed by Rohit Singh

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
parent 6f2051b3
...@@ -36,7 +36,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -36,7 +36,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* *
* <p>Public methods in this class can be called from any thread. * <p>Public methods in this class can be called from any thread.
*/ */
/* package */ final class InternalTextureManager implements GlShaderProgram.InputListener { /* package */ final class BitmapTextureManager implements GlShaderProgram.InputListener {
private final GlShaderProgram shaderProgram; private final GlShaderProgram shaderProgram;
private final VideoFrameProcessingTaskExecutor videoFrameProcessingTaskExecutor; private final VideoFrameProcessingTaskExecutor videoFrameProcessingTaskExecutor;
// The queue holds all bitmaps with one or more frames pending to be sent downstream. // The queue holds all bitmaps with one or more frames pending to be sent downstream.
...@@ -53,12 +53,12 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -53,12 +53,12 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
/** /**
* Creates a new instance. * 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}. * will be set as the {@link GlShaderProgram.InputListener}.
* @param videoFrameProcessingTaskExecutor The {@link VideoFrameProcessingTaskExecutor} that the * @param videoFrameProcessingTaskExecutor The {@link VideoFrameProcessingTaskExecutor} that the
* methods of this class run on. * methods of this class run on.
*/ */
public InternalTextureManager( public BitmapTextureManager(
GlShaderProgram shaderProgram, GlShaderProgram shaderProgram,
VideoFrameProcessingTaskExecutor videoFrameProcessingTaskExecutor) { VideoFrameProcessingTaskExecutor videoFrameProcessingTaskExecutor) {
this.shaderProgram = shaderProgram; this.shaderProgram = shaderProgram;
......
...@@ -250,7 +250,7 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor { ...@@ -250,7 +250,7 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
private final EGLDisplay eglDisplay; private final EGLDisplay eglDisplay;
private final EGLContext eglContext; private final EGLContext eglContext;
private final VideoFrameProcessingTaskExecutor videoFrameProcessingTaskExecutor; private final VideoFrameProcessingTaskExecutor videoFrameProcessingTaskExecutor;
private @MonotonicNonNull InternalTextureManager inputInternalTextureManager; private @MonotonicNonNull BitmapTextureManager inputBitmapTextureManager;
private @MonotonicNonNull ExternalTextureManager inputExternalTextureManager; private @MonotonicNonNull ExternalTextureManager inputExternalTextureManager;
private final boolean releaseFramesAutomatically; private final boolean releaseFramesAutomatically;
private final FinalShaderProgramWrapper finalShaderProgramWrapper; private final FinalShaderProgramWrapper finalShaderProgramWrapper;
...@@ -285,9 +285,9 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor { ...@@ -285,9 +285,9 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
(ExternalShaderProgram) inputShaderProgram, videoFrameProcessingTaskExecutor); (ExternalShaderProgram) inputShaderProgram, videoFrameProcessingTaskExecutor);
inputShaderProgram.setInputListener(inputExternalTextureManager); inputShaderProgram.setInputListener(inputExternalTextureManager);
} else { } else {
inputInternalTextureManager = inputBitmapTextureManager =
new InternalTextureManager(inputShaderProgram, videoFrameProcessingTaskExecutor); new BitmapTextureManager(inputShaderProgram, videoFrameProcessingTaskExecutor);
inputShaderProgram.setInputListener(inputInternalTextureManager); inputShaderProgram.setInputListener(inputBitmapTextureManager);
} }
finalShaderProgramWrapper = (FinalShaderProgramWrapper) getLast(shaderPrograms); finalShaderProgramWrapper = (FinalShaderProgramWrapper) getLast(shaderPrograms);
...@@ -321,7 +321,7 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor { ...@@ -321,7 +321,7 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
@Override @Override
public void queueInputBitmap(Bitmap inputBitmap, long durationUs, float frameRate) { public void queueInputBitmap(Bitmap inputBitmap, long durationUs, float frameRate) {
checkNotNull(inputInternalTextureManager) checkNotNull(inputBitmapTextureManager)
.queueInputBitmap(inputBitmap, durationUs, frameRate, /* useHdr= */ false); .queueInputBitmap(inputBitmap, durationUs, frameRate, /* useHdr= */ false);
} }
...@@ -367,8 +367,8 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor { ...@@ -367,8 +367,8 @@ public final class DefaultVideoFrameProcessor implements VideoFrameProcessor {
public void signalEndOfInput() { public void signalEndOfInput() {
checkState(!inputStreamEnded); checkState(!inputStreamEnded);
inputStreamEnded = true; inputStreamEnded = true;
if (inputInternalTextureManager != null) { if (inputBitmapTextureManager != null) {
videoFrameProcessingTaskExecutor.submit(inputInternalTextureManager::signalEndOfInput); videoFrameProcessingTaskExecutor.submit(inputBitmapTextureManager::signalEndOfInput);
} }
if (inputExternalTextureManager != null) { if (inputExternalTextureManager != null) {
videoFrameProcessingTaskExecutor.submit(inputExternalTextureManager::signalEndOfInput); videoFrameProcessingTaskExecutor.submit(inputExternalTextureManager::signalEndOfInput);
......
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