diff --git a/google3/third_party/java_src/android_libs/media/libraries/effect/src/main/java/androidx/media3/effect/MatrixTransformationProcessor.java b/google3/third_party/java_src/android_libs/media/libraries/effect/src/main/java/androidx/media3/effect/MatrixTransformationProcessor.java index 6cef8653d93..62c0490a847 100644 --- a/google3/third_party/java_src/android_libs/media/libraries/effect/src/main/java/androidx/media3/effect/MatrixTransformationProcessor.java +++ b/google3/third_party/java_src/android_libs/media/libraries/effect/src/main/java/androidx/media3/effect/MatrixTransformationProcessor.java @@ -31,6 +31,7 @@ import com.google.common.collect.ImmutableList; import java.io.IOException; import java.util.Arrays; +import java.util.List; /** * Applies a sequence of {@link MatrixTransformation MatrixTransformations} in the vertex shader and @@ -134,8 +135,8 @@ */ public static MatrixTransformationProcessor create( Context context, - ImmutableList matrixTransformations, - ImmutableList rgbMatrices, + List matrixTransformations, + List rgbMatrices, boolean useHdr) throws FrameProcessingException { GlProgram glProgram = @@ -143,7 +144,11 @@ public static MatrixTransformationProcessor create( context, VERTEX_SHADER_TRANSFORMATION_PATH, FRAGMENT_SHADER_TRANSFORMATION_PATH); // No transfer functions needed, because input and output are both optical colors. - return new MatrixTransformationProcessor(glProgram, matrixTransformations, rgbMatrices, useHdr); + return new MatrixTransformationProcessor( + glProgram, + ImmutableList.copyOf(matrixTransformations), + ImmutableList.copyOf(rgbMatrices), + useHdr); } /** @@ -171,8 +176,8 @@ public static MatrixTransformationProcessor create( */ public static MatrixTransformationProcessor createWithExternalSamplerApplyingEotf( Context context, - ImmutableList matrixTransformations, - ImmutableList rgbMatrices, + List matrixTransformations, + List rgbMatrices, ColorInfo electricalColorInfo) throws FrameProcessingException { boolean useHdr = ColorInfo.isTransferHdr(electricalColorInfo); @@ -203,7 +208,11 @@ public static MatrixTransformationProcessor createWithExternalSamplerApplyingEot glProgram.setIntUniform("uEotfColorTransfer", colorTransfer); } - return new MatrixTransformationProcessor(glProgram, matrixTransformations, rgbMatrices, useHdr); + return new MatrixTransformationProcessor( + glProgram, + ImmutableList.copyOf(matrixTransformations), + ImmutableList.copyOf(rgbMatrices), + useHdr); } /** @@ -227,8 +236,8 @@ public static MatrixTransformationProcessor createWithExternalSamplerApplyingEot */ public static MatrixTransformationProcessor createApplyingOetf( Context context, - ImmutableList matrixTransformations, - ImmutableList rgbMatrices, + List matrixTransformations, + List rgbMatrices, ColorInfo electricalColorInfo) throws FrameProcessingException { boolean useHdr = ColorInfo.isTransferHdr(electricalColorInfo); @@ -246,7 +255,11 @@ public static MatrixTransformationProcessor createApplyingOetf( glProgram.setIntUniform("uOetfColorTransfer", colorTransfer); } - return new MatrixTransformationProcessor(glProgram, matrixTransformations, rgbMatrices, useHdr); + return new MatrixTransformationProcessor( + glProgram, + ImmutableList.copyOf(matrixTransformations), + ImmutableList.copyOf(rgbMatrices), + useHdr); } /** @@ -270,8 +283,8 @@ public static MatrixTransformationProcessor createApplyingOetf( */ public static MatrixTransformationProcessor createWithExternalSamplerApplyingEotfThenOetf( Context context, - ImmutableList matrixTransformations, - ImmutableList rgbMatrices, + List matrixTransformations, + List rgbMatrices, ColorInfo electricalColorInfo) throws FrameProcessingException { boolean useHdr = ColorInfo.isTransferHdr(electricalColorInfo); @@ -300,7 +313,11 @@ public static MatrixTransformationProcessor createWithExternalSamplerApplyingEot glProgram.setIntUniform("uEotfColorTransfer", Format.NO_VALUE); } - return new MatrixTransformationProcessor(glProgram, matrixTransformations, rgbMatrices, useHdr); + return new MatrixTransformationProcessor( + glProgram, + ImmutableList.copyOf(matrixTransformations), + ImmutableList.copyOf(rgbMatrices), + useHdr); } /**