Effect: Move common statement out of switch/case

PiperOrigin-RevId: 570323141
This commit is contained in:
huangdarwin 2023-10-03 02:35:09 -07:00 committed by Copybara-Service
parent 8953f26a5c
commit fa51f8cd4d

View file

@ -111,7 +111,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
textureManager =
new ExternalTextureManager(
glObjectsProvider, samplingShaderProgram, videoFrameProcessingTaskExecutor);
inputs.put(inputType, new Input(textureManager, samplingShaderProgram));
break;
case INPUT_TYPE_BITMAP:
samplingShaderProgram =
@ -128,7 +127,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
textureManager =
new BitmapTextureManager(
glObjectsProvider, samplingShaderProgram, videoFrameProcessingTaskExecutor);
inputs.put(inputType, new Input(textureManager, samplingShaderProgram));
break;
case INPUT_TYPE_TEXTURE_ID:
samplingShaderProgram =
@ -145,11 +143,11 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
textureManager =
new TexIdTextureManager(
glObjectsProvider, samplingShaderProgram, videoFrameProcessingTaskExecutor);
inputs.put(inputType, new Input(textureManager, samplingShaderProgram));
break;
default:
throw new VideoFrameProcessingException("Unsupported input type " + inputType);
}
inputs.put(inputType, new Input(textureManager, samplingShaderProgram));
}
/** Sets the {@link GlShaderProgram} that {@code InputSwitcher} outputs to. */