diff --git a/libraries/effect/src/main/java/androidx/media3/effect/DefaultShaderProgram.java b/libraries/effect/src/main/java/androidx/media3/effect/DefaultShaderProgram.java index 92f34d7a3f..994867fced 100644 --- a/libraries/effect/src/main/java/androidx/media3/effect/DefaultShaderProgram.java +++ b/libraries/effect/src/main/java/androidx/media3/effect/DefaultShaderProgram.java @@ -185,16 +185,11 @@ import java.util.List; *

Input will be sampled from an internal (i.e. regular) texture. * *

Applies the {@linkplain ColorInfo#colorTransfer inputColorInfo EOTF} to convert from - * electrical color input, to intermediate optical {@link GlShaderProgram} color output, before - * {@code matrixTransformations} and {@code rgbMatrices} are applied. Also applies the {@linkplain - * ColorInfo#colorTransfer outputColorInfo OETF}, if needed, to convert back to an electrical - * color output. + * electrical color input, to intermediate optical {@link GlShaderProgram} color output. Also + * applies the {@linkplain ColorInfo#colorTransfer outputColorInfo OETF}, if needed, to convert + * back to an electrical color output. * * @param context The {@link Context}. - * @param matrixTransformations The {@link GlMatrixTransformation GlMatrixTransformations} to - * apply to each frame in order. Can be empty to apply no vertex transformations. - * @param rgbMatrices The {@link RgbMatrix RgbMatrices} to apply to each frame in order. Can be - * empty to apply no color transformations. * @param inputColorInfo The input electrical (nonlinear) {@link ColorInfo}. * @param outputColorInfo The output electrical (nonlinear) or optical (linear) {@link ColorInfo}. * If this is an optical color, it must be BT.2020 if {@code inputColorInfo} is {@linkplain @@ -206,8 +201,6 @@ import java.util.List; */ public static DefaultShaderProgram createWithInternalSampler( Context context, - List matrixTransformations, - List rgbMatrices, ColorInfo inputColorInfo, ColorInfo outputColorInfo, boolean enableColorTransfers, @@ -226,13 +219,7 @@ import java.util.List; : FRAGMENT_SHADER_TRANSFORMATION_SDR_INTERNAL_PATH; GlProgram glProgram = createGlProgram(context, vertexShaderFilePath, fragmentShaderFilePath); glProgram.setIntUniform("uInputColorTransfer", inputColorInfo.colorTransfer); - return createWithSampler( - glProgram, - matrixTransformations, - rgbMatrices, - inputColorInfo, - outputColorInfo, - enableColorTransfers); + return createWithSampler(glProgram, inputColorInfo, outputColorInfo, enableColorTransfers); } /** @@ -243,16 +230,11 @@ import java.util.List; * external texture. * *

Applies the {@linkplain ColorInfo#colorTransfer inputColorInfo EOTF} to convert from - * electrical color input, to intermediate optical {@link GlShaderProgram} color output, before - * {@code matrixTransformations} and {@code rgbMatrices} are applied. Also applies the {@linkplain - * ColorInfo#colorTransfer outputColorInfo OETF}, if needed, to convert back to an electrical - * color output. + * electrical color input, to intermediate optical {@link GlShaderProgram} color output. Also + * applies the {@linkplain ColorInfo#colorTransfer outputColorInfo OETF}, if needed, to convert + * back to an electrical color output. * * @param context The {@link Context}. - * @param matrixTransformations The {@link GlMatrixTransformation GlMatrixTransformations} to - * apply to each frame in order. Can be empty to apply no vertex transformations. - * @param rgbMatrices The {@link RgbMatrix RgbMatrices} to apply to each frame in order. Can be - * empty to apply no color transformations. * @param inputColorInfo The input electrical (nonlinear) {@link ColorInfo}. * @param outputColorInfo The output electrical (nonlinear) or optical (linear) {@link ColorInfo}. * If this is an optical color, it must be BT.2020 if {@code inputColorInfo} is {@linkplain @@ -264,8 +246,6 @@ import java.util.List; */ public static DefaultShaderProgram createWithExternalSampler( Context context, - List matrixTransformations, - List rgbMatrices, ColorInfo inputColorInfo, ColorInfo outputColorInfo, boolean enableColorTransfers) @@ -294,13 +274,7 @@ import java.util.List; glProgram.setIntUniform("uInputColorTransfer", inputColorInfo.colorTransfer); } - return createWithSampler( - glProgram, - matrixTransformations, - rgbMatrices, - inputColorInfo, - outputColorInfo, - enableColorTransfers); + return createWithSampler(glProgram, inputColorInfo, outputColorInfo, enableColorTransfers); } /** @@ -365,8 +339,6 @@ import java.util.List; private static DefaultShaderProgram createWithSampler( GlProgram glProgram, - List matrixTransformations, - List rgbMatrices, ColorInfo inputColorInfo, ColorInfo outputColorInfo, boolean enableColorTransfers) { @@ -397,8 +369,8 @@ import java.util.List; return new DefaultShaderProgram( glProgram, - ImmutableList.copyOf(matrixTransformations), - ImmutableList.copyOf(rgbMatrices), + /* matrixTransformations= */ ImmutableList.of(), + /* rgbMatrices= */ ImmutableList.of(), outputColorInfo.colorTransfer, isInputTransferHdr); } diff --git a/libraries/effect/src/main/java/androidx/media3/effect/InputSwitcher.java b/libraries/effect/src/main/java/androidx/media3/effect/InputSwitcher.java index 21c31b35db..afdb7ebfa8 100644 --- a/libraries/effect/src/main/java/androidx/media3/effect/InputSwitcher.java +++ b/libraries/effect/src/main/java/androidx/media3/effect/InputSwitcher.java @@ -36,7 +36,6 @@ import androidx.media3.common.GlTextureInfo; import androidx.media3.common.OnInputFrameProcessedListener; import androidx.media3.common.VideoFrameProcessingException; import androidx.media3.common.VideoFrameProcessor; -import com.google.common.collect.ImmutableList; import java.util.concurrent.Executor; import org.checkerframework.checker.nullness.qual.MonotonicNonNull; import org.checkerframework.checker.nullness.qual.Nullable; @@ -97,12 +96,7 @@ import org.checkerframework.checker.nullness.qual.Nullable; case INPUT_TYPE_SURFACE: samplingShaderProgram = DefaultShaderProgram.createWithExternalSampler( - context, - /* matrixTransformations= */ ImmutableList.of(), - /* rgbMatrices= */ ImmutableList.of(), - inputColorInfo, - outputColorInfo, - enableColorTransfers); + context, inputColorInfo, outputColorInfo, enableColorTransfers); break; case INPUT_TYPE_BITMAP: // HDR bitmap input is not supported. Bitmaps are always sRGB/Full range/BT.709. @@ -110,26 +104,14 @@ import org.checkerframework.checker.nullness.qual.Nullable; ColorInfo bitmapColorInfo = ColorInfo.SRGB_BT709_FULL; samplingShaderProgram = DefaultShaderProgram.createWithInternalSampler( - context, - /* matrixTransformations= */ ImmutableList.of(), - /* rgbMatrices= */ ImmutableList.of(), - bitmapColorInfo, - outputColorInfo, - enableColorTransfers, - inputType); + context, bitmapColorInfo, outputColorInfo, enableColorTransfers, inputType); break; case INPUT_TYPE_TEXTURE_ID: // Image and textureId concatenation not supported. checkState(inputColorInfo.colorTransfer != C.COLOR_TRANSFER_SRGB); samplingShaderProgram = DefaultShaderProgram.createWithInternalSampler( - context, - /* matrixTransformations= */ ImmutableList.of(), - /* rgbMatrices= */ ImmutableList.of(), - inputColorInfo, - outputColorInfo, - enableColorTransfers, - inputType); + context, inputColorInfo, outputColorInfo, enableColorTransfers, inputType); break; default: throw new VideoFrameProcessingException("Unsupported input type " + inputType);