mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
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:
parent
c623b965c5
commit
fae8111f59
2 changed files with 10 additions and 10 deletions
|
|
@ -38,7 +38,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.
|
||||||
*/
|
*/
|
||||||
@UnstableApi
|
@UnstableApi
|
||||||
/* 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.
|
||||||
|
|
@ -55,12 +55,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;
|
||||||
|
|
@ -252,7 +252,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;
|
||||||
|
|
@ -287,9 +287,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);
|
||||||
|
|
@ -323,7 +323,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -369,8 +369,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);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue