Fix some Javadoc issues

PiperOrigin-RevId: 320581002
This commit is contained in:
olly 2020-07-10 12:27:28 +01:00 committed by kim-vde
parent efce10c873
commit 09e97cf279
6 changed files with 16 additions and 29 deletions

View File

@ -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.
*
* <p>{@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 {
* <p>The {@code index} must be an input buffer index that has been obtained from a previous call
* to {@link #dequeueInputBufferIndex()}.
*
* <p>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}.
* <p>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}.
*
* <p>Note: {@link #flush()} should also call any {@link MediaCodec} methods needed to flush the
* {@link MediaCodec}, i.e., {@link MediaCodec#flush()} and <em>optionally</em> {@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.
*
* <p>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}.
* <p>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();

View File

@ -83,14 +83,13 @@ import java.util.ArrayDeque;
* <p>Call this <b>after</b> {@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;
}

View File

@ -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(

View File

@ -31,7 +31,7 @@ public interface Downloader {
*
* <p>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.

View File

@ -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 =

View File

@ -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 {