diff --git a/libraries/common/src/main/java/androidx/media3/common/VideoFrameProcessor.java b/libraries/common/src/main/java/androidx/media3/common/VideoFrameProcessor.java index 17bf80b7ab..79816427fc 100644 --- a/libraries/common/src/main/java/androidx/media3/common/VideoFrameProcessor.java +++ b/libraries/common/src/main/java/androidx/media3/common/VideoFrameProcessor.java @@ -40,6 +40,9 @@ import java.util.concurrent.Executor; *
Manages its input {@link Surface}, which can be accessed via {@link #getInputSurface()}. The * output {@link Surface} must be set by the caller using {@link * #setOutputSurfaceInfo(SurfaceInfo)}. + * + *
{@code VideoFrameProcessor} instances can be created from any thread, but instance methods for + * each {@linkplain #registerInputStream stream} must be called from the same thread. */ @UnstableApi public interface VideoFrameProcessor { @@ -173,8 +176,6 @@ public interface VideoFrameProcessor { *
Can be called many times after {@link #registerInputStream(int, List, FrameInfo) registering * the input stream} to put multiple frames in the same input stream. * - *
Can be called on any thread. - * * @param inputBitmap The {@link Bitmap} queued to the {@code VideoFrameProcessor}. * @param inStreamOffsetsUs The times within the current stream that the bitmap should be shown * at. The timestamps should be monotonically increasing. @@ -191,8 +192,6 @@ public interface VideoFrameProcessor { *
It must be only called after {@link #setOnInputFrameProcessedListener} and {@link * #registerInputStream} have been called. * - *
Can be called on any thread. - * * @param textureId The ID of the texture queued to the {@code VideoFrameProcessor}. * @param presentationTimeUs The presentation time of the queued texture, in microseconds. * @return Whether the texture was successfully queued. A return value of {@code false} indicates @@ -204,8 +203,6 @@ public interface VideoFrameProcessor { /** * Sets the {@link OnInputFrameProcessedListener}. * - *
Can be called on any thread. - * * @param listener The {@link OnInputFrameProcessedListener}. */ void setOnInputFrameProcessedListener(OnInputFrameProcessedListener listener); @@ -218,8 +215,6 @@ public interface VideoFrameProcessor { * VideoFrameProcessor} until {@link #registerInputStream} is called with {@link * #INPUT_TYPE_SURFACE}. * - *
Can be called on any thread. - * * @throws UnsupportedOperationException If the {@code VideoFrameProcessor} does not accept * {@linkplain #INPUT_TYPE_SURFACE surface input}. */ @@ -238,8 +233,6 @@ public interface VideoFrameProcessor { * is when {@link Listener#onInputStreamRegistered(int, List, FrameInfo)} is called after the * underlying processing pipeline has been adapted to the registered input stream. * - *
Can be called on any thread. - * * @param inputType The {@link InputType} of the new input stream. * @param effects The list of {@link Effect effects} to apply to the new input stream. * @param frameInfo The {@link FrameInfo} of the new input stream. @@ -253,8 +246,6 @@ public interface VideoFrameProcessor { *
Must be called before rendering a frame to the input surface. The caller must not render * frames to the {@linkplain #getInputSurface input surface} when {@code false} is returned. * - *
Can be called on any thread. - * * @return Whether the input frame was successfully registered. If {@link * #registerInputStream(int, List, FrameInfo)} is called, this method returns {@code false} * until {@link Listener#onInputStreamRegistered(int, List, FrameInfo)} is called. Otherwise, @@ -270,8 +261,6 @@ public interface VideoFrameProcessor { /** * Returns the number of input frames that have been made available to the {@code * VideoFrameProcessor} but have not been processed yet. - * - *
Can be called on any thread. */ int getPendingInputFrameCount(); @@ -317,8 +306,6 @@ public interface VideoFrameProcessor { /** * Informs the {@code VideoFrameProcessor} that no further input frames should be accepted. * - *
Can be called on any thread. - * * @throws IllegalStateException If called more than once. */ void signalEndOfInput(); @@ -347,8 +334,6 @@ public interface VideoFrameProcessor { * *
This method blocks until all resources are released or releasing times out. * - *
Can be called on any thread. - * *
This {@link VideoFrameProcessor} instance must not be used after this method is called. */ void release(); diff --git a/libraries/effect/src/main/java/androidx/media3/effect/BitmapTextureManager.java b/libraries/effect/src/main/java/androidx/media3/effect/BitmapTextureManager.java index 70c68b0237..d6f8f27d50 100644 --- a/libraries/effect/src/main/java/androidx/media3/effect/BitmapTextureManager.java +++ b/libraries/effect/src/main/java/androidx/media3/effect/BitmapTextureManager.java @@ -36,8 +36,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; /** * Forwards a video frame produced from a {@link Bitmap} to a {@link GlShaderProgram} for * consumption. - * - *
Public methods in this class can be called from any thread. */ @UnstableApi /* package */ final class BitmapTextureManager extends TextureManager { diff --git a/libraries/effect/src/main/java/androidx/media3/effect/TexIdTextureManager.java b/libraries/effect/src/main/java/androidx/media3/effect/TexIdTextureManager.java index 452d9ce9ab..f2fd383d41 100644 --- a/libraries/effect/src/main/java/androidx/media3/effect/TexIdTextureManager.java +++ b/libraries/effect/src/main/java/androidx/media3/effect/TexIdTextureManager.java @@ -29,8 +29,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; /** * Forwards frames made available via {@linkplain GLES10#GL_TEXTURE_2D traditional GLES textures} to * a {@link GlShaderProgram} for consumption. - * - *
Public methods in this class can be called from any thread. */ /* package */ final class TexIdTextureManager extends TextureManager { private final FrameConsumptionManager frameConsumptionManager;