Make OverlayEffect take a List

Otherwise, it cannot be used with Kotlin `listOf()`.

PiperOrigin-RevId: 682255423
This commit is contained in:
claincly 2024-10-04 03:43:56 -07:00 committed by Copybara-Service
parent 7b08bedf2c
commit b5680e8a65

View File

@ -19,6 +19,7 @@ import android.content.Context;
import androidx.media3.common.VideoFrameProcessingException;
import androidx.media3.common.util.UnstableApi;
import com.google.common.collect.ImmutableList;
import java.util.List;
/**
* Applies a list of {@link TextureOverlay}s to a frame in FIFO order (the last overlay in the list
@ -36,10 +37,12 @@ public final class OverlayEffect implements GlEffect {
/**
* Creates a new instance for the given list of {@link TextureOverlay}s.
*
* @param textureOverlays The {@link TextureOverlay}s to be blended into the frame.
* @param textureOverlays The {@link TextureOverlay}s to be blended into the frame. To modify the
* list of {@link TextureOverlay TextureOverlays}, one must recreate a new {@code
* OverlayEffect} with the updated list.
*/
public OverlayEffect(ImmutableList<TextureOverlay> textureOverlays) {
this.overlays = textureOverlays;
public OverlayEffect(List<TextureOverlay> textureOverlays) {
this.overlays = ImmutableList.copyOf(textureOverlays);
}
@Override