From 09e97cf27919aacdd3bd0e72f09a3e181e49897c Mon Sep 17 00:00:00 2001 From: olly Date: Fri, 10 Jul 2020 12:27:28 +0100 Subject: [PATCH] Fix some Javadoc issues PiperOrigin-RevId: 320581002 --- .../mediacodec/MediaCodecAdapter.java | 29 ++++++------------- .../mediacodec/MediaCodecAsyncCallback.java | 6 ++-- .../exoplayer2/offline/DownloadHelper.java | 2 +- .../exoplayer2/offline/Downloader.java | 2 +- .../mediacodec/BatchBufferTest.java | 4 +-- .../source/hls/HlsMediaSourceTest.java | 2 +- 6 files changed, 16 insertions(+), 29 deletions(-) diff --git a/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecAdapter.java b/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecAdapter.java index a413790847..69875f2367 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecAdapter.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecAdapter.java @@ -22,16 +22,13 @@ import android.media.MediaFormat; import android.view.Surface; import androidx.annotation.Nullable; import com.google.android.exoplayer2.decoder.CryptoInfo; +import com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.MediaCodecOperationMode; /** * Abstracts {@link MediaCodec} operations. * *

{@code MediaCodecAdapter} offers a common interface to interact with a {@link MediaCodec} - * regardless of the {@link - * com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.MediaCodecOperationMode} the {@link - * MediaCodec} is operating in. - * - * @see com.google.android.exoplayer2.mediacodec.MediaCodecRenderer.MediaCodecOperationMode + * regardless of the {@link MediaCodecOperationMode} the {@link MediaCodec} is operating in. */ public interface MediaCodecAdapter { @@ -97,31 +94,23 @@ public interface MediaCodecAdapter { *

The {@code index} must be an input buffer index that has been obtained from a previous call * to {@link #dequeueInputBufferIndex()}. * - *

Note: This method behaves as {@link MediaCodec#queueSecureInputBuffer} with the difference - * that {@code info} is of type {@link CryptoInfo} and not {@link - * android.media.MediaCodec.CryptoInfo}. + *

This method behaves like {@link MediaCodec#queueSecureInputBuffer}, with the difference that + * {@code info} is of type {@link CryptoInfo} and not {@link android.media.MediaCodec.CryptoInfo}. * * @see MediaCodec#queueSecureInputBuffer */ void queueSecureInputBuffer( int index, int offset, CryptoInfo info, long presentationTimeUs, int flags); - /** - * Flushes the {@code MediaCodecAdapter}. - * - *

Note: {@link #flush()} should also call any {@link MediaCodec} methods needed to flush the - * {@link MediaCodec}, i.e., {@link MediaCodec#flush()} and optionally {@link - * MediaCodec#start()}, if the {@link MediaCodec} operates in asynchronous mode. - */ + /** Flushes both the adapter and the underlying {@link MediaCodec}. */ void flush(); /** - * Shutdown the {@code MediaCodecAdapter}. + * Shuts down the adapter. * - *

Note: This method does not release the underlying {@link MediaCodec}. Make sure to call - * {@link #shutdown()} before stopping or releasing the underlying {@link MediaCodec} to ensure - * the adapter is fully shutdown before the {@link MediaCodec} stops executing. Otherwise, there - * is a risk the adapter might interact with a stopped or released {@link MediaCodec}. + *

This method does not stop or release the underlying {@link MediaCodec}. It should be called + * before stopping or releasing the {@link MediaCodec} to avoid the possibility of the adapter + * interacting with a stopped or released {@link MediaCodec}. */ void shutdown(); diff --git a/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecAsyncCallback.java b/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecAsyncCallback.java index abb5d87343..65f0c266a9 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecAsyncCallback.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecAsyncCallback.java @@ -83,14 +83,13 @@ import java.util.ArrayDeque; *

Call this after {@link #dequeueOutputBufferIndex} returned {@link * MediaCodec#INFO_OUTPUT_FORMAT_CHANGED}. * - * @throws {@link IllegalStateException} if you call this method before before { - * @link #dequeueOutputBufferIndex} returned {@link MediaCodec#INFO_OUTPUT_FORMAT_CHANGED}. + * @throws IllegalStateException If called before {@link #dequeueOutputBufferIndex} has returned + * {@link MediaCodec#INFO_OUTPUT_FORMAT_CHANGED}. */ public MediaFormat getOutputFormat() throws IllegalStateException { if (currentFormat == null) { throw new IllegalStateException(); } - return currentFormat; } @@ -101,7 +100,6 @@ import java.util.ArrayDeque; public void maybeThrowMediaCodecException() throws IllegalStateException { IllegalStateException exception = mediaCodecException; mediaCodecException = null; - if (exception != null) { throw exception; } diff --git a/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java b/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java index 51b939f6ce..018af45264 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java @@ -429,7 +429,7 @@ public final class DownloadHelper { } /** - * Equivalent to {@link #createMediaSource(DownloadRequest, Factory, DrmSessionManager) + * Equivalent to {@link #createMediaSource(DownloadRequest, DataSource.Factory, DrmSessionManager) * createMediaSource(downloadRequest, dataSourceFactory, null)}. */ public static MediaSource createMediaSource( diff --git a/library/core/src/main/java/com/google/android/exoplayer2/offline/Downloader.java b/library/core/src/main/java/com/google/android/exoplayer2/offline/Downloader.java index 8e51bf685e..1059157d34 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/offline/Downloader.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/offline/Downloader.java @@ -31,7 +31,7 @@ public interface Downloader { * *

May be called directly from {@link #download}, or from any other thread used by the * downloader. In all cases, {@link #download} is guaranteed not to return until after the last - * call to {@link #onProgress} has finished executing. + * call to this method has finished executing. * * @param contentLength The length of the content in bytes, or {@link C#LENGTH_UNSET} if * unknown. diff --git a/library/core/src/test/java/com/google/android/exoplayer2/mediacodec/BatchBufferTest.java b/library/core/src/test/java/com/google/android/exoplayer2/mediacodec/BatchBufferTest.java index 909608e90c..a48dcf7945 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/mediacodec/BatchBufferTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/mediacodec/BatchBufferTest.java @@ -32,9 +32,9 @@ import org.junit.runner.RunWith; @RunWith(AndroidJUnit4.class) public final class BatchBufferTest { - /** Bigger than {@link BatchBuffer#BATCH_SIZE_BYTES} */ + /** Bigger than {@code BatchBuffer.BATCH_SIZE_BYTES} */ private static final int BUFFER_SIZE_LARGER_THAN_BATCH_SIZE_BYTES = 100 * 1000 * 1000; - /** Smaller than {@link BatchBuffer#BATCH_SIZE_BYTES} */ + /** Smaller than {@code BatchBuffer.BATCH_SIZE_BYTES} */ private static final int BUFFER_SIZE_MUCH_SMALLER_THAN_BATCH_SIZE_BYTES = 100; private static final byte[] TEST_ACCESS_UNIT = diff --git a/library/hls/src/test/java/com/google/android/exoplayer2/source/hls/HlsMediaSourceTest.java b/library/hls/src/test/java/com/google/android/exoplayer2/source/hls/HlsMediaSourceTest.java index 418e51dd33..7001417186 100644 --- a/library/hls/src/test/java/com/google/android/exoplayer2/source/hls/HlsMediaSourceTest.java +++ b/library/hls/src/test/java/com/google/android/exoplayer2/source/hls/HlsMediaSourceTest.java @@ -27,7 +27,7 @@ import java.util.Collections; import org.junit.Test; import org.junit.runner.RunWith; -/** Unit test for {@link DashMediaSource}. */ +/** Unit test for {@link HlsMediaSource}. */ @RunWith(AndroidJUnit4.class) public class HlsMediaSourceTest {