Skip to content

Commit

Permalink
Make OverlayEffect take a List
Browse files Browse the repository at this point in the history
Otherwise, it cannot be used with Kotlin `listOf()`.

PiperOrigin-RevId: 682255423
  • Loading branch information
claincly authored and copybara-github committed Oct 4, 2024
1 parent 7b08bed commit b5680e8
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
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
Expand All @@ -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
Expand Down

0 comments on commit b5680e8

Please sign in to comment.