Commit 5b556b3c by leonwind Committed by Marc Baechinger

Make MatrixTransformationsProcessor constructor to take in Lists.

* Replace ImmutableLists to List interface for constructors

PiperOrigin-RevId: 472433434
parent 91e1209e
...@@ -32,6 +32,7 @@ import androidx.media3.common.util.UnstableApi; ...@@ -32,6 +32,7 @@ import androidx.media3.common.util.UnstableApi;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
/** /**
* Applies a sequence of {@link MatrixTransformation MatrixTransformations} in the vertex shader and * Applies a sequence of {@link MatrixTransformation MatrixTransformations} in the vertex shader and
...@@ -136,8 +137,8 @@ import java.util.Arrays; ...@@ -136,8 +137,8 @@ import java.util.Arrays;
*/ */
public static MatrixTransformationProcessor create( public static MatrixTransformationProcessor create(
Context context, Context context,
ImmutableList<GlMatrixTransformation> matrixTransformations, List<GlMatrixTransformation> matrixTransformations,
ImmutableList<RgbMatrix> rgbMatrices, List<RgbMatrix> rgbMatrices,
boolean useHdr) boolean useHdr)
throws FrameProcessingException { throws FrameProcessingException {
GlProgram glProgram = GlProgram glProgram =
...@@ -145,7 +146,11 @@ import java.util.Arrays; ...@@ -145,7 +146,11 @@ import java.util.Arrays;
context, VERTEX_SHADER_TRANSFORMATION_PATH, FRAGMENT_SHADER_TRANSFORMATION_PATH); context, VERTEX_SHADER_TRANSFORMATION_PATH, FRAGMENT_SHADER_TRANSFORMATION_PATH);
// No transfer functions needed, because input and output are both optical colors. // 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);
} }
/** /**
...@@ -173,8 +178,8 @@ import java.util.Arrays; ...@@ -173,8 +178,8 @@ import java.util.Arrays;
*/ */
public static MatrixTransformationProcessor createWithExternalSamplerApplyingEotf( public static MatrixTransformationProcessor createWithExternalSamplerApplyingEotf(
Context context, Context context,
ImmutableList<GlMatrixTransformation> matrixTransformations, List<GlMatrixTransformation> matrixTransformations,
ImmutableList<RgbMatrix> rgbMatrices, List<RgbMatrix> rgbMatrices,
ColorInfo electricalColorInfo) ColorInfo electricalColorInfo)
throws FrameProcessingException { throws FrameProcessingException {
boolean useHdr = ColorInfo.isTransferHdr(electricalColorInfo); boolean useHdr = ColorInfo.isTransferHdr(electricalColorInfo);
...@@ -205,7 +210,11 @@ import java.util.Arrays; ...@@ -205,7 +210,11 @@ import java.util.Arrays;
glProgram.setIntUniform("uEotfColorTransfer", colorTransfer); glProgram.setIntUniform("uEotfColorTransfer", colorTransfer);
} }
return new MatrixTransformationProcessor(glProgram, matrixTransformations, rgbMatrices, useHdr); return new MatrixTransformationProcessor(
glProgram,
ImmutableList.copyOf(matrixTransformations),
ImmutableList.copyOf(rgbMatrices),
useHdr);
} }
/** /**
...@@ -229,8 +238,8 @@ import java.util.Arrays; ...@@ -229,8 +238,8 @@ import java.util.Arrays;
*/ */
public static MatrixTransformationProcessor createApplyingOetf( public static MatrixTransformationProcessor createApplyingOetf(
Context context, Context context,
ImmutableList<GlMatrixTransformation> matrixTransformations, List<GlMatrixTransformation> matrixTransformations,
ImmutableList<RgbMatrix> rgbMatrices, List<RgbMatrix> rgbMatrices,
ColorInfo electricalColorInfo) ColorInfo electricalColorInfo)
throws FrameProcessingException { throws FrameProcessingException {
boolean useHdr = ColorInfo.isTransferHdr(electricalColorInfo); boolean useHdr = ColorInfo.isTransferHdr(electricalColorInfo);
...@@ -248,7 +257,11 @@ import java.util.Arrays; ...@@ -248,7 +257,11 @@ import java.util.Arrays;
glProgram.setIntUniform("uOetfColorTransfer", colorTransfer); glProgram.setIntUniform("uOetfColorTransfer", colorTransfer);
} }
return new MatrixTransformationProcessor(glProgram, matrixTransformations, rgbMatrices, useHdr); return new MatrixTransformationProcessor(
glProgram,
ImmutableList.copyOf(matrixTransformations),
ImmutableList.copyOf(rgbMatrices),
useHdr);
} }
/** /**
...@@ -272,8 +285,8 @@ import java.util.Arrays; ...@@ -272,8 +285,8 @@ import java.util.Arrays;
*/ */
public static MatrixTransformationProcessor createWithExternalSamplerApplyingEotfThenOetf( public static MatrixTransformationProcessor createWithExternalSamplerApplyingEotfThenOetf(
Context context, Context context,
ImmutableList<GlMatrixTransformation> matrixTransformations, List<GlMatrixTransformation> matrixTransformations,
ImmutableList<RgbMatrix> rgbMatrices, List<RgbMatrix> rgbMatrices,
ColorInfo electricalColorInfo) ColorInfo electricalColorInfo)
throws FrameProcessingException { throws FrameProcessingException {
boolean useHdr = ColorInfo.isTransferHdr(electricalColorInfo); boolean useHdr = ColorInfo.isTransferHdr(electricalColorInfo);
...@@ -302,7 +315,11 @@ import java.util.Arrays; ...@@ -302,7 +315,11 @@ import java.util.Arrays;
glProgram.setIntUniform("uEotfColorTransfer", Format.NO_VALUE); glProgram.setIntUniform("uEotfColorTransfer", Format.NO_VALUE);
} }
return new MatrixTransformationProcessor(glProgram, matrixTransformations, rgbMatrices, useHdr); return new MatrixTransformationProcessor(
glProgram,
ImmutableList.copyOf(matrixTransformations),
ImmutableList.copyOf(rgbMatrices),
useHdr);
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment