Simple language + Javadoc consistency

- Invoked --> Called
- Gets --> Returns
- "True if X. False otherwise." --> "Whether X."
- Removed some @returns where the Javadoc is in "Returns X" form

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128678638
This commit is contained in:
olly 2016-07-28 02:27:52 -07:00 committed by Oliver Woodman
parent dfdb3bbc95
commit 2f20fd7c03
78 changed files with 232 additions and 287 deletions

View File

@ -395,7 +395,7 @@ public class PlayerActivity extends Activity implements SurfaceHolder.Callback,
* requests permission. * requests permission.
* *
* @param uris URIs that may require {@link permission#READ_EXTERNAL_STORAGE} to play. * @param uris URIs that may require {@link permission#READ_EXTERNAL_STORAGE} to play.
* @return True if a permission request is made. False if it is not necessary. * @return Whether a permission request was made.
*/ */
@TargetApi(23) @TargetApi(23)
private boolean maybeRequestPermission(Uri... uris) { private boolean maybeRequestPermission(Uri... uris) {

View File

@ -177,7 +177,7 @@ public abstract class BaseRenderer implements Renderer, RendererCapabilities {
} }
/** /**
* Invoked when the position is reset. This occurs when the renderer is enabled after * Called when the position is reset. This occurs when the renderer is enabled after
* {@link #onStreamChanged(Format[])} has been called, and also when a position discontinuity * {@link #onStreamChanged(Format[])} has been called, and also when a position discontinuity
* is encountered. * is encountered.
* <p> * <p>
@ -257,7 +257,7 @@ public abstract class BaseRenderer implements Renderer, RendererCapabilities {
/** /**
* Returns whether the upstream source is ready. * Returns whether the upstream source is ready.
* *
* @return True if the source is ready. False otherwise. * @return Whether the source is ready.
*/ */
protected final boolean isSourceReady() { protected final boolean isSourceReady() {
return readEndOfStream ? streamIsFinal : stream.isReady(); return readEndOfStream ? streamIsFinal : stream.isReady();

View File

@ -65,8 +65,8 @@ import com.google.android.exoplayer2.source.Timeline;
* discouraged, however if an application does wish to do this then it may do so provided that it * discouraged, however if an application does wish to do this then it may do so provided that it
* ensures accesses are synchronized. * ensures accesses are synchronized.
* </li> * </li>
* <li>Registered {@link EventListener}s are invoked on the thread that created the * <li>Registered {@link EventListener}s are called on the thread that created the {@link ExoPlayer}
* {@link ExoPlayer} instance.</li> * instance.</li>
* <li>An internal playback thread is responsible for managing playback and invoking the * <li>An internal playback thread is responsible for managing playback and invoking the
* {@link Renderer}s in order to load and play the media.</li> * {@link Renderer}s in order to load and play the media.</li>
* <li>{@link Renderer} implementations (or any upstream components that they depend on) may * <li>{@link Renderer} implementations (or any upstream components that they depend on) may
@ -89,7 +89,7 @@ import com.google.android.exoplayer2.source.Timeline;
* *
* <p>The possible playback state transitions are shown below. Transitions can be triggered either * <p>The possible playback state transitions are shown below. Transitions can be triggered either
* by changes in the state of the {@link Renderer}s being used, or as a result of * by changes in the state of the {@link Renderer}s being used, or as a result of
* {@link #setMediaSource(MediaSource)}, {@link #stop()} or {@link #release()} being invoked.</p> * {@link #setMediaSource(MediaSource)}, {@link #stop()} or {@link #release()} being called.</p>
* <p align="center"><img src="doc-files/exoplayer-playbackstate.png" * <p align="center"><img src="doc-files/exoplayer-playbackstate.png"
* alt="ExoPlayer playback state transitions" * alt="ExoPlayer playback state transitions"
* border="0"/></p> * border="0"/></p>
@ -102,14 +102,14 @@ public interface ExoPlayer {
interface EventListener { interface EventListener {
/** /**
* Invoked when the player starts or stops loading the source. * Called when the player starts or stops loading the source.
* *
* @param isLoading Whether the source is currently being loaded. * @param isLoading Whether the source is currently being loaded.
*/ */
void onLoadingChanged(boolean isLoading); void onLoadingChanged(boolean isLoading);
/** /**
* Invoked when the value returned from either {@link ExoPlayer#getPlayWhenReady()} or * Called when the value returned from either {@link ExoPlayer#getPlayWhenReady()} or
* {@link ExoPlayer#getPlaybackState()} changes. * {@link ExoPlayer#getPlaybackState()} changes.
* *
* @param playWhenReady Whether playback will proceed when ready. * @param playWhenReady Whether playback will proceed when ready.
@ -119,19 +119,19 @@ public interface ExoPlayer {
void onPlayerStateChanged(boolean playWhenReady, int playbackState); void onPlayerStateChanged(boolean playWhenReady, int playbackState);
/** /**
* Invoked when the current value of {@link ExoPlayer#getPlayWhenReady()} has been reflected * Called when the current value of {@link ExoPlayer#getPlayWhenReady()} has been reflected by
* by the internal playback thread. * the internal playback thread.
* <p> * <p>
* An invocation of this method will shortly follow any call to * An invocation of this method will shortly follow any call to
* {@link ExoPlayer#setPlayWhenReady(boolean)} that changes the state. If multiple calls are * {@link ExoPlayer#setPlayWhenReady(boolean)} that changes the state. If multiple calls are
* made in rapid succession, then this method will be invoked only once, after the final state * made in rapid succession, then this method will be called only once, after the final state
* has been reflected. * has been reflected.
*/ */
void onPlayWhenReadyCommitted(); void onPlayWhenReadyCommitted();
// TODO[playlists]: Should source-initiated resets also cause this to be invoked? // TODO[playlists]: Should source-initiated resets also cause this to be called?
/** /**
* Invoked when the player's position changes due to a discontinuity (seeking or playback * Called when the player's position changes due to a discontinuity (seeking or playback
* transitioning to the next period). * transitioning to the next period).
* *
* @param periodIndex The index of the period being played. * @param periodIndex The index of the period being played.
@ -140,17 +140,17 @@ public interface ExoPlayer {
void onPositionDiscontinuity(int periodIndex, long positionMs); void onPositionDiscontinuity(int periodIndex, long positionMs);
/** /**
* Invoked when the timeline changes. * Called when the timeline changes.
* *
* @param timeline The new timeline. * @param timeline The new timeline.
*/ */
void onTimelineChanged(Timeline timeline); void onTimelineChanged(Timeline timeline);
/** /**
* Invoked when an error occurs. The playback state will transition to * Called when an error occurs. The playback state will transition to
* {@link ExoPlayer#STATE_IDLE} immediately after this method is invoked. The player instance * {@link ExoPlayer#STATE_IDLE} immediately after this method is called. The player instance can
* can still be used, and {@link ExoPlayer#release()} must still be called on the player should * still be used, and {@link ExoPlayer#release()} must still be called on the player should it
* it no longer be required. * no longer be required.
* *
* @param error The error. * @param error The error.
*/ */
@ -167,7 +167,7 @@ public interface ExoPlayer {
interface ExoPlayerComponent { interface ExoPlayerComponent {
/** /**
* Handles a message delivered to the component. Invoked on the playback thread. * Handles a message delivered to the component. Called on the playback thread.
* *
* @param messageType An integer identifying the type of message. * @param messageType An integer identifying the type of message.
* @param message The message object. * @param message The message object.
@ -225,8 +225,8 @@ public interface ExoPlayer {
long UNKNOWN_TIME = -1; long UNKNOWN_TIME = -1;
/** /**
* Register a listener to receive events from the player. The listener's methods will be invoked * Register a listener to receive events from the player. The listener's methods will be called on
* on the thread that was used to construct the player. * the thread that was used to construct the player.
* *
* @param listener The listener to register. * @param listener The listener to register.
*/ */
@ -274,14 +274,14 @@ public interface ExoPlayer {
* Whether the current value of {@link ExoPlayer#getPlayWhenReady()} has been reflected by the * Whether the current value of {@link ExoPlayer#getPlayWhenReady()} has been reflected by the
* internal playback thread. * internal playback thread.
* *
* @return True if the current value has been reflected. False otherwise. * @return Whether the current value has been reflected.
*/ */
boolean isPlayWhenReadyCommitted(); boolean isPlayWhenReadyCommitted();
/** /**
* Whether the player is currently loading the source. * Whether the player is currently loading the source.
* *
* @return True if the player is currently loading the source. False otherwise. * @return Whether the player is currently loading the source.
*/ */
boolean isLoading(); boolean isLoading();
@ -313,9 +313,8 @@ public interface ExoPlayer {
void stop(); void stop();
/** /**
* Releases the player. This method must be called when the player is no longer required. * Releases the player. This method must be called when the player is no longer required. The
* <p> * player must not be used after calling this method.
* The player must not be used after calling this method.
*/ */
void release(); void release();
@ -337,47 +336,35 @@ public interface ExoPlayer {
void blockingSendMessages(ExoPlayerMessage... messages); void blockingSendMessages(ExoPlayerMessage... messages);
/** /**
* Gets the duration of the current period in milliseconds. * Returns the duration of the current period in milliseconds, or {@link ExoPlayer#UNKNOWN_TIME}
* * if the duration is not known.
* @return The duration of the current period in milliseconds, or {@link ExoPlayer#UNKNOWN_TIME}
* if the duration is not known.
*/ */
long getDuration(); long getDuration();
/** /**
* Gets the playback position in the current period, in milliseconds. * Returns the playback position in the current period, in milliseconds.
*
* @return The playback position in the current period, in milliseconds.
*/ */
long getCurrentPosition(); long getCurrentPosition();
/** /**
* Gets the index of the current period. * Returns the index of the current period.
*
* @return The index of the current period.
*/ */
int getCurrentPeriodIndex(); int getCurrentPeriodIndex();
/** /**
* Gets the current {@link Timeline}, or {@code null} if there is no timeline. * Returns the current {@link Timeline}, or {@code null} if there is no timeline.
*
* @return The current {@link Timeline}, or {@code null} if there is no timeline.
*/ */
Timeline getCurrentTimeline(); Timeline getCurrentTimeline();
/** /**
* Gets an estimate of the absolute position in milliseconds up to which data is buffered. * Returns an estimate of the absolute position in milliseconds up to which data is buffered,
* * or {@link ExoPlayer#UNKNOWN_TIME} if no estimate is available.
* @return An estimate of the absolute position in milliseconds up to which data is buffered,
* or {@link ExoPlayer#UNKNOWN_TIME} if no estimate is available.
*/ */
long getBufferedPosition(); long getBufferedPosition();
/** /**
* Gets an estimate of the percentage into the media up to which data is buffered. * Returns an estimate of the percentage into the media up to which data is buffered, or 0 if no
* * estimate is available.
* @return An estimate of the percentage into the media up to which data is buffered. 0 if the
* duration of the media is not known or if no estimate is available.
*/ */
int getBufferedPercentage(); int getBufferedPercentage();

View File

@ -56,7 +56,7 @@ import java.util.concurrent.CopyOnWriteArraySet;
private long maskingDurationMs; private long maskingDurationMs;
/** /**
* Constructs an instance. Must be invoked from a thread that has an associated {@link Looper}. * Constructs an instance. Must be called from a thread that has an associated {@link Looper}.
* *
* @param renderers The {@link Renderer}s that will be used by the instance. * @param renderers The {@link Renderer}s that will be used by the instance.
* @param trackSelector The {@link TrackSelector} that will be used by the instance. * @param trackSelector The {@link TrackSelector} that will be used by the instance.

View File

@ -426,7 +426,7 @@ import java.util.ArrayList;
boolean allRenderersEnded = true; boolean allRenderersEnded = true;
boolean allRenderersReadyOrEnded = true; boolean allRenderersReadyOrEnded = true;
for (Renderer renderer : enabledRenderers) { for (Renderer renderer : enabledRenderers) {
// TODO: Each renderer should return the maximum delay before which it wishes to be invoked // TODO: Each renderer should return the maximum delay before which it wishes to be called
// again. The minimum of these values should then be used as the delay before the next // again. The minimum of these values should then be used as the delay before the next
// invocation of this method. // invocation of this method.
renderer.render(internalPositionUs, elapsedRealtimeUs); renderer.render(internalPositionUs, elapsedRealtimeUs);

View File

@ -27,7 +27,7 @@ import com.google.android.exoplayer2.upstream.Allocator;
public interface LoadControl { public interface LoadControl {
/** /**
* Invoked by the player when a track selection occurs. * Called by the player when a track selection occurs.
* *
* @param renderers The renderers. * @param renderers The renderers.
* @param trackGroups The available {@link TrackGroup}s. * @param trackGroups The available {@link TrackGroup}s.
@ -37,32 +37,30 @@ public interface LoadControl {
TrackSelectionArray trackSelections); TrackSelectionArray trackSelections);
/** /**
* Invoked by the player when a reset occurs, meaning all renderers have been disabled. * Called by the player when a reset occurs, meaning all renderers have been disabled.
*/ */
void reset(); void reset();
/** /**
* Gets the {@link Allocator} that should be used to obtain media buffer allocations. * Returns the {@link Allocator} that should be used to obtain media buffer allocations.
*
* @return The {@link Allocator}.
*/ */
Allocator getAllocator(); Allocator getAllocator();
/** /**
* Invoked by the player to determine whether sufficient media is buffered for playback to be * Called by the player to determine whether sufficient media is buffered for playback to be
* started or resumed. * started or resumed.
* *
* @param bufferedDurationUs The duration of media that's currently buffered. * @param bufferedDurationUs The duration of media that's currently buffered.
* @param rebuffering Whether the player is re-buffering. * @param rebuffering Whether the player is re-buffering.
* @return True if playback should be allowed to start or resume. False otherwise. * @return Whether playback should be allowed to start or resume.
*/ */
boolean shouldStartPlayback(long bufferedDurationUs, boolean rebuffering); boolean shouldStartPlayback(long bufferedDurationUs, boolean rebuffering);
/** /**
* Invoked by the player to determine whether it should continue to load the source. * Called by the player to determine whether it should continue to load the source.
* *
* @param bufferedDurationUs The duration of media that's currently buffered. * @param bufferedDurationUs The duration of media that's currently buffered.
* @return True if the loading should continue. False otherwise. * @return Whether the loading should continue.
*/ */
boolean shouldContinueLoading(long bufferedDurationUs); boolean shouldContinueLoading(long bufferedDurationUs);

View File

@ -26,7 +26,7 @@ import java.io.IOException;
* <p> * <p>
* Internally, a renderer's lifecycle is managed by the owning {@link ExoPlayer}. The player will * Internally, a renderer's lifecycle is managed by the owning {@link ExoPlayer}. The player will
* transition its renderers through various states as the overall playback state changes. The valid * transition its renderers through various states as the overall playback state changes. The valid
* state transitions are shown below, annotated with the methods that are invoked during each * state transitions are shown below, annotated with the methods that are called during each
* transition. * transition.
* <p align="center"><img src="doc-files/renderer-states.png" * <p align="center"><img src="doc-files/renderer-states.png"
* alt="Renderer state transitions" * alt="Renderer state transitions"
@ -210,7 +210,7 @@ public interface Renderer extends ExoPlayerComponent {
* This method may be called when the renderer is in the following states: * This method may be called when the renderer is in the following states:
* {@link #STATE_ENABLED}, {@link #STATE_STARTED}. * {@link #STATE_ENABLED}, {@link #STATE_STARTED}.
* *
* @return True if the renderer is ready to render media. False otherwise. * @return Whether the renderer is ready to render media.
*/ */
boolean isReady(); boolean isReady();

View File

@ -1177,7 +1177,7 @@ public final class AudioTrack {
* Updates the values returned by {@link #getTimestampNanoTime()} and * Updates the values returned by {@link #getTimestampNanoTime()} and
* {@link #getTimestampFramePosition()}. * {@link #getTimestampFramePosition()}.
* *
* @return True if the timestamp values were updated. False otherwise. * @return Whether the timestamp values were updated.
*/ */
public boolean updateTimestamp() { public boolean updateTimestamp() {
return false; return false;

View File

@ -182,7 +182,7 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
* passthrough is supported. * passthrough is supported.
* *
* @param mimeType The type of input media. * @param mimeType The type of input media.
* @return True if passthrough playback should be used. False otherwise. * @return Whether passthrough playback should be used.
*/ */
protected boolean allowPassthrough(String mimeType) { protected boolean allowPassthrough(String mimeType) {
return audioTrack.isPassthroughSupported(mimeType); return audioTrack.isPassthroughSupported(mimeType);
@ -236,7 +236,7 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
/** /**
* Called when the audio session id becomes known. Once the id is known it will not change (and * Called when the audio session id becomes known. Once the id is known it will not change (and
* hence this method will not be invoked again) unless the renderer is disabled and then * hence this method will not be called again) unless the renderer is disabled and then
* subsequently re-enabled. * subsequently re-enabled.
* <p> * <p>
* The default implementation is a no-op. One reason for overriding this method would be to * The default implementation is a no-op. One reason for overriding this method would be to

View File

@ -295,8 +295,8 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements
} }
/** /**
* Invoked when the audio session id becomes known. Once the id is known it will not change * Called when the audio session id becomes known. Once the id is known it will not change (and
* (and hence this method will not be invoked again) unless the renderer is disabled and then * hence this method will not be called again) unless the renderer is disabled and then
* subsequently re-enabled. * subsequently re-enabled.
* <p> * <p>
* The default implementation is a no-op. * The default implementation is a no-op.

View File

@ -61,9 +61,9 @@ public final class DecoderCounters {
public int maxConsecutiveDroppedOutputBufferCount; public int maxConsecutiveDroppedOutputBufferCount;
/** /**
* Should be invoked from the playback thread after the counters have been updated. Should also * Should be called to ensure counter values are made visible across threads. The playback thread
* be invoked from any other thread that wishes to read the counters, before reading. These calls * should call this method after updating the counter values. Any other thread should call this
* ensure that counter updates are made visible to the reading threads. * method before reading the counters.
*/ */
public synchronized void ensureUpdated() { public synchronized void ensureUpdated() {
// Do nothing. The use of synchronized ensures a memory barrier should another thread also // Do nothing. The use of synchronized ensures a memory barrier should another thread also

View File

@ -279,7 +279,7 @@ public abstract class SimpleDecoder<I extends DecoderInputBuffer, O extends Outp
* {@code inputBuffer}, but may be set/unset as required. If the flag is set when the call * {@code inputBuffer}, but may be set/unset as required. If the flag is set when the call
* returns then the output buffer will not be made available to dequeue. The output buffer * returns then the output buffer will not be made available to dequeue. The output buffer
* may not have been populated in this case. * may not have been populated in this case.
* @param reset True if the decoder must be reset before decoding. * @param reset Whether the decoder must be reset before decoding.
* @return A decoder exception if an error occurred, or null if decoding was successful. * @return A decoder exception if an error occurred, or null if decoding was successful.
*/ */
protected abstract E decode(I inputBuffer, O outputBuffer, boolean reset); protected abstract E decode(I inputBuffer, O outputBuffer, boolean reset);

View File

@ -217,7 +217,7 @@ public final class DrmInitData implements Comparator<SchemeData>, Parcelable {
* Returns whether this initialization data applies to the specified scheme. * Returns whether this initialization data applies to the specified scheme.
* *
* @param schemeUuid The scheme {@link UUID}. * @param schemeUuid The scheme {@link UUID}.
* @return True if this initialization data applies to the specified scheme. False otherwise. * @return Whether this initialization data applies to the specified scheme.
*/ */
public boolean matches(UUID schemeUuid) { public boolean matches(UUID schemeUuid) {
return C.UUID_NIL.equals(uuid) || schemeUuid.equals(uuid); return C.UUID_NIL.equals(uuid) || schemeUuid.equals(uuid);

View File

@ -46,7 +46,7 @@ public interface DrmSession {
int STATE_OPENED_WITH_KEYS = 4; int STATE_OPENED_WITH_KEYS = 4;
/** /**
* Gets the current state of the session. * Returns the current state of the session.
* *
* @return One of {@link #STATE_ERROR}, {@link #STATE_CLOSED}, {@link #STATE_OPENING}, * @return One of {@link #STATE_ERROR}, {@link #STATE_CLOSED}, {@link #STATE_OPENING},
* {@link #STATE_OPENED} and {@link #STATE_OPENED_WITH_KEYS}. * {@link #STATE_OPENED} and {@link #STATE_OPENED_WITH_KEYS}.
@ -54,7 +54,7 @@ public interface DrmSession {
int getState(); int getState();
/** /**
* Gets a {@link MediaCrypto} for the open session. * Returns a {@link MediaCrypto} for the open session.
* <p> * <p>
* This method may be called when the manager is in the following states: * This method may be called when the manager is in the following states:
* {@link #STATE_OPENED}, {@link #STATE_OPENED_WITH_KEYS} * {@link #STATE_OPENED}, {@link #STATE_OPENED_WITH_KEYS}
@ -80,7 +80,7 @@ public interface DrmSession {
boolean requiresSecureDecoderComponent(String mimeType); boolean requiresSecureDecoderComponent(String mimeType);
/** /**
* Gets the cause of the error state. * Returns the cause of the error state.
* <p> * <p>
* This method may be called when the manager is in any state. * This method may be called when the manager is in any state.
* *

View File

@ -43,7 +43,7 @@ public final class DefaultTrackOutput implements TrackOutput {
public interface UpstreamFormatChangedListener { public interface UpstreamFormatChangedListener {
/** /**
* Invoked on the loading thread when an upstream format change occurs. * Called on the loading thread when an upstream format change occurs.
* *
* @param format The new upstream format. * @param format The new upstream format.
*/ */
@ -99,7 +99,7 @@ public final class DefaultTrackOutput implements TrackOutput {
/** /**
* Resets the output. * Resets the output.
* *
* @param enable True if the output should be enabled. False if it should be disabled. * @param enable Whether the output should be enabled. False if it should be disabled.
*/ */
public void reset(boolean enable) { public void reset(boolean enable) {
int previousState = state.getAndSet(enable ? STATE_ENABLED : STATE_DISABLED); int previousState = state.getAndSet(enable ? STATE_ENABLED : STATE_DISABLED);
@ -230,7 +230,7 @@ public final class DefaultTrackOutput implements TrackOutput {
* Attempts to skip to the keyframe before the specified time, if it's present in the buffer. * Attempts to skip to the keyframe before the specified time, if it's present in the buffer.
* *
* @param timeUs The seek time. * @param timeUs The seek time.
* @return True if the skip was successful. False otherwise. * @return Whether the skip was successful.
*/ */
public boolean skipToKeyframeBefore(long timeUs) { public boolean skipToKeyframeBefore(long timeUs) {
long nextOffset = infoQueue.skipToKeyframeBefore(timeUs); long nextOffset = infoQueue.skipToKeyframeBefore(timeUs);

View File

@ -21,7 +21,7 @@ package com.google.android.exoplayer2.extractor;
public interface ExtractorOutput { public interface ExtractorOutput {
/** /**
* Invoked when the {@link Extractor} identifies the existence of a track in the stream. * Called when the {@link Extractor} identifies the existence of a track in the stream.
* <p> * <p>
* Returns a {@link TrackOutput} that will receive track level data belonging to the track. * Returns a {@link TrackOutput} that will receive track level data belonging to the track.
* *
@ -31,13 +31,13 @@ public interface ExtractorOutput {
TrackOutput track(int trackId); TrackOutput track(int trackId);
/** /**
* Invoked when all tracks have been identified, meaning that {@link #track(int)} will not be * Called when all tracks have been identified, meaning that {@link #track(int)} will not be
* invoked again. * called again.
*/ */
void endTracks(); void endTracks();
/** /**
* Invoked when a {@link SeekMap} has been extracted from the stream. * Called when a {@link SeekMap} has been extracted from the stream.
* *
* @param seekMap The extracted {@link SeekMap}. * @param seekMap The extracted {@link SeekMap}.
*/ */

View File

@ -60,7 +60,7 @@ public interface SeekMap {
* If seeking is not supported then the only valid seek position is the start of the file, and so * If seeking is not supported then the only valid seek position is the start of the file, and so
* {@link #getPosition(long)} will return 0 for all input values. * {@link #getPosition(long)} will return 0 for all input values.
* *
* @return True if seeking is supported. False otherwise. * @return Whether seeking is supported.
*/ */
boolean isSeekable(); boolean isSeekable();

View File

@ -28,14 +28,14 @@ import java.io.IOException;
public interface TrackOutput { public interface TrackOutput {
/** /**
* Invoked when the {@link Format} of the track has been extracted from the stream. * Called when the {@link Format} of the track has been extracted from the stream.
* *
* @param format The extracted {@link Format}. * @param format The extracted {@link Format}.
*/ */
void format(Format format); void format(Format format);
/** /**
* Invoked to write sample data to the output. * Called to write sample data to the output.
* *
* @param input An {@link ExtractorInput} from which to read the sample data. * @param input An {@link ExtractorInput} from which to read the sample data.
* @param length The maximum length to read from the input. * @param length The maximum length to read from the input.
@ -50,7 +50,7 @@ public interface TrackOutput {
throws IOException, InterruptedException; throws IOException, InterruptedException;
/** /**
* Invoked to write sample data to the output. * Called to write sample data to the output.
* *
* @param data A {@link ParsableByteArray} from which to read the sample data. * @param data A {@link ParsableByteArray} from which to read the sample data.
* @param length The number of bytes to read. * @param length The number of bytes to read.
@ -58,7 +58,7 @@ public interface TrackOutput {
void sampleData(ParsableByteArray data, int length); void sampleData(ParsableByteArray data, int length);
/** /**
* Invoked when metadata associated with a sample has been extracted from the stream. * Called when metadata associated with a sample has been extracted from the stream.
* <p> * <p>
* The corresponding sample data will have already been passed to the output via calls to * The corresponding sample data will have already been passed to the output via calls to
* {@link #sampleData(ExtractorInput, int, boolean)} or * {@link #sampleData(ExtractorInput, int, boolean)} or

View File

@ -70,8 +70,7 @@ import com.google.android.exoplayer2.util.ParsableByteArray;
* Parses tag header. * Parses tag header.
* *
* @param data Buffer where the tag header is stored. * @param data Buffer where the tag header is stored.
* @return True if the header was parsed successfully and the payload should be read. False * @return Whether the header was parsed successfully.
* otherwise.
* @throws ParserException If an error occurs parsing the header. * @throws ParserException If an error occurs parsing the header.
*/ */
protected abstract boolean parseHeader(ParsableByteArray data) throws ParserException; protected abstract boolean parseHeader(ParsableByteArray data) throws ParserException;

View File

@ -40,7 +40,7 @@ import java.io.IOException;
* Checks if the given id is that of a level 1 element. * Checks if the given id is that of a level 1 element.
* *
* @param id The element ID. * @param id The element ID.
* @return True the given id is that of a level 1 element. false otherwise. * @return Whether the given id is that of a level 1 element.
*/ */
boolean isLevel1Element(int id); boolean isLevel1Element(int id);
@ -102,7 +102,7 @@ import java.io.IOException;
* Implementations are required to consume the whole remainder of the element, which is * Implementations are required to consume the whole remainder of the element, which is
* {@code contentSize} bytes in length, before returning. Implementations are permitted to fail * {@code contentSize} bytes in length, before returning. Implementations are permitted to fail
* (by throwing an exception) having partially consumed the data, however if they do this, they * (by throwing an exception) having partially consumed the data, however if they do this, they
* must consume the remainder of the content when invoked again. * must consume the remainder of the content when called again.
* *
* @param id The element ID. * @param id The element ID.
* @param contentsSize The element's content size. * @param contentsSize The element's content size.

View File

@ -1070,7 +1070,7 @@ public final class MatroskaExtractor implements Extractor {
* *
* @param seekPosition The holder whose position will be updated. * @param seekPosition The holder whose position will be updated.
* @param currentPosition Current position of the input. * @param currentPosition Current position of the input.
* @return true if the seek position was updated, false otherwise. * @return Whether the seek position was updated.
*/ */
private boolean maybeSeekForCues(PositionHolder seekPosition, long currentPosition) { private boolean maybeSeekForCues(PositionHolder seekPosition, long currentPosition) {
if (seekForCues) { if (seekForCues) {
@ -1553,7 +1553,7 @@ public final class MatroskaExtractor implements Extractor {
/** /**
* Parses an MS/ACM codec private, returning whether it indicates PCM audio. * Parses an MS/ACM codec private, returning whether it indicates PCM audio.
* *
* @return True if the codec private indicates PCM audio. False otherwise. * @return Whether the codec private indicates PCM audio.
* @throws ParserException If a parsing error occurs. * @throws ParserException If a parsing error occurs.
*/ */
private static boolean parseMsAcmCodecPrivate(ParsableByteArray buffer) throws ParserException { private static boolean parseMsAcmCodecPrivate(ParsableByteArray buffer) throws ParserException {

View File

@ -202,7 +202,7 @@ import java.util.List;
} }
/** /**
* Gets the child leaf of the given type. * Returns the child leaf of the given type.
* <p> * <p>
* If no child exists with the given type then null is returned. If multiple children exist with * If no child exists with the given type then null is returned. If multiple children exist with
* the given type then the first one to have been added is returned. * the given type then the first one to have been added is returned.
@ -222,7 +222,7 @@ import java.util.List;
} }
/** /**
* Gets the child container of the given type. * Returns the child container of the given type.
* <p> * <p>
* If no child exists with the given type then null is returned. If multiple children exist with * If no child exists with the given type then null is returned. If multiple children exist with
* the given type then the first one to have been added is returned. * the given type then the first one to have been added is returned.

View File

@ -129,7 +129,7 @@ public final class FragmentedMp4Extractor implements Extractor {
// Extractor output. // Extractor output.
private ExtractorOutput extractorOutput; private ExtractorOutput extractorOutput;
// Whether extractorOutput.seekMap has been invoked. // Whether extractorOutput.seekMap has been called.
private boolean haveOutputSeekMap; private boolean haveOutputSeekMap;
public FragmentedMp4Extractor() { public FragmentedMp4Extractor() {
@ -877,7 +877,7 @@ public final class FragmentedMp4Extractor implements Extractor {
* this case the method can be called again to extract the remainder of the sample. * this case the method can be called again to extract the remainder of the sample.
* *
* @param input The {@link ExtractorInput} from which to read data. * @param input The {@link ExtractorInput} from which to read data.
* @return True if a sample was extracted. False otherwise. * @return Whether a sample was extracted.
* @throws IOException If an error occurs reading from the input. * @throws IOException If an error occurs reading from the input.
* @throws InterruptedException If the thread is interrupted. * @throws InterruptedException If the thread is interrupted.
*/ */

View File

@ -286,7 +286,7 @@ public final class Mp4Extractor implements Extractor, SeekMap {
* Process an ftyp atom to determine whether the media is QuickTime. * Process an ftyp atom to determine whether the media is QuickTime.
* *
* @param atomData The ftyp atom data. * @param atomData The ftyp atom data.
* @return True if the media is QuickTime. False otherwise. * @return Whether the media is QuickTime.
*/ */
private static boolean processFtypAtom(ParsableByteArray atomData) { private static boolean processFtypAtom(ParsableByteArray atomData) {
atomData.setPosition(Atom.HEADER_SIZE); atomData.setPosition(Atom.HEADER_SIZE);

View File

@ -65,7 +65,7 @@ import java.io.IOException;
* input being a fragmented MP4 file. * input being a fragmented MP4 file.
* *
* @param input The extractor input from which to peek data. The peek position will be modified. * @param input The extractor input from which to peek data. The peek position will be modified.
* @return True if the input appears to be in the fragmented MP4 format. False otherwise. * @return Whether the input appears to be in the fragmented MP4 format.
* @throws IOException If an error occurs reading from the input. * @throws IOException If an error occurs reading from the input.
* @throws InterruptedException If the thread has been interrupted. * @throws InterruptedException If the thread has been interrupted.
*/ */
@ -79,7 +79,7 @@ import java.io.IOException;
* input being an unfragmented MP4 file. * input being an unfragmented MP4 file.
* *
* @param input The extractor input from which to peek data. The peek position will be modified. * @param input The extractor input from which to peek data. The peek position will be modified.
* @return True if the input appears to be in the unfragmented MP4 format. False otherwise. * @return Whether the input appears to be in the unfragmented MP4 format.
* @throws IOException If an error occurs reading from the input. * @throws IOException If an error occurs reading from the input.
* @throws InterruptedException If the thread has been interrupted. * @throws InterruptedException If the thread has been interrupted.
*/ */

View File

@ -58,7 +58,7 @@ import java.io.IOException;
*/ */
public boolean[] sampleIsSyncFrameTable; public boolean[] sampleIsSyncFrameTable;
/** /**
* True if the fragment defines encryption data. False otherwise. * Whether the fragment defines encryption data.
*/ */
public boolean definesEncryptionData; public boolean definesEncryptionData;
/** /**

View File

@ -222,7 +222,7 @@ import java.io.IOException;
* @param packet An ogg packet. * @param packet An ogg packet.
* @param position Position of the given header packet. * @param position Position of the given header packet.
* @param setupData Setup data to be filled. * @param setupData Setup data to be filled.
* @return True if the packet contains header data. False otherwise. * @return Whether the packet contains header data.
*/ */
protected abstract boolean readHeaders(ParsableByteArray packet, long position, protected abstract boolean readHeaders(ParsableByteArray packet, long position,
SetupData setupData) throws IOException, InterruptedException; SetupData setupData) throws IOException, InterruptedException;

View File

@ -50,7 +50,9 @@ import com.google.android.exoplayer2.util.Assertions;
this.limit = limit * 8; this.limit = limit * 8;
} }
/** Resets the reading position to zero. */ /**
* Resets the reading position to zero.
*/
public void reset() { public void reset() {
byteOffset = 0; byteOffset = 0;
bitOffset = 0; bitOffset = 0;
@ -69,7 +71,7 @@ import com.google.android.exoplayer2.util.Assertions;
* Reads up to 32 bits. * Reads up to 32 bits.
* *
* @param numBits The number of bits to read. * @param numBits The number of bits to read.
* @return An int whose bottom {@code numBits} bits hold the read data. * @return An integer whose bottom {@code numBits} bits hold the read data.
*/ */
public int readBits(int numBits) { public int readBits(int numBits) {
Assertions.checkState(getPosition() + numBits <= limit); Assertions.checkState(getPosition() + numBits <= limit);
@ -109,7 +111,7 @@ import com.google.android.exoplayer2.util.Assertions;
/** /**
* Skips {@code numberOfBits} bits. * Skips {@code numberOfBits} bits.
* *
* @param numberOfBits the number of bits to skip. * @param numberOfBits The number of bits to skip.
*/ */
public void skipBits(int numberOfBits) { public void skipBits(int numberOfBits) {
Assertions.checkState(getPosition() + numberOfBits <= limit); Assertions.checkState(getPosition() + numberOfBits <= limit);
@ -122,18 +124,16 @@ import com.google.android.exoplayer2.util.Assertions;
} }
/** /**
* Gets the current reading position in bits. * Returns the reading position in bits.
*
* @return the current reading position in bits.
*/ */
public int getPosition() { public int getPosition() {
return byteOffset * 8 + bitOffset; return byteOffset * 8 + bitOffset;
} }
/** /**
* Sets the index of the current reading position in bits. * Sets the reading position in bits.
* *
* @param position the new reading position in bits. * @param position The new reading position in bits.
*/ */
public void setPosition(int position) { public void setPosition(int position) {
Assertions.checkArgument(position < limit && position >= 0); Assertions.checkArgument(position < limit && position >= 0);
@ -142,9 +142,7 @@ import com.google.android.exoplayer2.util.Assertions;
} }
/** /**
* Gets the number of remaining bits. * Returns the number of remaining bits.
*
* @return number of remaining bits.
*/ */
public int bitsLeft() { public int bitsLeft() {
return limit - getPosition(); return limit - getPosition();
@ -152,8 +150,6 @@ import com.google.android.exoplayer2.util.Assertions;
/** /**
* Returns the limit in bits. * Returns the limit in bits.
*
* @return the limit in bits.
**/ **/
public int limit() { public int limit() {
return limit; return limit;

View File

@ -138,7 +138,7 @@ import com.google.android.exoplayer2.util.ParsableByteArray;
* syncword was not located, the position is advanced to the limit. * syncword was not located, the position is advanced to the limit.
* *
* @param pesBuffer The buffer whose position should be advanced. * @param pesBuffer The buffer whose position should be advanced.
* @return True if a syncword position was found. False otherwise. * @return Whether a syncword position was found.
*/ */
private boolean skipToNextSync(ParsableByteArray pesBuffer) { private boolean skipToNextSync(ParsableByteArray pesBuffer) {
while (pesBuffer.bytesLeft() > 0) { while (pesBuffer.bytesLeft() > 0) {

View File

@ -135,7 +135,7 @@ import com.google.android.exoplayer2.util.ParsableByteArray;
* follows it. If SYNC was not located, the position is advanced to the limit. * follows it. If SYNC was not located, the position is advanced to the limit.
* *
* @param pesBuffer The buffer whose position should be advanced. * @param pesBuffer The buffer whose position should be advanced.
* @return True if SYNC was found. False otherwise. * @return Whether SYNC was found.
*/ */
private boolean skipToNextSync(ParsableByteArray pesBuffer) { private boolean skipToNextSync(ParsableByteArray pesBuffer) {
while (pesBuffer.bytesLeft() > 0) { while (pesBuffer.bytesLeft() > 0) {

View File

@ -38,7 +38,7 @@ import com.google.android.exoplayer2.util.ParsableByteArray;
public abstract void seek(); public abstract void seek();
/** /**
* Invoked when a packet starts. * Called when a packet starts.
* *
* @param pesTimeUs The timestamp associated with the packet. * @param pesTimeUs The timestamp associated with the packet.
* @param dataAlignmentIndicator The data alignment indicator associated with the packet. * @param dataAlignmentIndicator The data alignment indicator associated with the packet.
@ -53,7 +53,7 @@ import com.google.android.exoplayer2.util.ParsableByteArray;
public abstract void consume(ParsableByteArray data); public abstract void consume(ParsableByteArray data);
/** /**
* Invoked when a packet ends. * Called when a packet ends.
*/ */
public abstract void packetFinished(); public abstract void packetFinished();

View File

@ -231,12 +231,12 @@ import java.util.Collections;
} }
/** /**
* Invoked when a start code is encountered in the stream. * Called when a start code is encountered in the stream.
* *
* @param startCodeValue The start code value. * @param startCodeValue The start code value.
* @param bytesAlreadyPassed The number of bytes of the start code that have already been * @param bytesAlreadyPassed The number of bytes of the start code that have already been
* passed to {@link #onData(byte[], int, int)}, or 0. * passed to {@link #onData(byte[], int, int)}, or 0.
* @return True if the csd data is now complete. False otherwise. If true is returned, neither * @return Whether the csd data is now complete. If true is returned, neither
* this method or {@link #onData(byte[], int, int)} should be called again without an * this method or {@link #onData(byte[], int, int)} should be called again without an
* interleaving call to {@link #reset()}. * interleaving call to {@link #reset()}.
*/ */
@ -256,7 +256,7 @@ import java.util.Collections;
} }
/** /**
* Invoked to pass stream data. * Called to pass stream data.
* *
* @param newData Holds the data being passed. * @param newData Holds the data being passed.
* @param offset The offset of the data in {@code data}. * @param offset The offset of the data in {@code data}.

View File

@ -284,7 +284,7 @@ import java.util.List;
} }
/** /**
* Invoked to pass stream data. The data passed should not include the 3 byte start code. * Called to pass stream data. The data passed should not include the 3 byte start code.
* *
* @param data Holds the data being passed. * @param data Holds the data being passed.
* @param offset The offset of the data in {@code data}. * @param offset The offset of the data in {@code data}.

View File

@ -57,7 +57,7 @@ import java.util.Arrays;
} }
/** /**
* Invoked to indicate that a NAL unit has started. * Called to indicate that a NAL unit has started.
* *
* @param type The type of the NAL unit. * @param type The type of the NAL unit.
*/ */
@ -72,7 +72,7 @@ import java.util.Arrays;
} }
/** /**
* Invoked to pass stream data. The data passed should not include the 3 byte start code. * Called to pass stream data. The data passed should not include the 3 byte start code.
* *
* @param data Holds the data being passed. * @param data Holds the data being passed.
* @param offset The offset of the data in {@code data}. * @param offset The offset of the data in {@code data}.
@ -91,11 +91,11 @@ import java.util.Arrays;
} }
/** /**
* Invoked to indicate that a NAL unit has ended. * Called to indicate that a NAL unit has ended.
* *
* @param discardPadding The number of excess bytes that were passed to * @param discardPadding The number of excess bytes that were passed to
* {@link #appendToNalUnit(byte[], int, int)}, which should be discarded. * {@link #appendToNalUnit(byte[], int, int)}, which should be discarded.
* @return True if the ended NAL unit is of the target type. False otherwise. * @return Whether the ended NAL unit is of the target type.
*/ */
public boolean endNalUnit(int discardPadding) { public boolean endNalUnit(int discardPadding) {
if (!isFilling) { if (!isFilling) {

View File

@ -521,7 +521,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
} }
/** /**
* @return True if it may be possible to feed more input data. False otherwise. * @return Whether it may be possible to feed more input data.
* @throws ExoPlaybackException If an error occurs feeding the input buffer. * @throws ExoPlaybackException If an error occurs feeding the input buffer.
*/ */
private boolean feedInputBuffer() throws ExoPlaybackException { private boolean feedInputBuffer() throws ExoPlaybackException {
@ -691,7 +691,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
} }
/** /**
* Invoked when a {@link MediaCodec} has been created and configured. * Called when a {@link MediaCodec} has been created and configured.
* <p> * <p>
* The default implementation is a no-op. * The default implementation is a no-op.
* *
@ -706,7 +706,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
} }
/** /**
* Invoked when a new format is read from the upstream {@link MediaPeriod}. * Called when a new format is read from the upstream {@link MediaPeriod}.
* *
* @param newFormat The new format. * @param newFormat The new format.
* @throws ExoPlaybackException If an error occurs reinitializing the {@link MediaCodec}. * @throws ExoPlaybackException If an error occurs reinitializing the {@link MediaCodec}.
@ -751,7 +751,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
} }
/** /**
* Invoked when the output format of the {@link MediaCodec} changes. * Called when the output format of the {@link MediaCodec} changes.
* <p> * <p>
* The default implementation is a no-op. * The default implementation is a no-op.
* *
@ -763,9 +763,8 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
} }
/** /**
* Invoked when the output stream ends, meaning that the last output buffer has been processed * Called when the output stream ends, meaning that the last output buffer has been processed and
* and the {@link MediaCodec#BUFFER_FLAG_END_OF_STREAM} flag has been propagated through the * the {@link MediaCodec#BUFFER_FLAG_END_OF_STREAM} flag has been propagated through the decoder.
* decoder.
* <p> * <p>
* The default implementation is a no-op. * The default implementation is a no-op.
*/ */
@ -774,7 +773,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
} }
/** /**
* Invoked immediately before an input buffer is queued into the codec. * Called immediately before an input buffer is queued into the codec.
* <p> * <p>
* The default implementation is a no-op. * The default implementation is a no-op.
* *
@ -785,7 +784,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
} }
/** /**
* Invoked when an output buffer is successfully processed. * Called when an output buffer is successfully processed.
* <p> * <p>
* The default implementation is a no-op. * The default implementation is a no-op.
* *
@ -808,7 +807,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
* @param codecIsAdaptive Whether the codec is adaptive. * @param codecIsAdaptive Whether the codec is adaptive.
* @param oldFormat The format for which the existing instance is configured. * @param oldFormat The format for which the existing instance is configured.
* @param newFormat The new format. * @param newFormat The new format.
* @return True if the existing instance can be reconfigured. False otherwise. * @return Whether the existing instance can be reconfigured.
*/ */
protected boolean canReconfigureCodec(MediaCodec codec, boolean codecIsAdaptive, Format oldFormat, protected boolean canReconfigureCodec(MediaCodec codec, boolean codecIsAdaptive, Format oldFormat,
Format newFormat) { Format newFormat) {
@ -836,7 +835,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
} }
/** /**
* @return True if it may be possible to drain more output data. False otherwise. * @return Whether it may be possible to drain more output data.
* @throws ExoPlaybackException If an error occurs draining the output buffer. * @throws ExoPlaybackException If an error occurs draining the output buffer.
*/ */
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
@ -948,7 +947,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
* @param bufferIndex The index of the output buffer. * @param bufferIndex The index of the output buffer.
* @param bufferFlags The flags attached to the output buffer. * @param bufferFlags The flags attached to the output buffer.
* @param bufferPresentationTimeUs The presentation time of the output buffer in microseconds. * @param bufferPresentationTimeUs The presentation time of the output buffer in microseconds.
* @param shouldSkip True if the buffer should be skipped (i.e. not rendered). False otherwise. * @param shouldSkip Whether the buffer should be skipped (i.e. not rendered).
* *
* @return Whether the output buffer was fully processed (e.g. rendered or skipped). * @return Whether the output buffer was fully processed (e.g. rendered or skipped).
* @throws ExoPlaybackException If an error occurs processing the output buffer. * @throws ExoPlaybackException If an error occurs processing the output buffer.

View File

@ -45,7 +45,7 @@ public final class MetadataRenderer<T> extends BaseRenderer implements Callback
public interface Output<T> { public interface Output<T> {
/** /**
* Invoked each time there is a metadata associated with current playback time. * Called each time there is a metadata associated with current playback time.
* *
* @param metadata The metadata to process. * @param metadata The metadata to process.
*/ */
@ -67,11 +67,11 @@ public final class MetadataRenderer<T> extends BaseRenderer implements Callback
/** /**
* @param output The output. * @param output The output.
* @param outputLooper The looper associated with the thread on which the output should be * @param outputLooper The looper associated with the thread on which the output should be called.
* invoked. If the output makes use of standard Android UI components, then this should * If the output makes use of standard Android UI components, then this should normally be the
* normally be the looper associated with the application's main thread, which can be obtained * looper associated with the application's main thread, which can be obtained using
* using {@link android.app.Activity#getMainLooper()}. Null may be passed if the output * {@link android.app.Activity#getMainLooper()}. Null may be passed if the output should be
* should be invoked directly on the player's internal rendering thread. * called directly on the player's internal rendering thread.
* @param metadataDecoder A decoder for the metadata. * @param metadataDecoder A decoder for the metadata.
*/ */
public MetadataRenderer(Output<T> output, Looper outputLooper, public MetadataRenderer(Output<T> output, Looper outputLooper,

View File

@ -31,7 +31,7 @@ import java.io.IOException;
public interface AdaptiveMediaSourceEventListener { public interface AdaptiveMediaSourceEventListener {
/** /**
* Invoked when a load begins. * Called when a load begins.
* *
* @param dataSpec Defines the data being loaded. * @param dataSpec Defines the data being loaded.
* @param dataType One of the {@link C} {@code DATA_TYPE_*} constants defining the type of data * @param dataType One of the {@link C} {@code DATA_TYPE_*} constants defining the type of data
@ -55,7 +55,7 @@ public interface AdaptiveMediaSourceEventListener {
long mediaEndTimeMs, long elapsedRealtimeMs); long mediaEndTimeMs, long elapsedRealtimeMs);
/** /**
* Invoked when a load ends. * Called when a load ends.
* *
* @param dataSpec Defines the data being loaded. * @param dataSpec Defines the data being loaded.
* @param dataType One of the {@link C} {@code DATA_TYPE_*} constants defining the type of data * @param dataType One of the {@link C} {@code DATA_TYPE_*} constants defining the type of data
@ -81,7 +81,7 @@ public interface AdaptiveMediaSourceEventListener {
long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs, long bytesLoaded); long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs, long bytesLoaded);
/** /**
* Invoked when a load is canceled. * Called when a load is canceled.
* *
* @param dataSpec Defines the data being loaded. * @param dataSpec Defines the data being loaded.
* @param dataType One of the {@link C} {@code DATA_TYPE_*} constants defining the type of data * @param dataType One of the {@link C} {@code DATA_TYPE_*} constants defining the type of data
@ -108,11 +108,11 @@ public interface AdaptiveMediaSourceEventListener {
long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs, long bytesLoaded); long mediaEndTimeMs, long elapsedRealtimeMs, long loadDurationMs, long bytesLoaded);
/** /**
* Invoked when a load error occurs. * Called when a load error occurs.
* <p> * <p>
* The error may or may not have resulted in the load being canceled, as indicated by the * The error may or may not have resulted in the load being canceled, as indicated by the
* {@code wasCanceled} parameter. If the load was canceled, {@link #onLoadCanceled} will * {@code wasCanceled} parameter. If the load was canceled, {@link #onLoadCanceled} will
* <em>not</em> be invoked in addition to this method. * <em>not</em> be called in addition to this method.
* *
* @param dataSpec Defines the data being loaded. * @param dataSpec Defines the data being loaded.
* @param dataType One of the {@link C} {@code DATA_TYPE_*} constants defining the type of data * @param dataType One of the {@link C} {@code DATA_TYPE_*} constants defining the type of data
@ -134,7 +134,7 @@ public interface AdaptiveMediaSourceEventListener {
* @param loadDurationMs The duration of the load up to the point at which the error occurred. * @param loadDurationMs The duration of the load up to the point at which the error occurred.
* @param bytesLoaded The number of bytes that were loaded prior to the error. * @param bytesLoaded The number of bytes that were loaded prior to the error.
* @param error The load error. * @param error The load error.
* @param wasCanceled True if the load was canceled as a result of the error. False otherwise. * @param wasCanceled Whether the load was canceled as a result of the error.
*/ */
void onLoadError(DataSpec dataSpec, int dataType, int trackType, Format trackFormat, void onLoadError(DataSpec dataSpec, int dataType, int trackType, Format trackFormat,
int trackSelectionReason, Object trackSelectionData, long mediaStartTimeMs, int trackSelectionReason, Object trackSelectionData, long mediaStartTimeMs,
@ -142,7 +142,7 @@ public interface AdaptiveMediaSourceEventListener {
IOException error, boolean wasCanceled); IOException error, boolean wasCanceled);
/** /**
* Invoked when data is removed from the back of a media buffer, typically so that it can be * Called when data is removed from the back of a media buffer, typically so that it can be
* re-buffered in a different format. * re-buffered in a different format.
* *
* @param trackType The type of the media. One of the {@link C} {@code TRACK_TYPE_*} constants. * @param trackType The type of the media. One of the {@link C} {@code TRACK_TYPE_*} constants.
@ -152,7 +152,7 @@ public interface AdaptiveMediaSourceEventListener {
void onUpstreamDiscarded(int trackType, long mediaStartTimeMs, long mediaEndTimeMs); void onUpstreamDiscarded(int trackType, long mediaStartTimeMs, long mediaEndTimeMs);
/** /**
* Invoked when a downstream format change occurs (i.e. when the format of the media being read * Called when a downstream format change occurs (i.e. when the format of the media being read
* from one or more {@link SampleStream}s provided by the source changes). * from one or more {@link SampleStream}s provided by the source changes).
* *
* @param trackType The type of the media. One of the {@link C} {@code TRACK_TYPE_*} constants. * @param trackType The type of the media. One of the {@link C} {@code TRACK_TYPE_*} constants.

View File

@ -33,10 +33,10 @@ public interface MediaPeriod extends SequenceableLoader {
interface Callback extends SequenceableLoader.Callback<MediaPeriod> { interface Callback extends SequenceableLoader.Callback<MediaPeriod> {
/** /**
* Invoked when preparation completes. * Called when preparation completes.
* <p> * <p>
* May be called from any thread. After invoking this method, the {@link MediaPeriod} can expect * May be called from any thread. After invoking this method, the {@link MediaPeriod} can expect
* for {@link #selectTracks(List, List, long)} to be invoked with the initial track selection. * for {@link #selectTracks(List, List, long)} to be called with the initial track selection.
* *
* @param mediaPeriod The prepared {@link MediaPeriod}. * @param mediaPeriod The prepared {@link MediaPeriod}.
*/ */
@ -47,9 +47,9 @@ public interface MediaPeriod extends SequenceableLoader {
/** /**
* Starts preparation of the period. * Starts preparation of the period.
* <p> * <p>
* {@link Callback#onPeriodPrepared(MediaPeriod)} is invoked when preparation completes. If * {@link Callback#onPeriodPrepared(MediaPeriod)} is called when preparation completes. If
* preparation fails, {@link #maybeThrowPrepareError()} will throw an {@link IOException} if * preparation fails, {@link #maybeThrowPrepareError()} will throw an {@link IOException} if
* invoked. * called.
* *
* @param callback A callback to receive updates from the period. * @param callback A callback to receive updates from the period.
* @param allocator An {@link Allocator} from which to obtain media buffer allocations. * @param allocator An {@link Allocator} from which to obtain media buffer allocations.

View File

@ -28,7 +28,7 @@ public interface MediaSource {
interface InvalidationListener { interface InvalidationListener {
/** /**
* Invoked when the timeline is invalidated. * Called when the timeline is invalidated.
* <p> * <p>
* May only be called on the player's thread. * May only be called on the player's thread.
* *

View File

@ -32,7 +32,7 @@ public interface SampleStream {
* Note: If the stream has ended then a buffer with the end of stream flag can always be read from * Note: If the stream has ended then a buffer with the end of stream flag can always be read from
* {@link #readData(FormatHolder, DecoderInputBuffer)}. Hence an ended stream is always ready. * {@link #readData(FormatHolder, DecoderInputBuffer)}. Hence an ended stream is always ready.
* *
* @return True if data is available to be read. False otherwise. * @return Whether data is available to be read.
*/ */
boolean isReady(); boolean isReady();

View File

@ -28,8 +28,8 @@ public interface SequenceableLoader {
interface Callback<T extends SequenceableLoader> { interface Callback<T extends SequenceableLoader> {
/** /**
* Invoked by the loader to indicate that it wishes for its {@link #continueLoading(long)} * Called by the loader to indicate that it wishes for its {@link #continueLoading(long)} method
* method to be called when it can continue to load data. * to be called when it can continue to load data.
*/ */
void onContinueLoadingRequested(T source); void onContinueLoadingRequested(T source);

View File

@ -51,7 +51,7 @@ public final class TrackGroup {
} }
/** /**
* Gets the format of the track at a given index. * Returns the format of the track at a given index.
* *
* @param index The index of the track. * @param index The index of the track.
* @return The track's format. * @return The track's format.
@ -61,7 +61,7 @@ public final class TrackGroup {
} }
/** /**
* Gets the index of the track with the given format in the group. * Returns the index of the track with the given format in the group.
* *
* @param format The format. * @param format The format.
* @return The index of the track, or -1 if no such track exists. * @return The index of the track, or -1 if no such track exists.

View File

@ -41,7 +41,7 @@ public final class TrackGroupArray {
} }
/** /**
* Gets the group at a given index. * Returns the group at a given index.
* *
* @param index The index of the group. * @param index The index of the group.
* @return The group. * @return The group.
@ -51,7 +51,7 @@ public final class TrackGroupArray {
} }
/** /**
* Gets the index of a group within the array. * Returns the index of a group within the array.
* *
* @param group The group. * @param group The group.
* @return The index of the group, or -1 if no such group exists. * @return The index of the group, or -1 if no such group exists.

View File

@ -88,18 +88,14 @@ public abstract class Chunk implements Loadable {
} }
/** /**
* Gets the duration of the chunk in microseconds. * Returns the duration of the chunk in microseconds.
*
* @return The duration of the chunk in microseconds.
*/ */
public final long getDurationUs() { public final long getDurationUs() {
return endTimeUs - startTimeUs; return endTimeUs - startTimeUs;
} }
/** /**
* Gets the number of bytes that have been loaded. * Returns the number of bytes that have been loaded.
*
* @return The number of bytes that have been loaded.
*/ */
public abstract long bytesLoaded(); public abstract long bytesLoaded();

View File

@ -322,7 +322,7 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
* Discard upstream media chunks until the queue length is equal to the length specified. * Discard upstream media chunks until the queue length is equal to the length specified.
* *
* @param queueLength The desired length of the queue. * @param queueLength The desired length of the queue.
* @return True if chunks were discarded. False otherwise. * @return Whether chunks were discarded.
*/ */
private boolean discardUpstreamMediaChunks(int queueLength) { private boolean discardUpstreamMediaChunks(int queueLength) {
if (mediaChunks.size() <= queueLength) { if (mediaChunks.size() <= queueLength) {

View File

@ -47,7 +47,7 @@ public interface ChunkSource {
int getPreferredQueueSize(long playbackPositionUs, List<? extends MediaChunk> queue); int getPreferredQueueSize(long playbackPositionUs, List<? extends MediaChunk> queue);
/** /**
* Gets the next chunk to load. * Returns the next chunk to load.
* <p> * <p>
* If a chunk is available then {@link ChunkHolder#chunk} is set. If the end of the stream has * If a chunk is available then {@link ChunkHolder#chunk} is set. If the end of the stream has
* been reached then {@link ChunkHolder#endOfStream} is set. If a chunk is not available but the * been reached then {@link ChunkHolder#endOfStream} is set. If a chunk is not available but the
@ -62,7 +62,7 @@ public interface ChunkSource {
void getNextChunk(MediaChunk previous, long playbackPositionUs, ChunkHolder out); void getNextChunk(MediaChunk previous, long playbackPositionUs, ChunkHolder out);
/** /**
* Invoked when the {@link ChunkSampleStream} has finished loading a chunk obtained from this * Called when the {@link ChunkSampleStream} has finished loading a chunk obtained from this
* source. * source.
* <p> * <p>
* This method should only be called when the source is enabled. * This method should only be called when the source is enabled.
@ -72,7 +72,7 @@ public interface ChunkSource {
void onChunkLoadCompleted(Chunk chunk); void onChunkLoadCompleted(Chunk chunk);
/** /**
* Invoked when the {@link ChunkSampleStream} encounters an error loading a chunk obtained from * Called when the {@link ChunkSampleStream} encounters an error loading a chunk obtained from
* this source. * this source.
* <p> * <p>
* This method should only be called when the source is enabled. * This method should only be called when the source is enabled.
@ -80,7 +80,7 @@ public interface ChunkSource {
* @param chunk The chunk whose load encountered the error. * @param chunk The chunk whose load encountered the error.
* @param cancelable Whether the load can be canceled. * @param cancelable Whether the load can be canceled.
* @param e The error. * @param e The error.
* @return True if the load should be canceled. False otherwise. * @return Whether the load should be canceled.
*/ */
boolean onChunkLoadError(Chunk chunk, boolean cancelable, Exception e); boolean onChunkLoadError(Chunk chunk, boolean cancelable, Exception e);

View File

@ -102,7 +102,7 @@ public abstract class DataChunk extends Chunk {
} }
/** /**
* Invoked by {@link #load()}. Implementations should override this method to consume the loaded * Called by {@link #load()}. Implementations should override this method to consume the loaded
* data. * data.
* *
* @param data An array containing the data. * @param data An array containing the data.

View File

@ -54,9 +54,9 @@ public interface FormatEvaluator {
/** /**
* Update the supplied evaluation. * Update the supplied evaluation.
* <p> * <p>
* When invoked, {@code evaluation} must contain the currently selected format (null for an * When called, {@code evaluation} must contain the currently selected format (null for an initial
* initial evaluation), the most recent reason ({@link C#SELECTION_REASON_INITIAL} for an * evaluation), the most recent reason ({@link C#SELECTION_REASON_INITIAL} for an initial
* initial evaluation) and the most recent evaluation data (null for an initial evaluation). * evaluation) and the most recent evaluation data (null for an initial evaluation).
* *
* @param bufferedDurationUs The duration of media currently buffered in microseconds. * @param bufferedDurationUs The duration of media currently buffered in microseconds.
* @param blacklistFlags An array whose length is equal to the number of available formats. A * @param blacklistFlags An array whose length is equal to the number of available formats. A

View File

@ -96,7 +96,7 @@ public interface DashSegmentIndex {
* segment duration. If the presentation is dynamic, it's possible that only a subset of the * segment duration. If the presentation is dynamic, it's possible that only a subset of the
* segments are available. * segments are available.
* *
* @return True if segments are defined explicitly by the index. False otherwise. * @return Whether segments are defined explicitly by the index.
*/ */
boolean isExplicit(); boolean isExplicit();

View File

@ -673,7 +673,7 @@ public class DashManifestParser extends DefaultHandler
* Returns whether a mimeType is a text sample mimeType. * Returns whether a mimeType is a text sample mimeType.
* *
* @param mimeType The mimeType. * @param mimeType The mimeType.
* @return True if the mimeType is a text sample mimeType. False otherwise. * @return Whether the mimeType is a text sample mimeType.
*/ */
private static boolean mimeTypeIsRawText(String mimeType) { private static boolean mimeTypeIsRawText(String mimeType) {
return MimeTypes.isText(mimeType) || MimeTypes.APPLICATION_TTML.equals(mimeType); return MimeTypes.isText(mimeType) || MimeTypes.APPLICATION_TTML.equals(mimeType);

View File

@ -105,36 +105,27 @@ public abstract class Representation {
} }
/** /**
* Gets a {@link RangedUri} defining the location of the representation's initialization data. * Returns a {@link RangedUri} defining the location of the representation's initialization data,
* May be null if no initialization data exists. * or null if no initialization data exists.
*
* @return A {@link RangedUri} defining the location of the initialization data, or null.
*/ */
public RangedUri getInitializationUri() { public RangedUri getInitializationUri() {
return initializationUri; return initializationUri;
} }
/** /**
* Gets a {@link RangedUri} defining the location of the representation's segment index. Null if * Returns a {@link RangedUri} defining the location of the representation's segment index, or
* the representation provides an index directly. * null if the representation provides an index directly.
*
* @return The location of the segment index, or null.
*/ */
public abstract RangedUri getIndexUri(); public abstract RangedUri getIndexUri();
/** /**
* Gets a segment index, if the representation is able to provide one directly. Null if the * Returns an index if the representation provides one directly, or null otherwise.
* segment index is defined externally.
*
* @return The segment index, or null.
*/ */
public abstract DashSegmentIndex getIndex(); public abstract DashSegmentIndex getIndex();
/** /**
* A cache key for the {@link Representation}, in the format * Returns a cache key for the representation, in the format
* {@code contentId + "." + format.id + "." + revisionId}. * {@code contentId + "." + format.id + "." + revisionId}.
*
* @return A cache key.
*/ */
public String getCacheKey() { public String getCacheKey() {
return cacheKey; return cacheKey;

View File

@ -44,8 +44,8 @@ public abstract class SegmentBase {
} }
/** /**
* Gets the {@link RangedUri} defining the location of initialization data for a given * Returns the {@link RangedUri} defining the location of initialization data for a given
* representation. May be null if no initialization data exists. * representation, or null if no initialization data exists.
* *
* @param representation The {@link Representation} for which initialization data is required. * @param representation The {@link Representation} for which initialization data is required.
* @return A {@link RangedUri} defining the location of the initialization data, or null. * @return A {@link RangedUri} defining the location of the initialization data, or null.
@ -55,9 +55,7 @@ public abstract class SegmentBase {
} }
/** /**
* Gets the presentation time offset, in microseconds. * Returns the presentation time offset, in microseconds.
*
* @return The presentation time offset, in microseconds.
*/ */
public long getPresentationTimeOffsetUs() { public long getPresentationTimeOffsetUs() {
return Util.scaleLargeTimestamp(presentationTimeOffset, C.MICROS_PER_SECOND, timescale); return Util.scaleLargeTimestamp(presentationTimeOffset, C.MICROS_PER_SECOND, timescale);

View File

@ -144,8 +144,6 @@ public class HlsChunkSource {
/** /**
* Returns whether this is a live playback. * Returns whether this is a live playback.
*
* @return True if this is a live playback. False otherwise.
*/ */
public boolean isLive() { public boolean isLive() {
return live; return live;
@ -153,8 +151,6 @@ public class HlsChunkSource {
/** /**
* Returns the duration of the source, or {@link C#UNSET_TIME_US} if the duration is unknown. * Returns the duration of the source, or {@link C#UNSET_TIME_US} if the duration is unknown.
*
* @return The number of tracks.
*/ */
public long getDurationUs() { public long getDurationUs() {
return durationUs; return durationUs;
@ -162,8 +158,6 @@ public class HlsChunkSource {
/** /**
* Returns the track group exposed by the source. * Returns the track group exposed by the source.
*
* @return The track group.
*/ */
public TrackGroup getTrackGroup() { public TrackGroup getTrackGroup() {
return trackGroup; return trackGroup;
@ -186,7 +180,7 @@ public class HlsChunkSource {
} }
/** /**
* Gets the next chunk to load. * Returns the next chunk to load.
* <p> * <p>
* If a chunk is available then {@link ChunkHolder#chunk} is set. If the end of the stream has * If a chunk is available then {@link ChunkHolder#chunk} is set. If the end of the stream has
* been reached then {@link ChunkHolder#endOfStream} is set. If a chunk is not available but the * been reached then {@link ChunkHolder#endOfStream} is set. If a chunk is not available but the
@ -386,7 +380,7 @@ public class HlsChunkSource {
} }
/** /**
* Invoked when the {@link HlsSampleStreamWrapper} has finished loading a chunk obtained from this * Called when the {@link HlsSampleStreamWrapper} has finished loading a chunk obtained from this
* source. * source.
* *
* @param chunk The chunk whose load has been completed. * @param chunk The chunk whose load has been completed.
@ -405,13 +399,13 @@ public class HlsChunkSource {
} }
/** /**
* Invoked when the {@link HlsSampleStreamWrapper} encounters an error loading a chunk obtained * Called when the {@link HlsSampleStreamWrapper} encounters an error loading a chunk obtained
* from this source. * from this source.
* *
* @param chunk The chunk whose load encountered the error. * @param chunk The chunk whose load encountered the error.
* @param cancelable Whether the load can be canceled. * @param cancelable Whether the load can be canceled.
* @param e The error. * @param e The error.
* @return True if the load should be canceled. False otherwise. * @return Whether the load should be canceled.
*/ */
public boolean onChunkLoadError(Chunk chunk, boolean cancelable, IOException e) { public boolean onChunkLoadError(Chunk chunk, boolean cancelable, IOException e) {
if (cancelable && e instanceof InvalidResponseCodeException) { if (cancelable && e instanceof InvalidResponseCodeException) {

View File

@ -109,18 +109,14 @@ import java.util.concurrent.atomic.AtomicInteger;
} }
/** /**
* Gets the start time in microseconds by subtracting the duration from the adjusted end time. * Returns the presentation time in microseconds of the first sample in the chunk.
*
* @return The start time in microseconds.
*/ */
public long getAdjustedStartTimeUs() { public long getAdjustedStartTimeUs() {
return adjustedEndTimeUs - getDurationUs(); return adjustedEndTimeUs - getDurationUs();
} }
/** /**
* Gets the presentation time in microseconds of the last sample contained in the chunk * Returns the presentation time in microseconds of the last sample in the chunk
*
* @return The presentation time in microseconds of the last sample contained in the chunk.
*/ */
public long getAdjustedEndTimeUs() { public long getAdjustedEndTimeUs() {
return adjustedEndTimeUs; return adjustedEndTimeUs;

View File

@ -55,7 +55,7 @@ import java.util.List;
public interface Callback extends SequenceableLoader.Callback<HlsSampleStreamWrapper> { public interface Callback extends SequenceableLoader.Callback<HlsSampleStreamWrapper> {
/** /**
* Invoked when the wrapper has been prepared. * Called when the wrapper has been prepared.
*/ */
void onPrepared(); void onPrepared();

View File

@ -33,7 +33,7 @@ public final class PtsTimestampAdjusterProvider {
} }
/** /**
* Gets a {@link PtsTimestampAdjuster} suitable for adjusting the pts timestamps contained in * Returns a {@link PtsTimestampAdjuster} suitable for adjusting the pts timestamps contained in
* a chunk with a given discontinuity sequence. * a chunk with a given discontinuity sequence.
* <p> * <p>
* This method may return null if the master source has yet to initialize a suitable adjuster. * This method may return null if the master source has yet to initialize a suitable adjuster.

View File

@ -50,7 +50,7 @@ public class SsManifest {
public final int lookAheadCount; public final int lookAheadCount;
/** /**
* True if the manifest describes a live presentation still in progress. False otherwise. * Whether the manifest describes a live presentation still in progress.
*/ */
public final boolean isLive; public final boolean isLive;
@ -176,7 +176,7 @@ public class SsManifest {
} }
/** /**
* Gets the index of the chunk that contains the specified time. * Returns the index of the chunk that contains the specified time.
* *
* @param timeUs The time in microseconds. * @param timeUs The time in microseconds.
* @return The index of the corresponding chunk. * @return The index of the corresponding chunk.
@ -186,7 +186,7 @@ public class SsManifest {
} }
/** /**
* Gets the start time of the specified chunk. * Returns the start time of the specified chunk.
* *
* @param chunkIndex The index of the chunk. * @param chunkIndex The index of the chunk.
* @return The start time of the chunk, in microseconds. * @return The start time of the chunk, in microseconds.
@ -196,7 +196,7 @@ public class SsManifest {
} }
/** /**
* Gets the duration of the specified chunk. * Returns the duration of the specified chunk.
* *
* @param chunkIndex The index of the chunk. * @param chunkIndex The index of the chunk.
* @return The duration of the chunk, in microseconds. * @return The duration of the chunk, in microseconds.

View File

@ -46,7 +46,7 @@ public final class TextRenderer extends BaseRenderer implements Callback {
public interface Output { public interface Output {
/** /**
* Invoked each time there is a change in the {@link Cue}s. * Called each time there is a change in the {@link Cue}s.
* *
* @param cues The {@link Cue}s. * @param cues The {@link Cue}s.
*/ */
@ -72,10 +72,10 @@ public final class TextRenderer extends BaseRenderer implements Callback {
/** /**
* @param output The output. * @param output The output.
* @param outputLooper The looper associated with the thread on which the output should be * @param outputLooper The looper associated with the thread on which the output should be
* invoked. If the output makes use of standard Android UI components, then this should * called. If the output makes use of standard Android UI components, then this should
* normally be the looper associated with the application's main thread, which can be obtained * normally be the looper associated with the application's main thread, which can be obtained
* using {@link android.app.Activity#getMainLooper()}. Null may be passed if the output * using {@link android.app.Activity#getMainLooper()}. Null may be passed if the output
* should be invoked directly on the player's internal rendering thread. * should be called directly on the player's internal rendering thread.
*/ */
public TextRenderer(Output output, Looper outputLooper) { public TextRenderer(Output output, Looper outputLooper) {
this(output, outputLooper, SubtitleDecoderFactory.DEFAULT); this(output, outputLooper, SubtitleDecoderFactory.DEFAULT);
@ -84,10 +84,10 @@ public final class TextRenderer extends BaseRenderer implements Callback {
/** /**
* @param output The output. * @param output The output.
* @param outputLooper The looper associated with the thread on which the output should be * @param outputLooper The looper associated with the thread on which the output should be
* invoked. If the output makes use of standard Android UI components, then this should * called. If the output makes use of standard Android UI components, then this should
* normally be the looper associated with the application's main thread, which can be obtained * normally be the looper associated with the application's main thread, which can be obtained
* using {@link android.app.Activity#getMainLooper()}. Null may be passed if the output * using {@link android.app.Activity#getMainLooper()}. Null may be passed if the output
* should be invoked directly on the player's internal rendering thread. * should be called directly on the player's internal rendering thread.
* @param decoderFactory A factory from which to obtain {@link SubtitleDecoder} instances. * @param decoderFactory A factory from which to obtain {@link SubtitleDecoder} instances.
*/ */
public TextRenderer(Output output, Looper outputLooper, SubtitleDecoderFactory decoderFactory) { public TextRenderer(Output output, Looper outputLooper, SubtitleDecoderFactory decoderFactory) {

View File

@ -535,7 +535,7 @@ public final class Eia608Decoder implements SubtitleDecoder {
* @param payloadType The payload type of the message. * @param payloadType The payload type of the message.
* @param payloadLength The length of the payload. * @param payloadLength The length of the payload.
* @param payload A {@link ParsableByteArray} containing the payload. * @param payload A {@link ParsableByteArray} containing the payload.
* @return True if the sei message contains EIA-608. False otherwise. * @return Whether the sei message contains EIA-608.
*/ */
public static boolean isSeiMessageEia608(int payloadType, int payloadLength, public static boolean isSeiMessageEia608(int payloadType, int payloadLength,
ParsableByteArray payload) { ParsableByteArray payload) {

View File

@ -112,7 +112,7 @@ import java.util.Map;
} }
/** /**
* Invoked when the end of a paragraph is encountered. Adds a newline if there are one or more * Called when the end of a paragraph is encountered. Adds a newline if there are one or more
* non-space characters since the previous newline. * non-space characters since the previous newline.
* *
* @param builder The builder. * @param builder The builder.

View File

@ -49,7 +49,7 @@ import android.util.Log;
* Returns whether or not this cue should be placed in the default position and rolled-up with * Returns whether or not this cue should be placed in the default position and rolled-up with
* the other "normal" cues. * the other "normal" cues.
* *
* @return True if this cue should be placed in the default position; false otherwise. * @return Whether this cue should be placed in the default position.
*/ */
public boolean isNormalCue() { public boolean isNormalCue() {
return (line == DIMEN_UNSET && position == DIMEN_UNSET); return (line == DIMEN_UNSET && position == DIMEN_UNSET);

View File

@ -88,7 +88,7 @@ import java.util.regex.Pattern;
* @param webvttData Parsable WebVTT file data. * @param webvttData Parsable WebVTT file data.
* @param builder Builder for WebVTT Cues. * @param builder Builder for WebVTT Cues.
* @param styles List of styles defined by the CSS style blocks preceeding the cues. * @param styles List of styles defined by the CSS style blocks preceeding the cues.
* @return True if a valid Cue was found, false otherwise. * @return Whether a valid Cue was found.
*/ */
/* package */ boolean parseCue(ParsableByteArray webvttData, WebvttCue.Builder builder, /* package */ boolean parseCue(ParsableByteArray webvttData, WebvttCue.Builder builder,
List<WebvttCssStyle> styles) { List<WebvttCssStyle> styles) {

View File

@ -89,9 +89,9 @@ public class DefaultTrackSelector extends MappingTrackSelector {
} }
/** /**
* Sets whether selections may contain mixed mime types. * Sets whether to allow selections to contain mixed mime types.
* *
* @param allowMixedMimeAdaptiveness True to allow mixed mime types, false otherwise. * @param allowMixedMimeAdaptiveness Whether to allow selections to contain mixed mime types.
*/ */
public void allowMixedMimeAdaptiveness(boolean allowMixedMimeAdaptiveness) { public void allowMixedMimeAdaptiveness(boolean allowMixedMimeAdaptiveness) {
if (this.allowMixedMimeAdaptiveness != allowMixedMimeAdaptiveness) { if (this.allowMixedMimeAdaptiveness != allowMixedMimeAdaptiveness) {
@ -101,10 +101,9 @@ public class DefaultTrackSelector extends MappingTrackSelector {
} }
/** /**
* Sets whether non seamless adaptation is allowed. * Sets whether non-seamless adaptation is allowed.
* *
* @param allowNonSeamlessAdaptiveness True to allow non seamless adaptation between tracks, false * @param allowNonSeamlessAdaptiveness Whether non-seamless adaptation is allowed.
* otherwise.
*/ */
public void allowNonSeamlessAdaptiveness(boolean allowNonSeamlessAdaptiveness) { public void allowNonSeamlessAdaptiveness(boolean allowNonSeamlessAdaptiveness) {
if (this.allowNonSeamlessAdaptiveness != allowNonSeamlessAdaptiveness) { if (this.allowNonSeamlessAdaptiveness != allowNonSeamlessAdaptiveness) {

View File

@ -72,7 +72,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
} }
/** /**
* Register a listener to receive events from the selector. The listener's methods will be invoked * Register a listener to receive events from the selector. The listener's methods will be called
* using the {@link Handler} that was passed to the constructor. * using the {@link Handler} that was passed to the constructor.
* *
* @param listener The listener to register. * @param listener The listener to register.
@ -92,9 +92,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
} }
/** /**
* Gets information about the current tracks and track selection for each renderer. * Returns information about the current tracks and track selection for each renderer.
*
* @return Contains the current tracks and track selection information.
*/ */
public final TrackInfo getTrackInfo() { public final TrackInfo getTrackInfo() {
return activeTrackInfo; return activeTrackInfo;
@ -104,7 +102,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
* Sets whether the renderer at the specified index is disabled. * Sets whether the renderer at the specified index is disabled.
* *
* @param rendererIndex The renderer index. * @param rendererIndex The renderer index.
* @param disabled True if the renderer is disabled. False otherwise. * @param disabled Whether the renderer is disabled.
*/ */
public final void setRendererDisabled(int rendererIndex, boolean disabled) { public final void setRendererDisabled(int rendererIndex, boolean disabled) {
if (rendererDisabledFlags.get(rendererIndex) == disabled) { if (rendererDisabledFlags.get(rendererIndex) == disabled) {
@ -119,7 +117,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
* Returns whether the renderer is disabled. * Returns whether the renderer is disabled.
* *
* @param rendererIndex The renderer index. * @param rendererIndex The renderer index.
* @return True if the renderer is disabled. False otherwise. * @return Whether the renderer is disabled.
*/ */
public final boolean getRendererDisabled(int rendererIndex) { public final boolean getRendererDisabled(int rendererIndex) {
return rendererDisabledFlags.get(rendererIndex); return rendererDisabledFlags.get(rendererIndex);
@ -163,7 +161,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
* *
* @param rendererIndex The renderer index. * @param rendererIndex The renderer index.
* @param groups The {@link TrackGroupArray}. * @param groups The {@link TrackGroupArray}.
* @return True if there is an override. False otherwise. * @return Whether there is an override.
*/ */
public final boolean hasSelectionOverride(int rendererIndex, TrackGroupArray groups) { public final boolean hasSelectionOverride(int rendererIndex, TrackGroupArray groups) {
Map<TrackGroupArray, TrackSelection> overrides = trackSelectionOverrides.get(rendererIndex); Map<TrackGroupArray, TrackSelection> overrides = trackSelectionOverrides.get(rendererIndex);
@ -453,7 +451,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
} }
/** /**
* Gets the array of {@link TrackGroup}s associated to the renderer at a specified index. * Returns the array of {@link TrackGroup}s associated to the renderer at a specified index.
* *
* @param rendererIndex The renderer index. * @param rendererIndex The renderer index.
* @return The corresponding {@link TrackGroup}s. * @return The corresponding {@link TrackGroup}s.
@ -463,7 +461,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
} }
/** /**
* Gets the current {@link TrackSelection} for the renderer at a specified index. * Returns the current {@link TrackSelection} for the renderer at a specified index.
* *
* @param rendererIndex The renderer index. * @param rendererIndex The renderer index.
* @return The corresponding {@link TrackSelection}, or null if the renderer is disabled. * @return The corresponding {@link TrackSelection}, or null if the renderer is disabled.
@ -473,7 +471,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
} }
/** /**
* Gets the extent to which a renderer can support playback of the tracks associated to it. * Returns the extent to which a renderer can support playback of the tracks associated to it.
* *
* @param rendererIndex The renderer index. * @param rendererIndex The renderer index.
* @return One of {@link #RENDERER_SUPPORT_PLAYABLE_TRACKS}, * @return One of {@link #RENDERER_SUPPORT_PLAYABLE_TRACKS},
@ -495,7 +493,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
} }
/** /**
* Gets the extent to which the format of an individual track is supported by the renderer. * Returns the extent to which the format of an individual track is supported by the renderer.
* *
* @param rendererIndex The renderer index. * @param rendererIndex The renderer index.
* @param groupIndex The index of the group to which the track belongs. * @param groupIndex The index of the group to which the track belongs.
@ -511,7 +509,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
} }
/** /**
* Gets the extent to which the renderer supports adaptation between supported tracks in a * Returns the extent to which the renderer supports adaptation between supported tracks in a
* specified {@link TrackGroup}. * specified {@link TrackGroup}.
* <p> * <p>
* Tracks for which {@link #getTrackFormatSupport(int, int, int)} returns * Tracks for which {@link #getTrackFormatSupport(int, int, int)} returns
@ -550,8 +548,8 @@ public abstract class MappingTrackSelector extends TrackSelector {
} }
/** /**
* Gets the extent to which the renderer supports adaptation between specified tracks within a * Returns the extent to which the renderer supports adaptation between specified tracks within
* {@link TrackGroup}. * a {@link TrackGroup}.
* *
* @param rendererIndex The renderer index. * @param rendererIndex The renderer index.
* @param groupIndex The index of the group. * @param groupIndex The index of the group.
@ -582,9 +580,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
} }
/** /**
* Gets the {@link TrackGroup}s not associated with any renderer. * Returns the {@link TrackGroup}s not associated with any renderer.
*
* @return The {@link TrackGroup}s not associated with any renderer.
*/ */
public TrackGroupArray getUnassociatedTrackGroups() { public TrackGroupArray getUnassociatedTrackGroups() {
return unassociatedTrackGroups; return unassociatedTrackGroups;

View File

@ -66,7 +66,7 @@ public final class TrackSelection {
} }
/** /**
* Gets the format of the track at a given index in the selection. * Returns the format of the track at a given index in the selection.
* *
* @param index The index in the selection. * @param index The index in the selection.
* @return The format of the selected track. * @return The format of the selected track.
@ -76,16 +76,14 @@ public final class TrackSelection {
} }
/** /**
* Gets a copy of the formats of the selected tracks. * Returns a copy of the formats of the selected tracks.
*
* @return The track formats.
*/ */
public Format[] getFormats() { public Format[] getFormats() {
return formats.clone(); return formats.clone();
} }
/** /**
* Gets the index in the selection of the track with the specified format. * Returns the index in the selection of the track with the specified format.
* *
* @param format The format. * @param format The format.
* @return The index in the selection, or -1 if the track with the specified format is not part of * @return The index in the selection, or -1 if the track with the specified format is not part of
@ -101,7 +99,7 @@ public final class TrackSelection {
} }
/** /**
* Gets the index in the track group of the track at a given index in the selection. * Returns the index in the track group of the track at a given index in the selection.
* *
* @param index The index in the selection. * @param index The index in the selection.
* @return The index of the selected track. * @return The index of the selected track.
@ -111,16 +109,14 @@ public final class TrackSelection {
} }
/** /**
* Gets a copy of the selected tracks in the track group. * Returns a copy of the selected tracks in the track group.
*
* @return The track indices.
*/ */
public int[] getTracks() { public int[] getTracks() {
return tracks.clone(); return tracks.clone();
} }
/** /**
* Gets the index in the selection of the track with the specified index in the track group. * Returns the index in the selection of the track with the specified index in the track group.
* *
* @param trackIndex The index in the track group. * @param trackIndex The index in the track group.
* @return The index in the selection, or -1 if the track with the specified index is not part of * @return The index in the selection, or -1 if the track with the specified index is not part of

View File

@ -41,7 +41,7 @@ public final class TrackSelectionArray {
} }
/** /**
* Gets the selection at a given index. * Returns the selection at a given index.
* *
* @param index The index of the selection. * @param index The index of the selection.
* @return The selection. * @return The selection.

View File

@ -32,7 +32,7 @@ public abstract class TrackSelector {
public interface InvalidationListener { public interface InvalidationListener {
/** /**
* Invoked by a {@link TrackSelector} when previous selections are no longer valid. * Called by a {@link TrackSelector} when previous selections are no longer valid.
*/ */
void onTrackSelectionsInvalidated(); void onTrackSelectionsInvalidated();
@ -69,7 +69,7 @@ public abstract class TrackSelector {
throws ExoPlaybackException; throws ExoPlaybackException;
/** /**
* Invoked when a selection previously generated by * Called when a selection previously generated by
* {@link #selectTracks(RendererCapabilities[], TrackGroupArray)} is activated. * {@link #selectTracks(RendererCapabilities[], TrackGroupArray)} is activated.
* *
* @param selectionInfo The opaque object associated with the selection. * @param selectionInfo The opaque object associated with the selection.

View File

@ -26,7 +26,7 @@ public interface BandwidthMeter {
interface EventListener { interface EventListener {
/** /**
* Invoked periodically to indicate that bytes have been transferred. * Called periodically to indicate that bytes have been transferred.
* <p> * <p>
* Note: The estimated bitrate is typically derived from more information than just * Note: The estimated bitrate is typically derived from more information than just
* {@code bytes} and {@code elapsedMs}. * {@code bytes} and {@code elapsedMs}.

View File

@ -51,7 +51,7 @@ public interface Cache {
* {@link CacheSpan#file} and {@link CacheSpan#lastAccessTimestamp} may have changed. * {@link CacheSpan#file} and {@link CacheSpan#lastAccessTimestamp} may have changed.
* <p> * <p>
* Note that for span replacement, {@link #onSpanAdded(Cache, CacheSpan)} and * Note that for span replacement, {@link #onSpanAdded(Cache, CacheSpan)} and
* {@link #onSpanRemoved(Cache, CacheSpan)} are not invoked in addition to this method. * {@link #onSpanRemoved(Cache, CacheSpan)} are not called in addition to this method.
* *
* @param cache The source of the event. * @param cache The source of the event.
* @param oldSpan The old {@link CacheSpan}, which has been removed from the cache. * @param oldSpan The old {@link CacheSpan}, which has been removed from the cache.
@ -64,9 +64,9 @@ public interface Cache {
/** /**
* Registers a listener to listen for changes to a given key. * Registers a listener to listen for changes to a given key.
* <p> * <p>
* No guarantees are made about the thread or threads on which the listener is invoked, but it * No guarantees are made about the thread or threads on which the listener is called, but it is
* is guaranteed that listener methods will be invoked in a serial fashion (i.e. one at a time) * guaranteed that listener methods will be called in a serial fashion (i.e. one at a time) and in
* and in the same order as events occurred. * the same order as events occurred.
* *
* @param key The key to listen to. * @param key The key to listen to.
* @param listener The listener to add. * @param listener The listener to add.

View File

@ -45,7 +45,7 @@ public final class CacheDataSource implements DataSource {
* Called when bytes have been read from the cache. * Called when bytes have been read from the cache.
* *
* @param cacheSizeBytes Current cache size in bytes. * @param cacheSizeBytes Current cache size in bytes.
* @param cachedBytesRead Total bytes read from the cache since this method was last invoked. * @param cachedBytesRead Total bytes read from the cache since this method was last called.
*/ */
void onCachedBytesRead(long cacheSizeBytes, long cachedBytesRead); void onCachedBytesRead(long cacheSizeBytes, long cachedBytesRead);

View File

@ -21,11 +21,13 @@ package com.google.android.exoplayer2.upstream.cache;
*/ */
public interface CacheEvictor extends Cache.Listener { public interface CacheEvictor extends Cache.Listener {
/** Invoked when cache has beeen initialized. */ /**
* Called when cache has beeen initialized.
*/
void onCacheInitialized(); void onCacheInitialized();
/** /**
* Invoked when a writer starts writing to the cache. * Called when a writer starts writing to the cache.
* *
* @param cache The source of the event. * @param cache The source of the event.
* @param key The key being written. * @param key The key being written.

View File

@ -120,7 +120,7 @@ public final class CacheSpan implements Comparable<CacheSpan> {
} }
/** /**
* @return True if this is an open-ended {@link CacheSpan}. False otherwise. * Returns whether this is an open-ended {@link CacheSpan}.
*/ */
public boolean isOpenEnded() { public boolean isOpenEnded() {
return length == -1; return length == -1;

View File

@ -118,7 +118,7 @@ public final class ParsableBitArray {
/** /**
* Reads a single bit. * Reads a single bit.
* *
* @return True if the bit is set. False otherwise. * @return Whether the bit is set.
*/ */
public boolean readBit() { public boolean readBit() {
return readBits(1) == 1; return readBits(1) == 1;

View File

@ -104,7 +104,7 @@ public final class ParsableNalUnitBitArray {
/** /**
* Reads a single bit. * Reads a single bit.
* *
* @return True if the bit is set. False otherwise. * @return Whether the bit is set.
*/ */
public boolean readBit() { public boolean readBit() {
return readBits(1) == 1; return readBits(1) == 1;

View File

@ -30,7 +30,7 @@ public final class XmlPullParserUtil {
* *
* @param xpp The {@link XmlPullParser} to query. * @param xpp The {@link XmlPullParser} to query.
* @param name The specified name. * @param name The specified name.
* @return True if the current event is an end tag with the specified name. False otherwise. * @return Whether the current event is an end tag with the specified name.
* @throws XmlPullParserException If an error occurs querying the parser. * @throws XmlPullParserException If an error occurs querying the parser.
*/ */
public static boolean isEndTag(XmlPullParser xpp, String name) throws XmlPullParserException { public static boolean isEndTag(XmlPullParser xpp, String name) throws XmlPullParserException {
@ -41,7 +41,7 @@ public final class XmlPullParserUtil {
* Returns whether the current event is an end tag. * Returns whether the current event is an end tag.
* *
* @param xpp The {@link XmlPullParser} to query. * @param xpp The {@link XmlPullParser} to query.
* @return True if the current event is an end tag. False otherwise. * @return Whether the current event is an end tag.
* @throws XmlPullParserException If an error occurs querying the parser. * @throws XmlPullParserException If an error occurs querying the parser.
*/ */
public static boolean isEndTag(XmlPullParser xpp) throws XmlPullParserException { public static boolean isEndTag(XmlPullParser xpp) throws XmlPullParserException {
@ -53,7 +53,7 @@ public final class XmlPullParserUtil {
* *
* @param xpp The {@link XmlPullParser} to query. * @param xpp The {@link XmlPullParser} to query.
* @param name The specified name. * @param name The specified name.
* @return True if the current event is a start tag with the specified name. False otherwise. * @return Whether the current event is a start tag with the specified name.
* @throws XmlPullParserException If an error occurs querying the parser. * @throws XmlPullParserException If an error occurs querying the parser.
*/ */
public static boolean isStartTag(XmlPullParser xpp, String name) public static boolean isStartTag(XmlPullParser xpp, String name)
@ -65,7 +65,7 @@ public final class XmlPullParserUtil {
* Returns whether the current event is a start tag. * Returns whether the current event is a start tag.
* *
* @param xpp The {@link XmlPullParser} to query. * @param xpp The {@link XmlPullParser} to query.
* @return True if the current event is a start tag. False otherwise. * @return Whether the current event is a start tag.
* @throws XmlPullParserException If an error occurs querying the parser. * @throws XmlPullParserException If an error occurs querying the parser.
*/ */
public static boolean isStartTag(XmlPullParser xpp) throws XmlPullParserException { public static boolean isStartTag(XmlPullParser xpp) throws XmlPullParserException {

View File

@ -657,8 +657,7 @@ public final class DashTest extends ActivityInstrumentationTestCase2<HostActivit
* @param streamName The name of the test stream for metric logging. * @param streamName The name of the test stream for metric logging.
* @param manifestPath The manifest path. * @param manifestPath The manifest path.
* @param metricsLogger Logger to log metrics from the test. * @param metricsLogger Logger to log metrics from the test.
* @param fullPlaybackNoSeeking True if the test will play the entire source with no seeking. * @param fullPlaybackNoSeeking Whether the test will play the entire source with no seeking.
* False otherwise.
* @param audioFormat The audio format. * @param audioFormat The audio format.
* @param isWidevineEncrypted Whether the video is Widevine encrypted. * @param isWidevineEncrypted Whether the video is Widevine encrypted.
* @param videoMimeType The video mime type. * @param videoMimeType The video mime type.

View File

@ -95,8 +95,7 @@ public abstract class ExoHostedTest implements HostedTest, ExoPlayer.EventListen
* expected playing time equals the duration of the media being played. Else * expected playing time equals the duration of the media being played. Else
* {@link #EXPECTED_PLAYING_TIME_UNSET} should be passed to indicate that the test should not * {@link #EXPECTED_PLAYING_TIME_UNSET} should be passed to indicate that the test should not
* assert an expected playing time. * assert an expected playing time.
* @param failOnPlayerError True if a player error should be considered a test failure. False * @param failOnPlayerError Whether a player error should be considered a test failure.
* otherwise.
*/ */
public ExoHostedTest(String tag, long expectedPlayingTimeMs, boolean failOnPlayerError) { public ExoHostedTest(String tag, long expectedPlayingTimeMs, boolean failOnPlayerError) {
this.tag = tag; this.tag = tag;

View File

@ -61,7 +61,7 @@ public final class HostActivity extends Activity implements SurfaceHolder.Callba
/** /**
* Called on the main thread to check whether the test is ready to be stopped. * Called on the main thread to check whether the test is ready to be stopped.
* *
* @return True if the test is ready to be stopped. False otherwise. * @return Whether the test is ready to be stopped.
*/ */
boolean canStop(); boolean canStop();
@ -222,7 +222,7 @@ public final class HostActivity extends Activity implements SurfaceHolder.Callba
mainHandler.removeCallbacks(checkCanStopRunnable); mainHandler.removeCallbacks(checkCanStopRunnable);
// We post opening of the stopped condition so that any events posted to the main thread as a // We post opening of the stopped condition so that any events posted to the main thread as a
// result of hostedTest.onStop() are guaranteed to be handled before hostedTest.onFinished() // result of hostedTest.onStop() are guaranteed to be handled before hostedTest.onFinished()
// is invoked from runTest. // is called from runTest.
mainHandler.post(new Runnable() { mainHandler.post(new Runnable() {
@Override @Override
public void run() { public void run() {