diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/DefaultVideoSink.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/DefaultVideoSink.java index 43e62660ee..3bf88db12f 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/DefaultVideoSink.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/video/DefaultVideoSink.java @@ -15,8 +15,11 @@ */ package androidx.media3.exoplayer.video; +import static androidx.media3.common.util.Assertions.checkStateNotNull; + import android.graphics.Bitmap; import android.view.Surface; +import androidx.annotation.Nullable; import androidx.media3.common.Effect; import androidx.media3.common.Format; import androidx.media3.common.util.Size; @@ -27,13 +30,24 @@ import java.util.concurrent.Executor; /** * The default {@link VideoSink} implementation. This implementation renders video frames to an - * output surface. Applying {@linkplain Effect video effects} is unsupported. + * output surface. + * + *
The following operations are not supported: + * + *
The {@linkplain #getInputSurface() input} and {@linkplain #setOutputSurfaceInfo(Surface, Size) + * output} surfaces are the same. */ /* package */ final class DefaultVideoSink implements VideoSink { private final VideoFrameReleaseControl videoFrameReleaseControl; private final VideoFrameRenderControl videoFrameRenderControl; + @Nullable private Surface outputSurface; private Format inputFormat; public DefaultVideoSink( @@ -99,7 +113,7 @@ import java.util.concurrent.Executor; @Override public Surface getInputSurface() { - throw new UnsupportedOperationException(); + return checkStateNotNull(outputSurface); } @Override @@ -112,11 +126,21 @@ import java.util.concurrent.Executor; videoFrameReleaseControl.setPlaybackSpeed(speed); } + /** + * {@inheritDoc} + * + *
This method will always throw an {@link UnsupportedOperationException}.
+ */
@Override
public void setVideoEffects(List This method will always throw an {@link UnsupportedOperationException}.
+ */
@Override
public void setPendingVideoEffects(List This method will always throw an {@link UnsupportedOperationException}.
+ */
@Override
public boolean handleInputBitmap(Bitmap inputBitmap, TimestampIterator timestampIterator) {
throw new UnsupportedOperationException();