Commit 80890928 by hschlueter Committed by Ian Baker

Use @linkplain for link text that doesn't match symbol name.

PiperOrigin-RevId: 437992927
parent 9d48cff9
Showing with 132 additions and 126 deletions
...@@ -28,10 +28,11 @@ import java.io.IOException; ...@@ -28,10 +28,11 @@ import java.io.IOException;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull; import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
/** /**
* Applies a transformation matrix in the vertex shader. Operations are done on normalized device * Applies a transformation matrix in the vertex shader.
* coordinates (-1 to 1 on x and y axes). No automatic adjustments (like done in {@link *
* ScaleToFitFrameProcessor}) are applied on the transformation. Width and height are not modified. * <p>Operations are done on normalized device coordinates (-1 to 1 on x and y axes). No automatic
* The background color will default to black. * adjustments (like done in {@link ScaleToFitFrameProcessor}) are applied on the transformation.
* Width and height are not modified. The background color will default to black.
*/ */
@UnstableApi @UnstableApi
public final class AdvancedFrameProcessor implements GlFrameProcessor { public final class AdvancedFrameProcessor implements GlFrameProcessor {
......
...@@ -36,7 +36,7 @@ import java.util.List; ...@@ -36,7 +36,7 @@ import java.util.List;
@UnstableApi @UnstableApi
public interface Codec { public interface Codec {
/** A factory for {@link Codec decoder} instances. */ /** A factory for {@linkplain Codec decoder} instances. */
interface DecoderFactory { interface DecoderFactory {
/** A default {@code DecoderFactory} implementation. */ /** A default {@code DecoderFactory} implementation. */
...@@ -67,7 +67,7 @@ public interface Codec { ...@@ -67,7 +67,7 @@ public interface Codec {
throws TransformationException; throws TransformationException;
} }
/** A factory for {@link Codec encoder} instances. */ /** A factory for {@linkplain Codec encoder} instances. */
interface EncoderFactory { interface EncoderFactory {
/** A default {@code EncoderFactory} implementation. */ /** A default {@code EncoderFactory} implementation. */
...@@ -77,13 +77,13 @@ public interface Codec { ...@@ -77,13 +77,13 @@ public interface Codec {
* Returns a {@link Codec} for audio encoding. * Returns a {@link Codec} for audio encoding.
* *
* <p>This method must validate that the {@link Codec} is configured to produce one of the * <p>This method must validate that the {@link Codec} is configured to produce one of the
* {@code allowedMimeTypes}. The {@link Format#sampleMimeType sample MIME type} given in {@code * {@code allowedMimeTypes}. The {@linkplain Format#sampleMimeType sample MIME type} given in
* format} is not necessarily allowed. * {@code format} is not necessarily allowed.
* *
* @param format The {@link Format} (of the output data) used to determine the underlying * @param format The {@link Format} (of the output data) used to determine the underlying
* encoder and its configuration values. * encoder and its configuration values.
* @param allowedMimeTypes The non-empty list of allowed output sample {@link MimeTypes MIME * @param allowedMimeTypes The non-empty list of allowed output sample {@linkplain MimeTypes
* types}. * MIME types}.
* @return A {@link Codec} for audio encoding. * @return A {@link Codec} for audio encoding.
* @throws TransformationException If no suitable {@link Codec} can be created. * @throws TransformationException If no suitable {@link Codec} can be created.
*/ */
...@@ -94,8 +94,8 @@ public interface Codec { ...@@ -94,8 +94,8 @@ public interface Codec {
* Returns a {@link Codec} for video encoding. * Returns a {@link Codec} for video encoding.
* *
* <p>This method must validate that the {@link Codec} is configured to produce one of the * <p>This method must validate that the {@link Codec} is configured to produce one of the
* {@code allowedMimeTypes}. The {@link Format#sampleMimeType sample MIME type} given in {@code * {@code allowedMimeTypes}. The {@linkplain Format#sampleMimeType sample MIME type} given in
* format} is not necessarily allowed. * {@code format} is not necessarily allowed.
* *
* @param format The {@link Format} (of the output data) used to determine the underlying * @param format The {@link Format} (of the output data) used to determine the underlying
* encoder and its configuration values. {@link Format#sampleMimeType}, {@link Format#width} * encoder and its configuration values. {@link Format#sampleMimeType}, {@link Format#width}
...@@ -103,8 +103,8 @@ public interface Codec { ...@@ -103,8 +103,8 @@ public interface Codec {
* Format#rotationDegrees} is 0 and {@link Format#width} {@code >=} {@link Format#height}, * Format#rotationDegrees} is 0 and {@link Format#width} {@code >=} {@link Format#height},
* therefore the video is always in landscape orientation. {@link Format#frameRate} is set * therefore the video is always in landscape orientation. {@link Format#frameRate} is set
* to the output video's frame rate, if available. * to the output video's frame rate, if available.
* @param allowedMimeTypes The non-empty list of allowed output sample {@link MimeTypes MIME * @param allowedMimeTypes The non-empty list of allowed output sample {@linkplain MimeTypes
* types}. * MIME types}.
* @return A {@link Codec} for video encoding. * @return A {@link Codec} for video encoding.
* @throws TransformationException If no suitable {@link Codec} can be created. * @throws TransformationException If no suitable {@link Codec} can be created.
*/ */
...@@ -142,8 +142,8 @@ public interface Codec { ...@@ -142,8 +142,8 @@ public interface Codec {
/** /**
* Dequeues a writable input buffer, if available. * Dequeues a writable input buffer, if available.
* *
* <p>This method must not be called from video encoders because they must use {@link Surface * <p>This method must not be called from video encoders because they must use a {@link Surface}
* surfaces} as inputs. * to receive input.
* *
* @param inputBuffer The buffer where the dequeued buffer data is stored, at {@link * @param inputBuffer The buffer where the dequeued buffer data is stored, at {@link
* DecoderInputBuffer#data inputBuffer.data}. * DecoderInputBuffer#data inputBuffer.data}.
...@@ -153,13 +153,13 @@ public interface Codec { ...@@ -153,13 +153,13 @@ public interface Codec {
boolean maybeDequeueInputBuffer(DecoderInputBuffer inputBuffer) throws TransformationException; boolean maybeDequeueInputBuffer(DecoderInputBuffer inputBuffer) throws TransformationException;
/** /**
* Queues an input buffer to the {@code Codec}. No buffers may be queued after {@link * Queues an input buffer to the {@code Codec}. No buffers may be queued after {@linkplain
* DecoderInputBuffer#isEndOfStream() end of stream} buffer has been queued. * DecoderInputBuffer#isEndOfStream() end of stream} buffer has been queued.
* *
* <p>This method must not be called from video encoders because they must use {@link Surface * <p>This method must not be called from video encoders because they must use a {@link Surface}
* surfaces} as inputs. * to receive input.
* *
* @param inputBuffer The {@link DecoderInputBuffer input buffer}. * @param inputBuffer The {@linkplain DecoderInputBuffer input buffer}.
* @throws TransformationException If the underlying decoder or encoder encounters a problem. * @throws TransformationException If the underlying decoder or encoder encounters a problem.
*/ */
void queueInputBuffer(DecoderInputBuffer inputBuffer) throws TransformationException; void queueInputBuffer(DecoderInputBuffer inputBuffer) throws TransformationException;
...@@ -169,7 +169,8 @@ public interface Codec { ...@@ -169,7 +169,8 @@ public interface Codec {
* *
* <p>This method must only be called on video encoders because they must use a {@link Surface} as * <p>This method must only be called on video encoders because they must use a {@link Surface} as
* input. For audio/video decoders or audio encoders, the {@link C#BUFFER_FLAG_END_OF_STREAM} flag * input. For audio/video decoders or audio encoders, the {@link C#BUFFER_FLAG_END_OF_STREAM} flag
* should be set on the last input buffer {@link #queueInputBuffer(DecoderInputBuffer) queued}. * should be set on the last input buffer {@linkplain #queueInputBuffer(DecoderInputBuffer)
* queued}.
* *
* @throws TransformationException If the underlying video encoder encounters a problem. * @throws TransformationException If the underlying video encoder encounters a problem.
*/ */
......
...@@ -199,9 +199,9 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory { ...@@ -199,9 +199,9 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
} }
/** /**
* Finds an {@link MediaCodecInfo encoder} that supports the requested format most closely. * Finds an {@linkplain MediaCodecInfo encoder} that supports the requested format most closely.
* *
* <p>Returns the {@link MediaCodecInfo encoder} and the supported {@link Format} in a {@link * <p>Returns the {@linkplain MediaCodecInfo encoder} and the supported {@link Format} in a {@link
* Pair}, or {@code null} if none is found. * Pair}, or {@code null} if none is found.
*/ */
@RequiresNonNull("#1.sampleMimeType") @RequiresNonNull("#1.sampleMimeType")
...@@ -402,22 +402,22 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory { ...@@ -402,22 +402,22 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
private interface EncoderFallbackCost { private interface EncoderFallbackCost {
/** /**
* Returns a cost that represents the gap between the requested encoding parameter(s) and the * Returns a cost that represents the gap between the requested encoding parameter(s) and the
* {@link MediaCodecInfo encoder}'s support for them. * {@linkplain MediaCodecInfo encoder}'s support for them.
* *
* <p>The method must return {@link Integer#MAX_VALUE} when the {@link MediaCodecInfo encoder} * <p>The method must return {@link Integer#MAX_VALUE} when the {@linkplain MediaCodecInfo
* does not support the encoding parameters. * encoder} does not support the encoding parameters.
*/ */
int getParameterSupportGap(MediaCodecInfo encoderInfo); int getParameterSupportGap(MediaCodecInfo encoderInfo);
} }
/** /**
* Filters a list of {@link MediaCodecInfo encoders} by a {@link EncoderFallbackCost cost * Filters a list of {@linkplain MediaCodecInfo encoders} by a {@linkplain EncoderFallbackCost
* function}. * cost function}.
* *
* @param encoders A list of {@link MediaCodecInfo encoders}. * @param encoders A list of {@linkplain MediaCodecInfo encoders}.
* @param cost A {@link EncoderFallbackCost cost function}. * @param cost A {@linkplain EncoderFallbackCost cost function}.
* @return A list of {@link MediaCodecInfo encoders} with the lowest costs, empty if the costs of * @return A list of {@linkplain MediaCodecInfo encoders} with the lowest costs, empty if the
* all encoders are {@link Integer#MAX_VALUE}. * costs of all encoders are {@link Integer#MAX_VALUE}.
*/ */
private static ImmutableList<MediaCodecInfo> filterEncoders( private static ImmutableList<MediaCodecInfo> filterEncoders(
List<MediaCodecInfo> encoders, EncoderFallbackCost cost, String filterName) { List<MediaCodecInfo> encoders, EncoderFallbackCost cost, String filterName) {
...@@ -454,7 +454,7 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory { ...@@ -454,7 +454,7 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
} }
/** /**
* Finds a {@link MimeTypes MIME type} that is supported by the encoder and in the {@code * Finds a {@linkplain MimeTypes MIME type} that is supported by the encoder and in the {@code
* allowedMimeTypes}. * allowedMimeTypes}.
*/ */
@Nullable @Nullable
......
...@@ -36,8 +36,8 @@ public interface EncoderSelector { ...@@ -36,8 +36,8 @@ public interface EncoderSelector {
* Returns a list of encoders that can encode media in the specified {@code mimeType}, in priority * Returns a list of encoders that can encode media in the specified {@code mimeType}, in priority
* order. * order.
* *
* @param mimeType The {@link MimeTypes MIME type} for which an encoder is required. * @param mimeType The {@linkplain MimeTypes MIME type} for which an encoder is required.
* @return An unmodifiable list of {@link MediaCodecInfo encoders} that supports the {@code * @return An unmodifiable list of {@linkplain MediaCodecInfo encoders} that support the {@code
* mimeType}. The list may be empty. * mimeType}. The list may be empty.
*/ */
List<MediaCodecInfo> selectEncoderInfos(String mimeType); List<MediaCodecInfo> selectEncoderInfos(String mimeType);
......
...@@ -47,8 +47,8 @@ public final class EncoderUtil { ...@@ -47,8 +47,8 @@ public final class EncoderUtil {
private static final List<MediaCodecInfo> encoders = new ArrayList<>(); private static final List<MediaCodecInfo> encoders = new ArrayList<>();
/** /**
* Returns a list of {@link MediaCodecInfo encoders} that support the given {@code mimeType}, or * Returns a list of {@linkplain MediaCodecInfo encoders} that support the given {@code mimeType},
* an empty list if there is none. * or an empty list if there is none.
*/ */
public static ImmutableList<MediaCodecInfo> getSupportedEncoders(String mimeType) { public static ImmutableList<MediaCodecInfo> getSupportedEncoders(String mimeType) {
maybePopulateEncoderInfos(); maybePopulateEncoderInfos();
...@@ -67,22 +67,22 @@ public final class EncoderUtil { ...@@ -67,22 +67,22 @@ public final class EncoderUtil {
} }
/** /**
* Finds a {@link MediaCodecInfo encoder}'s supported resolution from a given resolution. * Finds an {@linkplain MediaCodecInfo encoder}'s supported resolution from a given resolution.
* *
* <p>The input resolution is returned, if it (after aligning to the encoders requirement) is * <p>The input resolution is returned, if it (after aligning to the encoder's requirement) is
* supported by the {@link MediaCodecInfo encoder}. * supported by the {@linkplain MediaCodecInfo encoder}.
* *
* <p>The resolution will be adjusted to be within the {@link MediaCodecInfo encoder}'s range of * <p>The resolution will be adjusted to be within the {@linkplain MediaCodecInfo encoder}'s range
* supported resolutions, and will be aligned to the {@link MediaCodecInfo encoder}'s alignment * of supported resolutions, and will be aligned to the {@linkplain MediaCodecInfo encoder}'s
* requirement. The adjustment process takes into account the original aspect ratio. But the fixed * alignment requirement. The adjustment process takes into account the original aspect ratio. But
* resolution may not preserve the original aspect ratio, depending on the encoder's required size * the fixed resolution may not preserve the original aspect ratio, depending on the encoder's
* alignment. * required size alignment.
* *
* @param encoderInfo The {@link MediaCodecInfo} of the encoder. * @param encoderInfo The {@link MediaCodecInfo} of the encoder.
* @param mimeType The output MIME type. * @param mimeType The output MIME type.
* @param width The original width. * @param width The original width.
* @param height The original height. * @param height The original height.
* @return A {@link Size supported resolution}, or {@code null} if unable to find a fallback. * @return A {@linkplain Size supported resolution}, or {@code null} if unable to find a fallback.
*/ */
@Nullable @Nullable
public static Size getSupportedResolution( public static Size getSupportedResolution(
...@@ -136,7 +136,7 @@ public final class EncoderUtil { ...@@ -136,7 +136,7 @@ public final class EncoderUtil {
* Finds the highest supported encoding level given a profile. * Finds the highest supported encoding level given a profile.
* *
* @param encoderInfo The {@link MediaCodecInfo encoderInfo}. * @param encoderInfo The {@link MediaCodecInfo encoderInfo}.
* @param mimeType The {@link MimeTypes MIME type}. * @param mimeType The {@linkplain MimeTypes MIME type}.
* @param profile The encoding profile. * @param profile The encoding profile.
* @return The highest supported encoding level, as documented in {@link * @return The highest supported encoding level, as documented in {@link
* MediaCodecInfo.CodecProfileLevel}, or {@link #LEVEL_UNSET} if the profile is not supported. * MediaCodecInfo.CodecProfileLevel}, or {@link #LEVEL_UNSET} if the profile is not supported.
...@@ -157,8 +157,8 @@ public final class EncoderUtil { ...@@ -157,8 +157,8 @@ public final class EncoderUtil {
} }
/** /**
* Finds a {@link MediaCodec codec} that supports the {@link MediaFormat}, or {@code null} if none * Finds a {@link MediaCodec} that supports the {@link MediaFormat}, or {@code null} if none is
* is found. * found.
*/ */
@Nullable @Nullable
public static String findCodecForFormat(MediaFormat format, boolean isDecoder) { public static String findCodecForFormat(MediaFormat format, boolean isDecoder) {
...@@ -183,7 +183,8 @@ public final class EncoderUtil { ...@@ -183,7 +183,8 @@ public final class EncoderUtil {
} }
/** /**
* Finds the {@link MediaCodecInfo encoder}'s closest supported bitrate from the given bitrate. * Finds the {@linkplain MediaCodecInfo encoder}'s closest supported bitrate from the given
* bitrate.
*/ */
public static int getClosestSupportedBitrate( public static int getClosestSupportedBitrate(
MediaCodecInfo encoderInfo, String mimeType, int bitrate) { MediaCodecInfo encoderInfo, String mimeType, int bitrate) {
...@@ -203,7 +204,7 @@ public final class EncoderUtil { ...@@ -203,7 +204,7 @@ public final class EncoderUtil {
.isBitrateModeSupported(bitrateMode); .isBitrateModeSupported(bitrateMode);
} }
/** Checks if a {@link MediaCodecInfo codec} is hardware-accelerated. */ /** Checks if a {@linkplain MediaCodecInfo codec} is hardware-accelerated. */
public static boolean isHardwareAccelerated(MediaCodecInfo encoderInfo, String mimeType) { public static boolean isHardwareAccelerated(MediaCodecInfo encoderInfo, String mimeType) {
// TODO(b/214964116): Merge into MediaCodecUtil. // TODO(b/214964116): Merge into MediaCodecUtil.
if (Util.SDK_INT >= 29) { if (Util.SDK_INT >= 29) {
......
...@@ -92,7 +92,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull; ...@@ -92,7 +92,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
* Sets the texture transform matrix for converting an external surface texture's coordinates to * Sets the texture transform matrix for converting an external surface texture's coordinates to
* sampling locations. * sampling locations.
* *
* @param textureTransformMatrix The external surface texture's {@link * @param textureTransformMatrix The external surface texture's {@linkplain
* android.graphics.SurfaceTexture#getTransformMatrix(float[]) transform matrix}. * android.graphics.SurfaceTexture#getTransformMatrix(float[]) transform matrix}.
*/ */
public void setTextureTransformMatrix(float[] textureTransformMatrix) { public void setTextureTransformMatrix(float[] textureTransformMatrix) {
......
...@@ -40,7 +40,8 @@ import androidx.media3.common.util.Util; ...@@ -40,7 +40,8 @@ import androidx.media3.common.util.Util;
* Creates a new instance. * Creates a new instance.
* *
* @param mediaItem The {@link MediaItem} to transform. * @param mediaItem The {@link MediaItem} to transform.
* @param transformerListeners The {@link Transformer.Listener listeners} to forward events to. * @param transformerListeners The {@linkplain Transformer.Listener listeners} to forward events
* to.
* @param originalTransformationRequest The original {@link TransformationRequest}. * @param originalTransformationRequest The original {@link TransformationRequest}.
*/ */
public FallbackListener( public FallbackListener(
...@@ -56,7 +57,7 @@ import androidx.media3.common.util.Util; ...@@ -56,7 +57,7 @@ import androidx.media3.common.util.Util;
/** /**
* Registers an output track. * Registers an output track.
* *
* <p>All tracks must be registered before a transformation request is {@link * <p>All tracks must be registered before a transformation request is {@linkplain
* #onTransformationRequestFinalized(TransformationRequest) finalized}. * #onTransformationRequestFinalized(TransformationRequest) finalized}.
*/ */
public void registerTrack() { public void registerTrack() {
......
...@@ -52,12 +52,12 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -52,12 +52,12 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
/** /**
* {@code FrameProcessorChain} applies changes to individual video frames. * {@code FrameProcessorChain} applies changes to individual video frames.
* *
* <p>Input becomes available on its {@link #getInputSurface() input surface} asynchronously and is * <p>Input becomes available on its {@linkplain #getInputSurface() input surface} asynchronously
* processed on a background thread as it becomes available. All input frames should be {@link * and is processed on a background thread as it becomes available. All input frames should be
* #registerInputFrame() registered} before they are rendered to the input surface. {@link * {@linkplain #registerInputFrame() registered} before they are rendered to the input surface.
* #getPendingFrameCount()} can be used to check whether there are frames that have not been fully * {@link #getPendingFrameCount()} can be used to check whether there are frames that have not been
* processed yet. Output is written to its {@link #configure(Surface, int, int, SurfaceView) output * fully processed yet. Output is written to its {@linkplain #configure(Surface, int, int,
* surface}. * SurfaceView) output surface}.
*/ */
/* package */ final class FrameProcessorChain { /* package */ final class FrameProcessorChain {
...@@ -74,7 +74,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -74,7 +74,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
private final ExecutorService singleThreadExecutorService; private final ExecutorService singleThreadExecutorService;
/** Futures corresponding to the executor service's pending tasks. */ /** Futures corresponding to the executor service's pending tasks. */
private final ConcurrentLinkedQueue<Future<?>> futures; private final ConcurrentLinkedQueue<Future<?>> futures;
/** Number of frames {@link #registerInputFrame() registered} but not fully processed. */ /** Number of frames {@linkplain #registerInputFrame() registered} but not fully processed. */
private final AtomicInteger pendingFrameCount; private final AtomicInteger pendingFrameCount;
/** Prevents further frame processing tasks from being scheduled after {@link #release()}. */ /** Prevents further frame processing tasks from being scheduled after {@link #release()}. */
private volatile boolean releaseRequested; private volatile boolean releaseRequested;
...@@ -186,7 +186,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -186,7 +186,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
/** /**
* Configures the {@code FrameProcessorChain} to process frames to the specified output targets. * Configures the {@code FrameProcessorChain} to process frames to the specified output targets.
* *
* <p>This method may only be called once and may override the {@link * <p>This method may only be called once and may override the {@linkplain
* GlFrameProcessor#configureOutputSize(int, int) output size} of the final {@link * GlFrameProcessor#configureOutputSize(int, int) output size} of the final {@link
* GlFrameProcessor}. * GlFrameProcessor}.
* *
...@@ -253,8 +253,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -253,8 +253,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
/** /**
* Returns the input {@link Surface}. * Returns the input {@link Surface}.
* *
* <p>The {@code FrameProcessorChain} must be {@link #configure(Surface, int, int, SurfaceView) * <p>The {@code FrameProcessorChain} must be {@linkplain #configure(Surface, int, int,
* configured}. * SurfaceView) configured}.
*/ */
public Surface getInputSurface() { public Surface getInputSurface() {
checkStateNotNull(inputSurface, "The FrameProcessorChain must be configured."); checkStateNotNull(inputSurface, "The FrameProcessorChain must be configured.");
...@@ -296,8 +296,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -296,8 +296,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
} }
/** /**
* Returns the number of input frames that have been {@link #registerInputFrame() registered} but * Returns the number of input frames that have been {@linkplain #registerInputFrame() registered}
* not completely processed yet. * but not completely processed yet.
*/ */
public int getPendingFrameCount() { public int getPendingFrameCount() {
return pendingFrameCount.get(); return pendingFrameCount.get();
...@@ -316,9 +316,9 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -316,9 +316,9 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
/** /**
* Releases all resources. * Releases all resources.
* *
* <p>If the frame processor chain is released before it has {@link #isEnded() ended}, it will * <p>If the frame processor chain is released before it has {@linkplain #isEnded() ended}, it
* attempt to cancel processing any input frames that have already become available. Input frames * will attempt to cancel processing any input frames that have already become available. Input
* that become available after release are ignored. * frames that become available after release are ignored.
*/ */
public void release() { public void release() {
releaseRequested = true; releaseRequested = true;
...@@ -447,7 +447,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -447,7 +447,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
} }
/** /**
* Configures the input and output {@link Size sizes} of a list of {@link GlFrameProcessor * Configures the input and output {@linkplain Size sizes} of a list of {@link GlFrameProcessor
* GlFrameProcessors}. * GlFrameProcessors}.
* *
* @param inputWidth The width of frames passed to the first {@link GlFrameProcessor}, in pixels. * @param inputWidth The width of frames passed to the first {@link GlFrameProcessor}, in pixels.
......
...@@ -221,13 +221,13 @@ import java.nio.ByteBuffer; ...@@ -221,13 +221,13 @@ import java.nio.ByteBuffer;
} }
/** /**
* Converts a {@link MimeTypes MIME type} into a {@link MediaMuxer.OutputFormat MediaMuxer output * Converts a {@linkplain MimeTypes MIME type} into a {@linkplain MediaMuxer.OutputFormat
* format}. * MediaMuxer output format}.
* *
* @param mimeType The {@link MimeTypes MIME type} to convert. * @param mimeType The {@linkplain MimeTypes MIME type} to convert.
* @return The corresponding {@link MediaMuxer.OutputFormat MediaMuxer output format}. * @return The corresponding {@linkplain MediaMuxer.OutputFormat MediaMuxer output format}.
* @throws IllegalArgumentException If the {@link MimeTypes MIME type} is not supported as output * @throws IllegalArgumentException If the {@linkplain MimeTypes MIME type} is not supported as
* format. * output format.
*/ */
private static int mimeTypeToMuxerOutputFormat(String mimeType) { private static int mimeTypeToMuxerOutputFormat(String mimeType) {
if (mimeType.equals(MimeTypes.VIDEO_MP4)) { if (mimeType.equals(MimeTypes.VIDEO_MP4)) {
......
...@@ -57,8 +57,8 @@ public interface GlFrameProcessor { ...@@ -57,8 +57,8 @@ public interface GlFrameProcessor {
/** /**
* Updates the shader program's vertex attributes and uniforms, binds them, and draws. * Updates the shader program's vertex attributes and uniforms, binds them, and draws.
* *
* <p>The frame processor must be {@link #initialize(int) initialized}. The caller is responsible * <p>The frame processor must be {@linkplain #initialize(int) initialized}. The caller is
* for focussing the correct render target before calling this method. * responsible for focussing the correct render target before calling this method.
* *
* @param presentationTimeNs The presentation timestamp of the current frame, in nanoseconds. * @param presentationTimeNs The presentation timestamp of the current frame, in nanoseconds.
*/ */
......
...@@ -27,12 +27,12 @@ import java.nio.ByteBuffer; ...@@ -27,12 +27,12 @@ import java.nio.ByteBuffer;
/** /**
* Abstracts media muxing operations. * Abstracts media muxing operations.
* *
* <p>Query whether {@link Factory#supportsOutputMimeType(String) container MIME type} and {@link * <p>Query whether {@linkplain Factory#supportsOutputMimeType(String) container MIME type} and
* Factory#supportsSampleMimeType(String, String) sample MIME types} are supported and {@link * {@linkplain Factory#supportsSampleMimeType(String, String) sample MIME types} are supported and
* #addTrack(Format) add all tracks}, then {@link #writeSampleData(int, ByteBuffer, boolean, long) * {@linkplain #addTrack(Format) add all tracks}, then {@linkplain #writeSampleData(int, ByteBuffer,
* write sample data} to mux samples. Once any sample data has been written, it is not possible to * boolean, long) write sample data} to mux samples. Once any sample data has been written, it is
* add tracks. After writing all sample data, {@link #release(boolean) release} the instance to * not possible to add tracks. After writing all sample data, {@linkplain #release(boolean) release}
* finish writing to the output and return any resources to the system. * the instance to finish writing to the output and return any resources to the system.
*/ */
/* package */ interface Muxer { /* package */ interface Muxer {
...@@ -55,7 +55,7 @@ import java.nio.ByteBuffer; ...@@ -55,7 +55,7 @@ import java.nio.ByteBuffer;
* Returns a new muxer writing to a file. * Returns a new muxer writing to a file.
* *
* @param path The path to the output file. * @param path The path to the output file.
* @param outputMimeType The container {@link MimeTypes MIME type} of the output file. * @param outputMimeType The container {@linkplain MimeTypes MIME type} of the output file.
* @throws IllegalArgumentException If the path is invalid or the MIME type is not supported. * @throws IllegalArgumentException If the path is invalid or the MIME type is not supported.
* @throws IOException If an error occurs opening the output file for writing. * @throws IOException If an error occurs opening the output file for writing.
*/ */
...@@ -68,7 +68,7 @@ import java.nio.ByteBuffer; ...@@ -68,7 +68,7 @@ import java.nio.ByteBuffer;
* output. The file referenced by this ParcelFileDescriptor should not be used before the * output. The file referenced by this ParcelFileDescriptor should not be used before the
* muxer is released. It is the responsibility of the caller to close the * muxer is released. It is the responsibility of the caller to close the
* ParcelFileDescriptor. This can be done after this method returns. * ParcelFileDescriptor. This can be done after this method returns.
* @param outputMimeType The {@link MimeTypes MIME type} of the output. * @param outputMimeType The {@linkplain MimeTypes MIME type} of the output.
* @throws IllegalArgumentException If the file descriptor is invalid or the MIME type is not * @throws IllegalArgumentException If the file descriptor is invalid or the MIME type is not
* supported. * supported.
* @throws IOException If an error occurs opening the output file descriptor for writing. * @throws IOException If an error occurs opening the output file descriptor for writing.
...@@ -76,18 +76,20 @@ import java.nio.ByteBuffer; ...@@ -76,18 +76,20 @@ import java.nio.ByteBuffer;
Muxer create(ParcelFileDescriptor parcelFileDescriptor, String outputMimeType) Muxer create(ParcelFileDescriptor parcelFileDescriptor, String outputMimeType)
throws IOException; throws IOException;
/** Returns whether the {@link MimeTypes MIME type} provided is a supported output format. */ /**
* Returns whether the {@linkplain MimeTypes MIME type} provided is a supported output format.
*/
boolean supportsOutputMimeType(String mimeType); boolean supportsOutputMimeType(String mimeType);
/** /**
* Returns whether the sample {@link MimeTypes MIME type} is supported with the given container * Returns whether the sample {@linkplain MimeTypes MIME type} is supported with the given
* {@link MimeTypes MIME type}. * container {@linkplain MimeTypes MIME type}.
*/ */
boolean supportsSampleMimeType(@Nullable String sampleMimeType, String containerMimeType); boolean supportsSampleMimeType(@Nullable String sampleMimeType, String containerMimeType);
/** /**
* Returns the supported sample {@link MimeTypes MIME types} for the given {@link C.TrackType} * Returns the supported sample {@linkplain MimeTypes MIME types} for the given {@link
* and container {@link MimeTypes MIME type}. * C.TrackType} and container {@linkplain MimeTypes MIME type}.
*/ */
ImmutableList<String> getSupportedSampleMimeTypes( ImmutableList<String> getSupportedSampleMimeTypes(
@C.TrackType int trackType, String containerMimeType); @C.TrackType int trackType, String containerMimeType);
......
...@@ -70,10 +70,10 @@ import java.nio.ByteBuffer; ...@@ -70,10 +70,10 @@ import java.nio.ByteBuffer;
/** /**
* Registers an output track. * Registers an output track.
* *
* <p>All tracks must be registered before any track format is {@link #addTrackFormat(Format) * <p>All tracks must be registered before any track format is {@linkplain #addTrackFormat(Format)
* added}. * added}.
* *
* @throws IllegalStateException If a track format was {@link #addTrackFormat(Format) added} * @throws IllegalStateException If a track format was {@linkplain #addTrackFormat(Format) added}
* before calling this method. * before calling this method.
*/ */
public void registerTrack() { public void registerTrack() {
...@@ -82,14 +82,14 @@ import java.nio.ByteBuffer; ...@@ -82,14 +82,14 @@ import java.nio.ByteBuffer;
trackCount++; trackCount++;
} }
/** Returns whether the sample {@link MimeTypes MIME type} is supported. */ /** Returns whether the sample {@linkplain MimeTypes MIME type} is supported. */
public boolean supportsSampleMimeType(@Nullable String mimeType) { public boolean supportsSampleMimeType(@Nullable String mimeType) {
return muxerFactory.supportsSampleMimeType(mimeType, containerMimeType); return muxerFactory.supportsSampleMimeType(mimeType, containerMimeType);
} }
/** /**
* Returns the supported {@link MimeTypes MIME types} for the given {@link C.TrackType track * Returns the supported {@linkplain MimeTypes MIME types} for the given {@linkplain C.TrackType
* type}. * track type}.
*/ */
public ImmutableList<String> getSupportedSampleMimeTypes(@C.TrackType int trackType) { public ImmutableList<String> getSupportedSampleMimeTypes(@C.TrackType int trackType) {
return muxerFactory.getSupportedSampleMimeTypes(trackType, containerMimeType); return muxerFactory.getSupportedSampleMimeTypes(trackType, containerMimeType);
...@@ -98,9 +98,9 @@ import java.nio.ByteBuffer; ...@@ -98,9 +98,9 @@ import java.nio.ByteBuffer;
/** /**
* Adds a track format to the muxer. * Adds a track format to the muxer.
* *
* <p>The tracks must all be {@link #registerTrack() registered} before any format is added and * <p>The tracks must all be {@linkplain #registerTrack() registered} before any format is added
* all the formats must be added before samples are {@link #writeSample(int, ByteBuffer, boolean, * and all the formats must be added before samples are {@linkplain #writeSample(int, ByteBuffer,
* long) written}. * boolean, long) written}.
* *
* @param format The {@link Format} to be added. * @param format The {@link Format} to be added.
* @throws IllegalStateException If the format is unsupported or if there is already a track * @throws IllegalStateException If the format is unsupported or if there is already a track
...@@ -133,16 +133,16 @@ import java.nio.ByteBuffer; ...@@ -133,16 +133,16 @@ import java.nio.ByteBuffer;
/** /**
* Attempts to write a sample to the muxer. * Attempts to write a sample to the muxer.
* *
* @param trackType The {@link C.TrackType track type} of the sample. * @param trackType The {@linkplain C.TrackType track type} of the sample.
* @param data The sample to write. * @param data The sample to write.
* @param isKeyFrame Whether the sample is a key frame. * @param isKeyFrame Whether the sample is a key frame.
* @param presentationTimeUs The presentation time of the sample in microseconds. * @param presentationTimeUs The presentation time of the sample in microseconds.
* @return Whether the sample was successfully written. This is {@code false} if the muxer hasn't * @return Whether the sample was successfully written. This is {@code false} if the muxer hasn't
* {@link #addTrackFormat(Format) received a format} for every {@link #registerTrack() * {@linkplain #addTrackFormat(Format) received a format} for every {@linkplain
* registered track}, or if it should write samples of other track types first to ensure a * #registerTrack() registered track}, or if it should write samples of other track types
* good interleaving. * first to ensure a good interleaving.
* @throws IllegalStateException If the muxer doesn't have any {@link #endTrack(int) non-ended} * @throws IllegalStateException If the muxer doesn't have any {@linkplain #endTrack(int)
* track of the given track type. * non-ended} track of the given track type.
* @throws Muxer.MuxerException If the underlying muxer fails to write the sample. * @throws Muxer.MuxerException If the underlying muxer fails to write the sample.
*/ */
public boolean writeSample( public boolean writeSample(
......
...@@ -247,8 +247,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull; ...@@ -247,8 +247,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
* output frame rate might be variable. * output frame rate might be variable.
* *
* <p>This method can only be called if all the frames until the current one (included) have been * <p>This method can only be called if all the frames until the current one (included) have been
* {@link #processCurrentFrame(int, long) processed} in order, and if the next frames have not * {@linkplain #processCurrentFrame(int, long) processed} in order, and if the next frames have
* been processed yet. * not been processed yet.
*/ */
@VisibleForTesting @VisibleForTesting
/* package */ long getCurrentFrameOutputTimeUs(long inputTimeUs) { /* package */ long getCurrentFrameOutputTimeUs(long inputTimeUs) {
......
...@@ -147,7 +147,7 @@ public final class TransformationException extends Exception { ...@@ -147,7 +147,7 @@ public final class TransformationException extends Exception {
/** /**
* Caused by the output format for a track not being supported. * Caused by the output format for a track not being supported.
* *
* <p>Supported output formats are limited by the muxer's capabilities and the {@link * <p>Supported output formats are limited by the muxer's capabilities and the {@linkplain
* Codec.DecoderFactory encoders} available. * Codec.DecoderFactory encoders} available.
*/ */
public static final int ERROR_CODE_OUTPUT_FORMAT_UNSUPPORTED = 4003; public static final int ERROR_CODE_OUTPUT_FORMAT_UNSUPPORTED = 4003;
......
...@@ -161,7 +161,7 @@ public final class TransformationRequest { ...@@ -161,7 +161,7 @@ public final class TransformationRequest {
* @param videoMimeType The MIME type of the video samples in the output. * @param videoMimeType The MIME type of the video samples in the output.
* @return This builder. * @return This builder.
* @throws IllegalArgumentException If the {@code videoMimeType} is non-null but not a video * @throws IllegalArgumentException If the {@code videoMimeType} is non-null but not a video
* {@link MimeTypes MIME type}. * {@linkplain MimeTypes MIME type}.
*/ */
public Builder setVideoMimeType(@Nullable String videoMimeType) { public Builder setVideoMimeType(@Nullable String videoMimeType) {
checkArgument( checkArgument(
...@@ -186,7 +186,7 @@ public final class TransformationRequest { ...@@ -186,7 +186,7 @@ public final class TransformationRequest {
* @param audioMimeType The MIME type of the audio samples in the output. * @param audioMimeType The MIME type of the audio samples in the output.
* @return This builder. * @return This builder.
* @throws IllegalArgumentException If the {@code audioMimeType} is non-null but not an audio * @throws IllegalArgumentException If the {@code audioMimeType} is non-null but not an audio
* {@link MimeTypes MIME type}. * {@linkplain MimeTypes MIME type}.
*/ */
public Builder setAudioMimeType(@Nullable String audioMimeType) { public Builder setAudioMimeType(@Nullable String audioMimeType) {
checkArgument( checkArgument(
...@@ -218,7 +218,7 @@ public final class TransformationRequest { ...@@ -218,7 +218,7 @@ public final class TransformationRequest {
* *
* <p>This method is experimental, and will be renamed or removed in a future release. The HDR * <p>This method is experimental, and will be renamed or removed in a future release. The HDR
* editing feature is under development and is intended for developing/testing HDR processing * editing feature is under development and is intended for developing/testing HDR processing
* and encoding support. HDR editing can't be enabled at the same time as {@link * and encoding support. HDR editing can't be enabled at the same time as {@linkplain
* #setEnableRequestSdrToneMapping(boolean) SDR tone-mapping}. * #setEnableRequestSdrToneMapping(boolean) SDR tone-mapping}.
* *
* @param enableHdrEditing Whether to attempt to process any input video stream as a high * @param enableHdrEditing Whether to attempt to process any input video stream as a high
...@@ -278,15 +278,15 @@ public final class TransformationRequest { ...@@ -278,15 +278,15 @@ public final class TransformationRequest {
*/ */
public final int outputHeight; public final int outputHeight;
/** /**
* The requested output audio sample {@link MimeTypes MIME type}, or {@code null} if inferred from * The requested output audio sample {@linkplain MimeTypes MIME type}, or {@code null} if inferred
* the input. * from the input.
* *
* @see Builder#setAudioMimeType(String) * @see Builder#setAudioMimeType(String)
*/ */
@Nullable public final String audioMimeType; @Nullable public final String audioMimeType;
/** /**
* The requested output video sample {@link MimeTypes MIME type}, or {@code null} if inferred from * The requested output video sample {@linkplain MimeTypes MIME type}, or {@code null} if inferred
* the input. * from the input.
* *
* @see Builder#setVideoMimeType(String) * @see Builder#setVideoMimeType(String)
*/ */
......
...@@ -208,7 +208,7 @@ public final class Transformer { ...@@ -208,7 +208,7 @@ public final class Transformer {
* Sets the {@link MediaSource.Factory} to be used to retrieve the inputs to transform. * Sets the {@link MediaSource.Factory} to be used to retrieve the inputs to transform.
* *
* <p>The default value is a {@link DefaultMediaSourceFactory} built with the context provided * <p>The default value is a {@link DefaultMediaSourceFactory} built with the context provided
* in {@link #Builder(Context) the constructor}. * in {@linkplain #Builder(Context) the constructor}.
* *
* @param mediaSourceFactory A {@link MediaSource.Factory}. * @param mediaSourceFactory A {@link MediaSource.Factory}.
* @return This builder. * @return This builder.
...@@ -309,7 +309,7 @@ public final class Transformer { ...@@ -309,7 +309,7 @@ public final class Transformer {
} }
/** /**
* Removes all {@link Transformer.Listener listeners}. * Removes all {@linkplain Transformer.Listener listeners}.
* *
* <p>This is equivalent to {@link Transformer#removeAllListeners()}. * <p>This is equivalent to {@link Transformer#removeAllListeners()}.
* *
...@@ -639,7 +639,7 @@ public final class Transformer { ...@@ -639,7 +639,7 @@ public final class Transformer {
} }
/** /**
* Removes all {@link Transformer.Listener listeners}. * Removes all {@linkplain Transformer.Listener listeners}.
* *
* @throws IllegalStateException If this method is called from the wrong thread. * @throws IllegalStateException If this method is called from the wrong thread.
*/ */
...@@ -651,14 +651,14 @@ public final class Transformer { ...@@ -651,14 +651,14 @@ public final class Transformer {
/** /**
* Starts an asynchronous operation to transform the given {@link MediaItem}. * Starts an asynchronous operation to transform the given {@link MediaItem}.
* *
* <p>The transformation state is notified through the {@link Builder#addListener(Listener) * <p>The transformation state is notified through the {@linkplain Builder#addListener(Listener)
* listener}. * listener}.
* *
* <p>Concurrent transformations on the same Transformer object are not allowed. * <p>Concurrent transformations on the same Transformer object are not allowed.
* *
* <p>The output is an MP4 file. It can contain at most one video track and one audio track. Other * <p>The output is an MP4 file. It can contain at most one video track and one audio track. Other
* track types are ignored. For adaptive bitrate {@link MediaSource media sources}, the highest * track types are ignored. For adaptive bitrate {@linkplain MediaSource media sources}, the
* bitrate video and audio streams are selected. * highest bitrate video and audio streams are selected.
* *
* @param mediaItem The {@link MediaItem} to transform. * @param mediaItem The {@link MediaItem} to transform.
* @param path The path to the output file. * @param path The path to the output file.
...@@ -674,14 +674,14 @@ public final class Transformer { ...@@ -674,14 +674,14 @@ public final class Transformer {
/** /**
* Starts an asynchronous operation to transform the given {@link MediaItem}. * Starts an asynchronous operation to transform the given {@link MediaItem}.
* *
* <p>The transformation state is notified through the {@link Builder#addListener(Listener) * <p>The transformation state is notified through the {@linkplain Builder#addListener(Listener)
* listener}. * listener}.
* *
* <p>Concurrent transformations on the same Transformer object are not allowed. * <p>Concurrent transformations on the same Transformer object are not allowed.
* *
* <p>The output is an MP4 file. It can contain at most one video track and one audio track. Other * <p>The output is an MP4 file. It can contain at most one video track and one audio track. Other
* track types are ignored. For adaptive bitrate {@link MediaSource media sources}, the highest * track types are ignored. For adaptive bitrate {@linkplain MediaSource media sources}, the
* bitrate video and audio streams are selected. * highest bitrate video and audio streams are selected.
* *
* @param mediaItem The {@link MediaItem} to transform. * @param mediaItem The {@link MediaItem} to transform.
* @param parcelFileDescriptor A readable and writable {@link ParcelFileDescriptor} of the output. * @param parcelFileDescriptor A readable and writable {@link ParcelFileDescriptor} of the output.
...@@ -767,7 +767,7 @@ public final class Transformer { ...@@ -767,7 +767,7 @@ public final class Transformer {
* Returns the current {@link ProgressState} and updates {@code progressHolder} with the current * Returns the current {@link ProgressState} and updates {@code progressHolder} with the current
* progress if it is {@link #PROGRESS_STATE_AVAILABLE available}. * progress if it is {@link #PROGRESS_STATE_AVAILABLE available}.
* *
* <p>After a transformation {@link Listener#onTransformationCompleted(MediaItem, * <p>After a transformation {@linkplain Listener#onTransformationCompleted(MediaItem,
* TransformationResult) completes}, this method returns {@link * TransformationResult) completes}, this method returns {@link
* #PROGRESS_STATE_NO_TRANSFORMATION}. * #PROGRESS_STATE_NO_TRANSFORMATION}.
* *
......
...@@ -181,7 +181,7 @@ public final class VideoEncoderSettings { ...@@ -181,7 +181,7 @@ public final class VideoEncoderSettings {
/** The encoding bitrate. */ /** The encoding bitrate. */
public final int bitrate; public final int bitrate;
/** One of {@link BitrateMode the allowed modes}. */ /** One of {@linkplain BitrateMode the allowed modes}. */
public final @BitrateMode int bitrateMode; public final @BitrateMode int bitrateMode;
/** The encoding profile. */ /** The encoding profile. */
public final int profile; public final int profile;
......
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