diff --git a/library/effect/src/main/java/com/google/android/exoplayer2/effect/GlEffectsFrameProcessor.java b/library/effect/src/main/java/com/google/android/exoplayer2/effect/GlEffectsFrameProcessor.java index 647e50b76e..be7ab9c1e4 100644 --- a/library/effect/src/main/java/com/google/android/exoplayer2/effect/GlEffectsFrameProcessor.java +++ b/library/effect/src/main/java/com/google/android/exoplayer2/effect/GlEffectsFrameProcessor.java @@ -21,6 +21,7 @@ import static com.google.android.exoplayer2.util.Assertions.checkStateNotNull; import static com.google.common.collect.Iterables.getLast; import android.content.Context; +import android.graphics.SurfaceTexture; import android.opengl.EGLContext; import android.opengl.EGLDisplay; import android.view.Surface; @@ -378,6 +379,22 @@ public final class GlEffectsFrameProcessor implements FrameProcessor { return frameProcessingTaskExecutor; } + /** + * Sets the default size for input buffers, for the case where the producer providing input does + * not override the buffer size. + * + *
When input comes from a media codec it's not necessary to call this method because the codec + * (producer) sets the buffer size automatically. For the case where input comes from CameraX, + * call this method after instantiation to ensure that buffers are handled at full resolution. See + * {@link SurfaceTexture#setDefaultBufferSize(int, int)} for more information. + * + * @param width The default width for input buffers, in pixels. + * @param height The default height for input buffers, in pixels. + */ + public void setInputDefaultBufferSize(int width, int height) { + inputExternalTextureManager.getSurfaceTexture().setDefaultBufferSize(width, height); + } + @Override public Surface getInputSurface() { return inputSurface;