From 089510bc64dfb583792749831959c8a7a26c4c78 Mon Sep 17 00:00:00 2001 From: huangdarwin Date: Tue, 31 Jan 2023 17:06:48 +0000 Subject: [PATCH] Effect: Allow SingleFrameGlTextureProcessor to throw errors. Implementations outside media3 should be able to throw FrameProcessingException if they come across an error during configure(). PiperOrigin-RevId: 506020149 --- .../media3/effect/SingleFrameGlTextureProcessor.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/effect/src/main/java/androidx/media3/effect/SingleFrameGlTextureProcessor.java b/libraries/effect/src/main/java/androidx/media3/effect/SingleFrameGlTextureProcessor.java index fb4db5fbfe..cf43e529d2 100644 --- a/libraries/effect/src/main/java/androidx/media3/effect/SingleFrameGlTextureProcessor.java +++ b/libraries/effect/src/main/java/androidx/media3/effect/SingleFrameGlTextureProcessor.java @@ -74,8 +74,9 @@ public abstract class SingleFrameGlTextureProcessor implements GlTextureProcesso * @param inputWidth The input width, in pixels. * @param inputHeight The input height, in pixels. * @return The output width and height of frames processed through {@link #drawFrame(int, long)}. + * @throws FrameProcessingException If an error occurs while configuring. */ - public abstract Size configure(int inputWidth, int inputHeight); + public abstract Size configure(int inputWidth, int inputHeight) throws FrameProcessingException; /** * Draws one frame. @@ -144,7 +145,8 @@ public abstract class SingleFrameGlTextureProcessor implements GlTextureProcesso } @EnsuresNonNull("outputTexture") - private void configureOutputTexture(int inputWidth, int inputHeight) throws GlUtil.GlException { + private void configureOutputTexture(int inputWidth, int inputHeight) + throws GlUtil.GlException, FrameProcessingException { this.inputWidth = inputWidth; this.inputHeight = inputHeight; Size outputSize = configure(inputWidth, inputHeight);