Skip to content

Commit

Permalink
Use @linkplain for link text that doesn't match symbol name.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 437992927
  • Loading branch information
hmsch authored and icbaker committed Apr 6, 2022
1 parent 9d48cff commit 8089092
Show file tree
Hide file tree
Showing 17 changed files with 132 additions and 126 deletions.
Expand Up @@ -28,10 +28,11 @@
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;

/**
* Applies a transformation matrix in the vertex shader. Operations are done on normalized device
* 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.
* The background color will default to black.
* Applies a transformation matrix in the vertex shader.
*
* <p>Operations are done on normalized device 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. The background color will default to black.
*/
@UnstableApi
public final class AdvancedFrameProcessor implements GlFrameProcessor {
Expand Down
Expand Up @@ -36,7 +36,7 @@
@UnstableApi
public interface Codec {

/** A factory for {@link Codec decoder} instances. */
/** A factory for {@linkplain Codec decoder} instances. */
interface DecoderFactory {

/** A default {@code DecoderFactory} implementation. */
Expand Down Expand Up @@ -67,7 +67,7 @@ Codec createForVideoDecoding(
throws TransformationException;
}

/** A factory for {@link Codec encoder} instances. */
/** A factory for {@linkplain Codec encoder} instances. */
interface EncoderFactory {

/** A default {@code EncoderFactory} implementation. */
Expand All @@ -77,13 +77,13 @@ interface EncoderFactory {
* Returns a {@link Codec} for audio encoding.
*
* <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
* format} is not necessarily allowed.
* {@code allowedMimeTypes}. The {@linkplain Format#sampleMimeType sample MIME type} given in
* {@code format} is not necessarily allowed.
*
* @param format The {@link Format} (of the output data) used to determine the underlying
* encoder and its configuration values.
* @param allowedMimeTypes The non-empty list of allowed output sample {@link MimeTypes MIME
* types}.
* @param allowedMimeTypes The non-empty list of allowed output sample {@linkplain MimeTypes
* MIME types}.
* @return A {@link Codec} for audio encoding.
* @throws TransformationException If no suitable {@link Codec} can be created.
*/
Expand All @@ -94,17 +94,17 @@ Codec createForAudioEncoding(Format format, List<String> allowedMimeTypes)
* Returns a {@link Codec} for video encoding.
*
* <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
* format} is not necessarily allowed.
* {@code allowedMimeTypes}. The {@linkplain Format#sampleMimeType sample MIME type} given in
* {@code format} is not necessarily allowed.
*
* @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}
* and {@link Format#height} are set to those of the desired output video format. {@link
* 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
* to the output video's frame rate, if available.
* @param allowedMimeTypes The non-empty list of allowed output sample {@link MimeTypes MIME
* types}.
* @param allowedMimeTypes The non-empty list of allowed output sample {@linkplain MimeTypes
* MIME types}.
* @return A {@link Codec} for video encoding.
* @throws TransformationException If no suitable {@link Codec} can be created.
*/
Expand Down Expand Up @@ -142,8 +142,8 @@ default boolean videoNeedsEncoding() {
/**
* Dequeues a writable input buffer, if available.
*
* <p>This method must not be called from video encoders because they must use {@link Surface
* surfaces} as inputs.
* <p>This method must not be called from video encoders because they must use a {@link Surface}
* to receive input.
*
* @param inputBuffer The buffer where the dequeued buffer data is stored, at {@link
* DecoderInputBuffer#data inputBuffer.data}.
Expand All @@ -153,13 +153,13 @@ default boolean videoNeedsEncoding() {
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.
*
* <p>This method must not be called from video encoders because they must use {@link Surface
* surfaces} as inputs.
* <p>This method must not be called from video encoders because they must use a {@link Surface}
* 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.
*/
void queueInputBuffer(DecoderInputBuffer inputBuffer) throws TransformationException;
Expand All @@ -169,7 +169,8 @@ default boolean videoNeedsEncoding() {
*
* <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
* 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.
*/
Expand Down
Expand Up @@ -199,9 +199,9 @@ public boolean videoNeedsEncoding() {
}

/**
* 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.
*/
@RequiresNonNull("#1.sampleMimeType")
Expand Down Expand Up @@ -402,22 +402,22 @@ private static void adjustMediaFormatForH264EncoderSettings(
private interface EncoderFallbackCost {
/**
* 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}
* does not support the encoding parameters.
* <p>The method must return {@link Integer#MAX_VALUE} when the {@linkplain MediaCodecInfo
* encoder} does not support the encoding parameters.
*/
int getParameterSupportGap(MediaCodecInfo encoderInfo);
}

/**
* Filters a list of {@link MediaCodecInfo encoders} by a {@link EncoderFallbackCost cost
* function}.
* Filters a list of {@linkplain MediaCodecInfo encoders} by a {@linkplain EncoderFallbackCost
* cost function}.
*
* @param encoders A list of {@link MediaCodecInfo encoders}.
* @param cost A {@link EncoderFallbackCost cost function}.
* @return A list of {@link MediaCodecInfo encoders} with the lowest costs, empty if the costs of
* all encoders are {@link Integer#MAX_VALUE}.
* @param encoders A list of {@linkplain MediaCodecInfo encoders}.
* @param cost A {@linkplain EncoderFallbackCost cost function}.
* @return A list of {@linkplain MediaCodecInfo encoders} with the lowest costs, empty if the
* costs of all encoders are {@link Integer#MAX_VALUE}.
*/
private static ImmutableList<MediaCodecInfo> filterEncoders(
List<MediaCodecInfo> encoders, EncoderFallbackCost cost, String filterName) {
Expand Down Expand Up @@ -454,7 +454,7 @@ private static ImmutableList<MediaCodecInfo> filterEncoders(
}

/**
* 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}.
*/
@Nullable
Expand Down
Expand Up @@ -36,8 +36,8 @@ public interface EncoderSelector {
* Returns a list of encoders that can encode media in the specified {@code mimeType}, in priority
* order.
*
* @param mimeType The {@link MimeTypes MIME type} for which an encoder is required.
* @return An unmodifiable list of {@link MediaCodecInfo encoders} that supports the {@code
* @param mimeType The {@linkplain MimeTypes MIME type} for which an encoder is required.
* @return An unmodifiable list of {@linkplain MediaCodecInfo encoders} that support the {@code
* mimeType}. The list may be empty.
*/
List<MediaCodecInfo> selectEncoderInfos(String mimeType);
Expand Down
Expand Up @@ -47,8 +47,8 @@ public final class EncoderUtil {
private static final List<MediaCodecInfo> encoders = new ArrayList<>();

/**
* Returns a list of {@link MediaCodecInfo encoders} that support the given {@code mimeType}, or
* an empty list if there is none.
* Returns a list of {@linkplain MediaCodecInfo encoders} that support the given {@code mimeType},
* or an empty list if there is none.
*/
public static ImmutableList<MediaCodecInfo> getSupportedEncoders(String mimeType) {
maybePopulateEncoderInfos();
Expand All @@ -67,22 +67,22 @@ public static ImmutableList<MediaCodecInfo> getSupportedEncoders(String mimeType
}

/**
* 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
* supported by the {@link MediaCodecInfo encoder}.
* <p>The input resolution is returned, if it (after aligning to the encoder's requirement) is
* supported by the {@linkplain MediaCodecInfo encoder}.
*
* <p>The resolution will be adjusted to be within the {@link MediaCodecInfo encoder}'s range of
* supported resolutions, and will be aligned to the {@link MediaCodecInfo encoder}'s alignment
* requirement. The adjustment process takes into account the original aspect ratio. But the fixed
* resolution may not preserve the original aspect ratio, depending on the encoder's required size
* alignment.
* <p>The resolution will be adjusted to be within the {@linkplain MediaCodecInfo encoder}'s range
* of supported resolutions, and will be aligned to the {@linkplain MediaCodecInfo encoder}'s
* alignment requirement. The adjustment process takes into account the original aspect ratio. But
* the fixed resolution may not preserve the original aspect ratio, depending on the encoder's
* required size alignment.
*
* @param encoderInfo The {@link MediaCodecInfo} of the encoder.
* @param mimeType The output MIME type.
* @param width The original width.
* @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
public static Size getSupportedResolution(
Expand Down Expand Up @@ -136,7 +136,7 @@ public static Size getSupportedResolution(
* Finds the highest supported encoding level given a profile.
*
* @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.
* @return The highest supported encoding level, as documented in {@link
* MediaCodecInfo.CodecProfileLevel}, or {@link #LEVEL_UNSET} if the profile is not supported.
Expand All @@ -157,8 +157,8 @@ public static int findHighestSupportedEncodingLevel(
}

/**
* Finds a {@link MediaCodec codec} that supports the {@link MediaFormat}, or {@code null} if none
* is found.
* Finds a {@link MediaCodec} that supports the {@link MediaFormat}, or {@code null} if none is
* found.
*/
@Nullable
public static String findCodecForFormat(MediaFormat format, boolean isDecoder) {
Expand All @@ -183,7 +183,8 @@ public static String findCodecForFormat(MediaFormat format, boolean isDecoder) {
}

/**
* 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(
MediaCodecInfo encoderInfo, String mimeType, int bitrate) {
Expand All @@ -203,7 +204,7 @@ public static boolean isBitrateModeSupported(
.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) {
// TODO(b/214964116): Merge into MediaCodecUtil.
if (Util.SDK_INT >= 29) {
Expand Down
Expand Up @@ -92,7 +92,7 @@ public void initialize(int inputTexId) throws IOException {
* Sets the texture transform matrix for converting an external surface texture's coordinates to
* 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}.
*/
public void setTextureTransformMatrix(float[] textureTransformMatrix) {
Expand Down
Expand Up @@ -40,7 +40,8 @@
* Creates a new instance.
*
* @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}.
*/
public FallbackListener(
Expand All @@ -56,7 +57,7 @@ public FallbackListener(
/**
* 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}.
*/
public void registerTrack() {
Expand Down
Expand Up @@ -52,12 +52,12 @@
/**
* {@code FrameProcessorChain} applies changes to individual video frames.
*
* <p>Input becomes available on its {@link #getInputSurface() input surface} asynchronously and is
* processed on a background thread as it becomes available. All input frames should be {@link
* #registerInputFrame() registered} before they are rendered to the input surface. {@link
* #getPendingFrameCount()} can be used to check whether there are frames that have not been fully
* processed yet. Output is written to its {@link #configure(Surface, int, int, SurfaceView) output
* surface}.
* <p>Input becomes available on its {@linkplain #getInputSurface() input surface} asynchronously
* and is processed on a background thread as it becomes available. All input frames should be
* {@linkplain #registerInputFrame() registered} before they are rendered to the input surface.
* {@link #getPendingFrameCount()} can be used to check whether there are frames that have not been
* fully processed yet. Output is written to its {@linkplain #configure(Surface, int, int,
* SurfaceView) output surface}.
*/
/* package */ final class FrameProcessorChain {

Expand All @@ -74,7 +74,7 @@
private final ExecutorService singleThreadExecutorService;
/** Futures corresponding to the executor service's pending tasks. */
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;
/** Prevents further frame processing tasks from being scheduled after {@link #release()}. */
private volatile boolean releaseRequested;
Expand Down Expand Up @@ -186,7 +186,7 @@ public Size getOutputSize() {
/**
* 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}.
*
Expand Down Expand Up @@ -253,8 +253,8 @@ public void configure(
/**
* Returns the input {@link Surface}.
*
* <p>The {@code FrameProcessorChain} must be {@link #configure(Surface, int, int, SurfaceView)
* configured}.
* <p>The {@code FrameProcessorChain} must be {@linkplain #configure(Surface, int, int,
* SurfaceView) configured}.
*/
public Surface getInputSurface() {
checkStateNotNull(inputSurface, "The FrameProcessorChain must be configured.");
Expand Down Expand Up @@ -296,8 +296,8 @@ public void getAndRethrowBackgroundExceptions() throws TransformationException {
}

/**
* Returns the number of input frames that have been {@link #registerInputFrame() registered} but
* not completely processed yet.
* Returns the number of input frames that have been {@linkplain #registerInputFrame() registered}
* but not completely processed yet.
*/
public int getPendingFrameCount() {
return pendingFrameCount.get();
Expand All @@ -316,9 +316,9 @@ public void signalEndOfInputStream() {
/**
* Releases all resources.
*
* <p>If the frame processor chain is released before it has {@link #isEnded() ended}, it will
* attempt to cancel processing any input frames that have already become available. Input frames
* that become available after release are ignored.
* <p>If the frame processor chain is released before it has {@linkplain #isEnded() ended}, it
* will attempt to cancel processing any input frames that have already become available. Input
* frames that become available after release are ignored.
*/
public void release() {
releaseRequested = true;
Expand Down Expand Up @@ -447,7 +447,7 @@ private void processFrame() {
}

/**
* 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}.
*
* @param inputWidth The width of frames passed to the first {@link GlFrameProcessor}, in pixels.
Expand Down
Expand Up @@ -221,13 +221,13 @@ public void release(boolean forCancellation) throws MuxerException {
}

/**
* Converts a {@link MimeTypes MIME type} into a {@link MediaMuxer.OutputFormat MediaMuxer output
* format}.
* Converts a {@linkplain MimeTypes MIME type} into a {@linkplain MediaMuxer.OutputFormat
* MediaMuxer output format}.
*
* @param mimeType The {@link MimeTypes MIME type} to convert.
* @return The corresponding {@link MediaMuxer.OutputFormat MediaMuxer output format}.
* @throws IllegalArgumentException If the {@link MimeTypes MIME type} is not supported as output
* format.
* @param mimeType The {@linkplain MimeTypes MIME type} to convert.
* @return The corresponding {@linkplain MediaMuxer.OutputFormat MediaMuxer output format}.
* @throws IllegalArgumentException If the {@linkplain MimeTypes MIME type} is not supported as
* output format.
*/
private static int mimeTypeToMuxerOutputFormat(String mimeType) {
if (mimeType.equals(MimeTypes.VIDEO_MP4)) {
Expand Down

0 comments on commit 8089092

Please sign in to comment.