diff --git a/demo/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java b/demo/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java index 3a762aae73..3d77a019ea 100644 --- a/demo/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java +++ b/demo/src/main/java/com/google/android/exoplayer2/demo/PlayerActivity.java @@ -395,7 +395,7 @@ public class PlayerActivity extends Activity implements SurfaceHolder.Callback, * requests permission. * * @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) private boolean maybeRequestPermission(Uri... uris) { diff --git a/library/src/main/java/com/google/android/exoplayer2/BaseRenderer.java b/library/src/main/java/com/google/android/exoplayer2/BaseRenderer.java index 96051cd746..ac9012a09f 100644 --- a/library/src/main/java/com/google/android/exoplayer2/BaseRenderer.java +++ b/library/src/main/java/com/google/android/exoplayer2/BaseRenderer.java @@ -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 * is encountered. *

@@ -257,7 +257,7 @@ public abstract class BaseRenderer implements Renderer, RendererCapabilities { /** * 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() { return readEndOfStream ? streamIsFinal : stream.isReady(); diff --git a/library/src/main/java/com/google/android/exoplayer2/ExoPlayer.java b/library/src/main/java/com/google/android/exoplayer2/ExoPlayer.java index 1b9986b186..b8038eacf6 100644 --- a/library/src/main/java/com/google/android/exoplayer2/ExoPlayer.java +++ b/library/src/main/java/com/google/android/exoplayer2/ExoPlayer.java @@ -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 * ensures accesses are synchronized. * - *

  • Registered {@link EventListener}s are invoked on the thread that created the - * {@link ExoPlayer} instance.
  • + *
  • Registered {@link EventListener}s are called on the thread that created the {@link ExoPlayer} + * instance.
  • *
  • An internal playback thread is responsible for managing playback and invoking the * {@link Renderer}s in order to load and play the media.
  • *
  • {@link Renderer} implementations (or any upstream components that they depend on) may @@ -89,7 +89,7 @@ import com.google.android.exoplayer2.source.Timeline; * *

    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 - * {@link #setMediaSource(MediaSource)}, {@link #stop()} or {@link #release()} being invoked.

    + * {@link #setMediaSource(MediaSource)}, {@link #stop()} or {@link #release()} being called.

    *

    ExoPlayer playback state transitions

    @@ -102,14 +102,14 @@ public interface ExoPlayer { 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. */ 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. * * @param playWhenReady Whether playback will proceed when ready. @@ -119,19 +119,19 @@ public interface ExoPlayer { void onPlayerStateChanged(boolean playWhenReady, int playbackState); /** - * Invoked when the current value of {@link ExoPlayer#getPlayWhenReady()} has been reflected - * by the internal playback thread. + * Called when the current value of {@link ExoPlayer#getPlayWhenReady()} has been reflected by + * the internal playback thread. *

    * An invocation of this method will shortly follow any call to * {@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. */ 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). * * @param periodIndex The index of the period being played. @@ -140,17 +140,17 @@ public interface ExoPlayer { void onPositionDiscontinuity(int periodIndex, long positionMs); /** - * Invoked when the timeline changes. + * Called when the timeline changes. * * @param timeline The new timeline. */ void onTimelineChanged(Timeline timeline); /** - * Invoked when an error occurs. The playback state will transition to - * {@link ExoPlayer#STATE_IDLE} immediately after this method is invoked. The player instance - * can still be used, and {@link ExoPlayer#release()} must still be called on the player should - * it no longer be required. + * Called when an error occurs. The playback state will transition to + * {@link ExoPlayer#STATE_IDLE} immediately after this method is called. The player instance can + * still be used, and {@link ExoPlayer#release()} must still be called on the player should it + * no longer be required. * * @param error The error. */ @@ -167,7 +167,7 @@ public interface ExoPlayer { 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 message The message object. @@ -225,8 +225,8 @@ public interface ExoPlayer { long UNKNOWN_TIME = -1; /** - * Register a listener to receive events from the player. The listener's methods will be invoked - * on the thread that was used to construct the player. + * Register a listener to receive events from the player. The listener's methods will be called on + * the thread that was used to construct the player. * * @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 * internal playback thread. * - * @return True if the current value has been reflected. False otherwise. + * @return Whether the current value has been reflected. */ boolean isPlayWhenReadyCommitted(); /** * 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(); @@ -313,9 +313,8 @@ public interface ExoPlayer { void stop(); /** - * Releases the player. This method must be called when the player is no longer required. - *

    - * The player must not be used after calling this method. + * Releases the player. This method must be called when the player is no longer required. The + * player must not be used after calling this method. */ void release(); @@ -337,47 +336,35 @@ public interface ExoPlayer { void blockingSendMessages(ExoPlayerMessage... messages); /** - * Gets the duration of the current period in milliseconds. - * - * @return The duration of the current period in milliseconds, or {@link ExoPlayer#UNKNOWN_TIME} - * if the duration is not known. + * Returns the duration of the current period in milliseconds, or {@link ExoPlayer#UNKNOWN_TIME} + * if the duration is not known. */ long getDuration(); /** - * Gets the playback position in the current period, in milliseconds. - * - * @return The playback position in the current period, in milliseconds. + * Returns the playback position in the current period, in milliseconds. */ long getCurrentPosition(); /** - * Gets the index of the current period. - * - * @return The index of the current period. + * Returns the index of the current period. */ int getCurrentPeriodIndex(); /** - * Gets 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. + * Returns the current {@link Timeline}, or {@code null} if there is no timeline. */ Timeline getCurrentTimeline(); /** - * Gets an estimate of the absolute position in milliseconds up to which data is buffered. - * - * @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. + * 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. */ long getBufferedPosition(); /** - * Gets an estimate of the percentage into the media up to which data is buffered. - * - * @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. + * Returns an estimate of the percentage into the media up to which data is buffered, or 0 if no + * estimate is available. */ int getBufferedPercentage(); diff --git a/library/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java b/library/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java index 441400152a..f62c77abe5 100644 --- a/library/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java +++ b/library/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java @@ -56,7 +56,7 @@ import java.util.concurrent.CopyOnWriteArraySet; 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 trackSelector The {@link TrackSelector} that will be used by the instance. diff --git a/library/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java b/library/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java index ef0173fddd..0944584de6 100644 --- a/library/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java +++ b/library/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java @@ -426,7 +426,7 @@ import java.util.ArrayList; boolean allRenderersEnded = true; boolean allRenderersReadyOrEnded = true; 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 // invocation of this method. renderer.render(internalPositionUs, elapsedRealtimeUs); diff --git a/library/src/main/java/com/google/android/exoplayer2/LoadControl.java b/library/src/main/java/com/google/android/exoplayer2/LoadControl.java index e500a06895..49aa2b9002 100644 --- a/library/src/main/java/com/google/android/exoplayer2/LoadControl.java +++ b/library/src/main/java/com/google/android/exoplayer2/LoadControl.java @@ -27,7 +27,7 @@ import com.google.android.exoplayer2.upstream.Allocator; 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 trackGroups The available {@link TrackGroup}s. @@ -37,32 +37,30 @@ public interface LoadControl { 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(); /** - * Gets the {@link Allocator} that should be used to obtain media buffer allocations. - * - * @return The {@link Allocator}. + * Returns the {@link Allocator} that should be used to obtain media buffer allocations. */ 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. * * @param bufferedDurationUs The duration of media that's currently buffered. * @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); /** - * 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. - * @return True if the loading should continue. False otherwise. + * @return Whether the loading should continue. */ boolean shouldContinueLoading(long bufferedDurationUs); diff --git a/library/src/main/java/com/google/android/exoplayer2/Renderer.java b/library/src/main/java/com/google/android/exoplayer2/Renderer.java index da4cd0c5aa..9beb12d5b6 100644 --- a/library/src/main/java/com/google/android/exoplayer2/Renderer.java +++ b/library/src/main/java/com/google/android/exoplayer2/Renderer.java @@ -26,7 +26,7 @@ import java.io.IOException; *

    * 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 - * 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. *

    Renderer state transitions * The default implementation is a no-op. One reason for overriding this method would be to diff --git a/library/src/main/java/com/google/android/exoplayer2/audio/SimpleDecoderAudioRenderer.java b/library/src/main/java/com/google/android/exoplayer2/audio/SimpleDecoderAudioRenderer.java index ec20f6410a..86209ae1a4 100644 --- a/library/src/main/java/com/google/android/exoplayer2/audio/SimpleDecoderAudioRenderer.java +++ b/library/src/main/java/com/google/android/exoplayer2/audio/SimpleDecoderAudioRenderer.java @@ -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 - * (and hence this method will not be invoked again) unless the renderer is disabled and then + * Called when the audio session id becomes known. Once the id is known it will not change (and + * hence this method will not be called again) unless the renderer is disabled and then * subsequently re-enabled. *

    * The default implementation is a no-op. diff --git a/library/src/main/java/com/google/android/exoplayer2/decoder/DecoderCounters.java b/library/src/main/java/com/google/android/exoplayer2/decoder/DecoderCounters.java index e4d1fee20f..3c2d6d96e9 100644 --- a/library/src/main/java/com/google/android/exoplayer2/decoder/DecoderCounters.java +++ b/library/src/main/java/com/google/android/exoplayer2/decoder/DecoderCounters.java @@ -61,9 +61,9 @@ public final class DecoderCounters { public int maxConsecutiveDroppedOutputBufferCount; /** - * Should be invoked from the playback thread after the counters have been updated. Should also - * be invoked from any other thread that wishes to read the counters, before reading. These calls - * ensure that counter updates are made visible to the reading threads. + * Should be called to ensure counter values are made visible across threads. The playback thread + * should call this method after updating the counter values. Any other thread should call this + * method before reading the counters. */ public synchronized void ensureUpdated() { // Do nothing. The use of synchronized ensures a memory barrier should another thread also diff --git a/library/src/main/java/com/google/android/exoplayer2/decoder/SimpleDecoder.java b/library/src/main/java/com/google/android/exoplayer2/decoder/SimpleDecoder.java index 45a08f3dd5..8c8893bbe0 100644 --- a/library/src/main/java/com/google/android/exoplayer2/decoder/SimpleDecoder.java +++ b/library/src/main/java/com/google/android/exoplayer2/decoder/SimpleDecoder.java @@ -279,7 +279,7 @@ public abstract class SimpleDecoder, Parcelable { * Returns whether this initialization data applies to the specified scheme. * * @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) { return C.UUID_NIL.equals(uuid) || schemeUuid.equals(uuid); diff --git a/library/src/main/java/com/google/android/exoplayer2/drm/DrmSession.java b/library/src/main/java/com/google/android/exoplayer2/drm/DrmSession.java index 3cc1cac4df..beaf65a3a6 100644 --- a/library/src/main/java/com/google/android/exoplayer2/drm/DrmSession.java +++ b/library/src/main/java/com/google/android/exoplayer2/drm/DrmSession.java @@ -46,7 +46,7 @@ public interface DrmSession { 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}, * {@link #STATE_OPENED} and {@link #STATE_OPENED_WITH_KEYS}. @@ -54,7 +54,7 @@ public interface DrmSession { int getState(); /** - * Gets a {@link MediaCrypto} for the open session. + * Returns a {@link MediaCrypto} for the open session. *

    * This method may be called when the manager is in the following states: * {@link #STATE_OPENED}, {@link #STATE_OPENED_WITH_KEYS} @@ -80,7 +80,7 @@ public interface DrmSession { boolean requiresSecureDecoderComponent(String mimeType); /** - * Gets the cause of the error state. + * Returns the cause of the error state. *

    * This method may be called when the manager is in any state. * diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/DefaultTrackOutput.java b/library/src/main/java/com/google/android/exoplayer2/extractor/DefaultTrackOutput.java index 8033b83af5..83385f59ef 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/DefaultTrackOutput.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/DefaultTrackOutput.java @@ -43,7 +43,7 @@ public final class DefaultTrackOutput implements TrackOutput { 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. */ @@ -99,7 +99,7 @@ public final class DefaultTrackOutput implements TrackOutput { /** * 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) { 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. * * @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) { long nextOffset = infoQueue.skipToKeyframeBefore(timeUs); diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/ExtractorOutput.java b/library/src/main/java/com/google/android/exoplayer2/extractor/ExtractorOutput.java index 2d440ba198..d138c7ce3a 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/ExtractorOutput.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/ExtractorOutput.java @@ -21,7 +21,7 @@ package com.google.android.exoplayer2.extractor; 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. *

    * 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); /** - * Invoked when all tracks have been identified, meaning that {@link #track(int)} will not be - * invoked again. + * Called when all tracks have been identified, meaning that {@link #track(int)} will not be + * called again. */ 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}. */ diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/SeekMap.java b/library/src/main/java/com/google/android/exoplayer2/extractor/SeekMap.java index 7fb57bc5ea..c612d20d7b 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/SeekMap.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/SeekMap.java @@ -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 * {@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(); diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/TrackOutput.java b/library/src/main/java/com/google/android/exoplayer2/extractor/TrackOutput.java index bb12d2aa3c..98468181c7 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/TrackOutput.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/TrackOutput.java @@ -28,14 +28,14 @@ import java.io.IOException; 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}. */ 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 length The maximum length to read from the input. @@ -50,7 +50,7 @@ public interface TrackOutput { 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 length The number of bytes to read. @@ -58,7 +58,7 @@ public interface TrackOutput { 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. *

    * The corresponding sample data will have already been passed to the output via calls to * {@link #sampleData(ExtractorInput, int, boolean)} or diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/flv/TagPayloadReader.java b/library/src/main/java/com/google/android/exoplayer2/extractor/flv/TagPayloadReader.java index 728c7b5df7..e8652d653f 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/flv/TagPayloadReader.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/flv/TagPayloadReader.java @@ -70,8 +70,7 @@ import com.google.android.exoplayer2.util.ParsableByteArray; * Parses tag header. * * @param data Buffer where the tag header is stored. - * @return True if the header was parsed successfully and the payload should be read. False - * otherwise. + * @return Whether the header was parsed successfully. * @throws ParserException If an error occurs parsing the header. */ protected abstract boolean parseHeader(ParsableByteArray data) throws ParserException; diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/mkv/EbmlReaderOutput.java b/library/src/main/java/com/google/android/exoplayer2/extractor/mkv/EbmlReaderOutput.java index 7321d127a6..c4467fd956 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/mkv/EbmlReaderOutput.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/mkv/EbmlReaderOutput.java @@ -40,7 +40,7 @@ import java.io.IOException; * Checks if the given id is that of a level 1 element. * * @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); @@ -102,7 +102,7 @@ import java.io.IOException; * 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 * (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 contentsSize The element's content size. diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java b/library/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java index d1091c300d..bc5c527383 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/mkv/MatroskaExtractor.java @@ -1070,7 +1070,7 @@ public final class MatroskaExtractor implements Extractor { * * @param seekPosition The holder whose position will be updated. * @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) { if (seekForCues) { @@ -1553,7 +1553,7 @@ public final class MatroskaExtractor implements Extractor { /** * 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. */ private static boolean parseMsAcmCodecPrivate(ParsableByteArray buffer) throws ParserException { diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/Atom.java b/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/Atom.java index ea9ec4bdf5..6801fd4214 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/Atom.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/Atom.java @@ -202,7 +202,7 @@ import java.util.List; } /** - * Gets the child leaf of the given type. + * Returns the child leaf of the given type. *

    * 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. @@ -222,7 +222,7 @@ import java.util.List; } /** - * Gets the child container of the given type. + * Returns the child container of the given type. *

    * 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. diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java b/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java index 713b5987e6..b48370a7f0 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/FragmentedMp4Extractor.java @@ -129,7 +129,7 @@ public final class FragmentedMp4Extractor implements Extractor { // Extractor output. private ExtractorOutput extractorOutput; - // Whether extractorOutput.seekMap has been invoked. + // Whether extractorOutput.seekMap has been called. private boolean haveOutputSeekMap; 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. * * @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 InterruptedException If the thread is interrupted. */ diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/Mp4Extractor.java b/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/Mp4Extractor.java index da93130c95..bddad29dc1 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/Mp4Extractor.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/Mp4Extractor.java @@ -286,7 +286,7 @@ public final class Mp4Extractor implements Extractor, SeekMap { * Process an ftyp atom to determine whether the media is QuickTime. * * @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) { atomData.setPosition(Atom.HEADER_SIZE); diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/Sniffer.java b/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/Sniffer.java index 465e33a1a4..05c75a0b6a 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/Sniffer.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/Sniffer.java @@ -65,7 +65,7 @@ import java.io.IOException; * input being a fragmented MP4 file. * * @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 InterruptedException If the thread has been interrupted. */ @@ -79,7 +79,7 @@ import java.io.IOException; * input being an unfragmented MP4 file. * * @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 InterruptedException If the thread has been interrupted. */ diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/TrackFragment.java b/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/TrackFragment.java index d4925c2133..9db7aec9e8 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/TrackFragment.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/mp4/TrackFragment.java @@ -58,7 +58,7 @@ import java.io.IOException; */ public boolean[] sampleIsSyncFrameTable; /** - * True if the fragment defines encryption data. False otherwise. + * Whether the fragment defines encryption data. */ public boolean definesEncryptionData; /** diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/ogg/StreamReader.java b/library/src/main/java/com/google/android/exoplayer2/extractor/ogg/StreamReader.java index 34297a51e6..6067b749f4 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/ogg/StreamReader.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/ogg/StreamReader.java @@ -222,7 +222,7 @@ import java.io.IOException; * @param packet An ogg packet. * @param position Position of the given header packet. * @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, SetupData setupData) throws IOException, InterruptedException; diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/ogg/VorbisBitArray.java b/library/src/main/java/com/google/android/exoplayer2/extractor/ogg/VorbisBitArray.java index 5426105972..c6c9efc0f7 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/ogg/VorbisBitArray.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/ogg/VorbisBitArray.java @@ -50,7 +50,9 @@ import com.google.android.exoplayer2.util.Assertions; this.limit = limit * 8; } - /** Resets the reading position to zero. */ + /** + * Resets the reading position to zero. + */ public void reset() { byteOffset = 0; bitOffset = 0; @@ -69,7 +71,7 @@ import com.google.android.exoplayer2.util.Assertions; * Reads up to 32 bits. * * @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) { Assertions.checkState(getPosition() + numBits <= limit); @@ -109,7 +111,7 @@ import com.google.android.exoplayer2.util.Assertions; /** * 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) { Assertions.checkState(getPosition() + numberOfBits <= limit); @@ -122,18 +124,16 @@ import com.google.android.exoplayer2.util.Assertions; } /** - * Gets the current reading position in bits. - * - * @return the current reading position in bits. + * Returns the reading position in bits. */ public int getPosition() { 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) { Assertions.checkArgument(position < limit && position >= 0); @@ -142,9 +142,7 @@ import com.google.android.exoplayer2.util.Assertions; } /** - * Gets the number of remaining bits. - * - * @return number of remaining bits. + * Returns the number of remaining bits. */ public int bitsLeft() { return limit - getPosition(); @@ -152,8 +150,6 @@ import com.google.android.exoplayer2.util.Assertions; /** * Returns the limit in bits. - * - * @return the limit in bits. **/ public int limit() { return limit; diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/ts/Ac3Reader.java b/library/src/main/java/com/google/android/exoplayer2/extractor/ts/Ac3Reader.java index c151a35853..09d2d1ec61 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/ts/Ac3Reader.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/ts/Ac3Reader.java @@ -138,7 +138,7 @@ import com.google.android.exoplayer2.util.ParsableByteArray; * syncword was not located, the position is advanced to the limit. * * @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) { while (pesBuffer.bytesLeft() > 0) { diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/ts/DtsReader.java b/library/src/main/java/com/google/android/exoplayer2/extractor/ts/DtsReader.java index 24bc0aed8d..35b73691eb 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/ts/DtsReader.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/ts/DtsReader.java @@ -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. * * @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) { while (pesBuffer.bytesLeft() > 0) { diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/ts/ElementaryStreamReader.java b/library/src/main/java/com/google/android/exoplayer2/extractor/ts/ElementaryStreamReader.java index ad601896f4..13029ca04e 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/ts/ElementaryStreamReader.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/ts/ElementaryStreamReader.java @@ -38,7 +38,7 @@ import com.google.android.exoplayer2.util.ParsableByteArray; public abstract void seek(); /** - * Invoked when a packet starts. + * Called when a packet starts. * * @param pesTimeUs The timestamp 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); /** - * Invoked when a packet ends. + * Called when a packet ends. */ public abstract void packetFinished(); diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/ts/H262Reader.java b/library/src/main/java/com/google/android/exoplayer2/extractor/ts/H262Reader.java index 09d71efdf0..d0604c7741 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/ts/H262Reader.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/ts/H262Reader.java @@ -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 bytesAlreadyPassed The number of bytes of the start code that have already been * 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 * 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 offset The offset of the data in {@code data}. diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/ts/H264Reader.java b/library/src/main/java/com/google/android/exoplayer2/extractor/ts/H264Reader.java index 4c5997ddb7..19c253eb08 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/ts/H264Reader.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/ts/H264Reader.java @@ -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 offset The offset of the data in {@code data}. diff --git a/library/src/main/java/com/google/android/exoplayer2/extractor/ts/NalUnitTargetBuffer.java b/library/src/main/java/com/google/android/exoplayer2/extractor/ts/NalUnitTargetBuffer.java index cf97af47d9..57e6795e44 100644 --- a/library/src/main/java/com/google/android/exoplayer2/extractor/ts/NalUnitTargetBuffer.java +++ b/library/src/main/java/com/google/android/exoplayer2/extractor/ts/NalUnitTargetBuffer.java @@ -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. */ @@ -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 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 * {@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) { if (!isFilling) { diff --git a/library/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java b/library/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java index c375cc2f5b..e0ff11fb4d 100644 --- a/library/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java +++ b/library/src/main/java/com/google/android/exoplayer2/mediacodec/MediaCodecRenderer.java @@ -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. */ 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. *

    * 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. * @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. *

    * 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 - * and the {@link MediaCodec#BUFFER_FLAG_END_OF_STREAM} flag has been propagated through the - * decoder. + * Called when the output stream ends, meaning that the last output buffer has been processed and + * the {@link MediaCodec#BUFFER_FLAG_END_OF_STREAM} flag has been propagated through the decoder. *

    * 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. *

    * 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. *

    * 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 oldFormat The format for which the existing instance is configured. * @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, 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. */ @SuppressWarnings("deprecation") @@ -948,7 +947,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer { * @param bufferIndex The index of the output buffer. * @param bufferFlags The flags attached to the output buffer. * @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). * @throws ExoPlaybackException If an error occurs processing the output buffer. diff --git a/library/src/main/java/com/google/android/exoplayer2/metadata/MetadataRenderer.java b/library/src/main/java/com/google/android/exoplayer2/metadata/MetadataRenderer.java index c834071e8c..1071078a0b 100644 --- a/library/src/main/java/com/google/android/exoplayer2/metadata/MetadataRenderer.java +++ b/library/src/main/java/com/google/android/exoplayer2/metadata/MetadataRenderer.java @@ -45,7 +45,7 @@ public final class MetadataRenderer extends BaseRenderer implements Callback public interface Output { /** - * 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. */ @@ -67,11 +67,11 @@ public final class MetadataRenderer extends BaseRenderer implements Callback /** * @param output The output. - * @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 - * 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 - * should be invoked directly on the player's internal rendering thread. + * @param outputLooper The looper associated with the thread on which the output should be 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 using + * {@link android.app.Activity#getMainLooper()}. Null may be passed if the output should be + * called directly on the player's internal rendering thread. * @param metadataDecoder A decoder for the metadata. */ public MetadataRenderer(Output output, Looper outputLooper, diff --git a/library/src/main/java/com/google/android/exoplayer2/source/AdaptiveMediaSourceEventListener.java b/library/src/main/java/com/google/android/exoplayer2/source/AdaptiveMediaSourceEventListener.java index 4518aa44bd..b8480b3b8b 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/AdaptiveMediaSourceEventListener.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/AdaptiveMediaSourceEventListener.java @@ -31,7 +31,7 @@ import java.io.IOException; public interface AdaptiveMediaSourceEventListener { /** - * Invoked when a load begins. + * Called when a load begins. * * @param dataSpec Defines the data being loaded. * @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); /** - * Invoked when a load ends. + * Called when a load ends. * * @param dataSpec Defines the data being loaded. * @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); /** - * Invoked when a load is canceled. + * Called when a load is canceled. * * @param dataSpec Defines the data being loaded. * @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); /** - * Invoked when a load error occurs. + * Called when a load error occurs. *

    * 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 - * not be invoked in addition to this method. + * not be called in addition to this method. * * @param dataSpec Defines the data being loaded. * @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 bytesLoaded The number of bytes that were loaded prior to the 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, int trackSelectionReason, Object trackSelectionData, long mediaStartTimeMs, @@ -142,7 +142,7 @@ public interface AdaptiveMediaSourceEventListener { 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. * * @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); /** - * 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). * * @param trackType The type of the media. One of the {@link C} {@code TRACK_TYPE_*} constants. diff --git a/library/src/main/java/com/google/android/exoplayer2/source/MediaPeriod.java b/library/src/main/java/com/google/android/exoplayer2/source/MediaPeriod.java index ee2a679e22..617e2f3be8 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/MediaPeriod.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/MediaPeriod.java @@ -33,10 +33,10 @@ public interface MediaPeriod extends SequenceableLoader { interface Callback extends SequenceableLoader.Callback { /** - * Invoked when preparation completes. + * Called when preparation completes. *

    * 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}. */ @@ -47,9 +47,9 @@ public interface MediaPeriod extends SequenceableLoader { /** * Starts preparation of the period. *

    - * {@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 - * invoked. + * called. * * @param callback A callback to receive updates from the period. * @param allocator An {@link Allocator} from which to obtain media buffer allocations. diff --git a/library/src/main/java/com/google/android/exoplayer2/source/MediaSource.java b/library/src/main/java/com/google/android/exoplayer2/source/MediaSource.java index 489128b964..c545e7efcd 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/MediaSource.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/MediaSource.java @@ -28,7 +28,7 @@ public interface MediaSource { interface InvalidationListener { /** - * Invoked when the timeline is invalidated. + * Called when the timeline is invalidated. *

    * May only be called on the player's thread. * diff --git a/library/src/main/java/com/google/android/exoplayer2/source/SampleStream.java b/library/src/main/java/com/google/android/exoplayer2/source/SampleStream.java index c385de73a8..72cdd13178 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/SampleStream.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/SampleStream.java @@ -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 * {@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(); diff --git a/library/src/main/java/com/google/android/exoplayer2/source/SequenceableLoader.java b/library/src/main/java/com/google/android/exoplayer2/source/SequenceableLoader.java index 0f6ae5ab14..ae8648f657 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/SequenceableLoader.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/SequenceableLoader.java @@ -28,8 +28,8 @@ public interface SequenceableLoader { interface Callback { /** - * Invoked by the loader to indicate that it wishes for its {@link #continueLoading(long)} - * method to be called when it can continue to load data. + * Called by the loader to indicate that it wishes for its {@link #continueLoading(long)} method + * to be called when it can continue to load data. */ void onContinueLoadingRequested(T source); diff --git a/library/src/main/java/com/google/android/exoplayer2/source/TrackGroup.java b/library/src/main/java/com/google/android/exoplayer2/source/TrackGroup.java index b9fd3719fe..27abf26f9f 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/TrackGroup.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/TrackGroup.java @@ -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. * @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. * @return The index of the track, or -1 if no such track exists. diff --git a/library/src/main/java/com/google/android/exoplayer2/source/TrackGroupArray.java b/library/src/main/java/com/google/android/exoplayer2/source/TrackGroupArray.java index 7f3169aa5b..be7a53507f 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/TrackGroupArray.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/TrackGroupArray.java @@ -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. * @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. * @return The index of the group, or -1 if no such group exists. diff --git a/library/src/main/java/com/google/android/exoplayer2/source/chunk/Chunk.java b/library/src/main/java/com/google/android/exoplayer2/source/chunk/Chunk.java index ffaf185492..4767e2a1fa 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/chunk/Chunk.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/chunk/Chunk.java @@ -88,18 +88,14 @@ public abstract class Chunk implements Loadable { } /** - * Gets the duration of the chunk in microseconds. - * - * @return The duration of the chunk in microseconds. + * Returns the duration of the chunk in microseconds. */ public final long getDurationUs() { return endTimeUs - startTimeUs; } /** - * Gets the number of bytes that have been loaded. - * - * @return The number of bytes that have been loaded. + * Returns the number of bytes that have been loaded. */ public abstract long bytesLoaded(); diff --git a/library/src/main/java/com/google/android/exoplayer2/source/chunk/ChunkSampleStream.java b/library/src/main/java/com/google/android/exoplayer2/source/chunk/ChunkSampleStream.java index e28531b2f1..00575d4afc 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/chunk/ChunkSampleStream.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/chunk/ChunkSampleStream.java @@ -322,7 +322,7 @@ public class ChunkSampleStream implements SampleStream, S * Discard upstream media chunks until the queue length is equal to the length specified. * * @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) { if (mediaChunks.size() <= queueLength) { diff --git a/library/src/main/java/com/google/android/exoplayer2/source/chunk/ChunkSource.java b/library/src/main/java/com/google/android/exoplayer2/source/chunk/ChunkSource.java index e36400c492..df3654f80d 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/chunk/ChunkSource.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/chunk/ChunkSource.java @@ -47,7 +47,7 @@ public interface ChunkSource { int getPreferredQueueSize(long playbackPositionUs, List queue); /** - * Gets the next chunk to load. + * Returns the next chunk to load. *

    * 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 @@ -62,7 +62,7 @@ public interface ChunkSource { 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. *

    * This method should only be called when the source is enabled. @@ -72,7 +72,7 @@ public interface ChunkSource { 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 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 cancelable Whether the load can be canceled. * @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); diff --git a/library/src/main/java/com/google/android/exoplayer2/source/chunk/DataChunk.java b/library/src/main/java/com/google/android/exoplayer2/source/chunk/DataChunk.java index caf1fa0f5a..b5779df03d 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/chunk/DataChunk.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/chunk/DataChunk.java @@ -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. * * @param data An array containing the data. diff --git a/library/src/main/java/com/google/android/exoplayer2/source/chunk/FormatEvaluator.java b/library/src/main/java/com/google/android/exoplayer2/source/chunk/FormatEvaluator.java index 01141f8c96..55a0c2cad6 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/chunk/FormatEvaluator.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/chunk/FormatEvaluator.java @@ -54,9 +54,9 @@ public interface FormatEvaluator { /** * Update the supplied evaluation. *

    - * When invoked, {@code evaluation} must contain the currently selected format (null for an - * initial evaluation), the most recent reason ({@link C#SELECTION_REASON_INITIAL} for an - * initial evaluation) and the most recent evaluation data (null for an initial evaluation). + * When called, {@code evaluation} must contain the currently selected format (null for an initial + * evaluation), the most recent reason ({@link C#SELECTION_REASON_INITIAL} for an initial + * evaluation) and the most recent evaluation data (null for an initial evaluation). * * @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 diff --git a/library/src/main/java/com/google/android/exoplayer2/source/dash/DashSegmentIndex.java b/library/src/main/java/com/google/android/exoplayer2/source/dash/DashSegmentIndex.java index 2f907dee97..103ab96fde 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/dash/DashSegmentIndex.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/dash/DashSegmentIndex.java @@ -96,7 +96,7 @@ public interface DashSegmentIndex { * segment duration. If the presentation is dynamic, it's possible that only a subset of the * 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(); diff --git a/library/src/main/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestParser.java b/library/src/main/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestParser.java index 5fc9c27705..fe7eee614a 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestParser.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/dash/manifest/DashManifestParser.java @@ -673,7 +673,7 @@ public class DashManifestParser extends DefaultHandler * Returns whether a mimeType is a text sample 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) { return MimeTypes.isText(mimeType) || MimeTypes.APPLICATION_TTML.equals(mimeType); diff --git a/library/src/main/java/com/google/android/exoplayer2/source/dash/manifest/Representation.java b/library/src/main/java/com/google/android/exoplayer2/source/dash/manifest/Representation.java index 770aca793c..eee488112c 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/dash/manifest/Representation.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/dash/manifest/Representation.java @@ -105,36 +105,27 @@ public abstract class Representation { } /** - * Gets a {@link RangedUri} defining the location of the representation's initialization data. - * May be null if no initialization data exists. - * - * @return A {@link RangedUri} defining the location of the initialization data, or null. + * Returns a {@link RangedUri} defining the location of the representation's initialization data, + * or null if no initialization data exists. */ public RangedUri getInitializationUri() { return initializationUri; } /** - * Gets a {@link RangedUri} defining the location of the representation's segment index. Null if - * the representation provides an index directly. - * - * @return The location of the segment index, or null. + * Returns a {@link RangedUri} defining the location of the representation's segment index, or + * null if the representation provides an index directly. */ public abstract RangedUri getIndexUri(); /** - * Gets a segment index, if the representation is able to provide one directly. Null if the - * segment index is defined externally. - * - * @return The segment index, or null. + * Returns an index if the representation provides one directly, or null otherwise. */ 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}. - * - * @return A cache key. */ public String getCacheKey() { return cacheKey; diff --git a/library/src/main/java/com/google/android/exoplayer2/source/dash/manifest/SegmentBase.java b/library/src/main/java/com/google/android/exoplayer2/source/dash/manifest/SegmentBase.java index d4f7ae0f0d..2925669dbe 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/dash/manifest/SegmentBase.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/dash/manifest/SegmentBase.java @@ -44,8 +44,8 @@ public abstract class SegmentBase { } /** - * Gets the {@link RangedUri} defining the location of initialization data for a given - * representation. May be null if no initialization data exists. + * Returns the {@link RangedUri} defining the location of initialization data for a given + * representation, or null if no initialization data exists. * * @param representation The {@link Representation} for which initialization data is required. * @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. - * - * @return The presentation time offset, in microseconds. + * Returns the presentation time offset, in microseconds. */ public long getPresentationTimeOffsetUs() { return Util.scaleLargeTimestamp(presentationTimeOffset, C.MICROS_PER_SECOND, timescale); diff --git a/library/src/main/java/com/google/android/exoplayer2/source/hls/HlsChunkSource.java b/library/src/main/java/com/google/android/exoplayer2/source/hls/HlsChunkSource.java index 2b6ff67108..f254f82854 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/hls/HlsChunkSource.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/hls/HlsChunkSource.java @@ -144,8 +144,6 @@ public class HlsChunkSource { /** * Returns whether this is a live playback. - * - * @return True if this is a live playback. False otherwise. */ public boolean isLive() { 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. - * - * @return The number of tracks. */ public long getDurationUs() { return durationUs; @@ -162,8 +158,6 @@ public class HlsChunkSource { /** * Returns the track group exposed by the source. - * - * @return The track group. */ public TrackGroup getTrackGroup() { return trackGroup; @@ -186,7 +180,7 @@ public class HlsChunkSource { } /** - * Gets the next chunk to load. + * Returns the next chunk to load. *

    * 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 @@ -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. * * @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. * * @param chunk The chunk whose load encountered the error. * @param cancelable Whether the load can be canceled. * @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) { if (cancelable && e instanceof InvalidResponseCodeException) { diff --git a/library/src/main/java/com/google/android/exoplayer2/source/hls/HlsMediaChunk.java b/library/src/main/java/com/google/android/exoplayer2/source/hls/HlsMediaChunk.java index 35170e2f73..e0ebfdb44f 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/hls/HlsMediaChunk.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/hls/HlsMediaChunk.java @@ -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. - * - * @return The start time in microseconds. + * Returns the presentation time in microseconds of the first sample in the chunk. */ public long getAdjustedStartTimeUs() { return adjustedEndTimeUs - getDurationUs(); } /** - * Gets the presentation time in microseconds of the last sample contained in the chunk - * - * @return 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 */ public long getAdjustedEndTimeUs() { return adjustedEndTimeUs; diff --git a/library/src/main/java/com/google/android/exoplayer2/source/hls/HlsSampleStreamWrapper.java b/library/src/main/java/com/google/android/exoplayer2/source/hls/HlsSampleStreamWrapper.java index 70017f06d7..52865d38c7 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/hls/HlsSampleStreamWrapper.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/hls/HlsSampleStreamWrapper.java @@ -55,7 +55,7 @@ import java.util.List; public interface Callback extends SequenceableLoader.Callback { /** - * Invoked when the wrapper has been prepared. + * Called when the wrapper has been prepared. */ void onPrepared(); diff --git a/library/src/main/java/com/google/android/exoplayer2/source/hls/PtsTimestampAdjusterProvider.java b/library/src/main/java/com/google/android/exoplayer2/source/hls/PtsTimestampAdjusterProvider.java index 61e4d9f54c..0efdb3646d 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/hls/PtsTimestampAdjusterProvider.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/hls/PtsTimestampAdjusterProvider.java @@ -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. *

    * This method may return null if the master source has yet to initialize a suitable adjuster. diff --git a/library/src/main/java/com/google/android/exoplayer2/source/smoothstreaming/manifest/SsManifest.java b/library/src/main/java/com/google/android/exoplayer2/source/smoothstreaming/manifest/SsManifest.java index 01a59530d6..869190fc24 100644 --- a/library/src/main/java/com/google/android/exoplayer2/source/smoothstreaming/manifest/SsManifest.java +++ b/library/src/main/java/com/google/android/exoplayer2/source/smoothstreaming/manifest/SsManifest.java @@ -50,7 +50,7 @@ public class SsManifest { 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; @@ -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. * @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. * @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. * @return The duration of the chunk, in microseconds. diff --git a/library/src/main/java/com/google/android/exoplayer2/text/TextRenderer.java b/library/src/main/java/com/google/android/exoplayer2/text/TextRenderer.java index c7e930359b..ffa61c5d09 100644 --- a/library/src/main/java/com/google/android/exoplayer2/text/TextRenderer.java +++ b/library/src/main/java/com/google/android/exoplayer2/text/TextRenderer.java @@ -46,7 +46,7 @@ public final class TextRenderer extends BaseRenderer implements Callback { 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. */ @@ -72,10 +72,10 @@ public final class TextRenderer extends BaseRenderer implements Callback { /** * @param output The output. * @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 * 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) { this(output, outputLooper, SubtitleDecoderFactory.DEFAULT); @@ -84,10 +84,10 @@ public final class TextRenderer extends BaseRenderer implements Callback { /** * @param output The output. * @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 * 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. */ public TextRenderer(Output output, Looper outputLooper, SubtitleDecoderFactory decoderFactory) { diff --git a/library/src/main/java/com/google/android/exoplayer2/text/eia608/Eia608Decoder.java b/library/src/main/java/com/google/android/exoplayer2/text/eia608/Eia608Decoder.java index 2f280bd2af..0c9f4a3eb5 100644 --- a/library/src/main/java/com/google/android/exoplayer2/text/eia608/Eia608Decoder.java +++ b/library/src/main/java/com/google/android/exoplayer2/text/eia608/Eia608Decoder.java @@ -535,7 +535,7 @@ public final class Eia608Decoder implements SubtitleDecoder { * @param payloadType The payload type of the message. * @param payloadLength The length of 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, ParsableByteArray payload) { diff --git a/library/src/main/java/com/google/android/exoplayer2/text/ttml/TtmlRenderUtil.java b/library/src/main/java/com/google/android/exoplayer2/text/ttml/TtmlRenderUtil.java index 6efd52fa19..b45233ecb7 100644 --- a/library/src/main/java/com/google/android/exoplayer2/text/ttml/TtmlRenderUtil.java +++ b/library/src/main/java/com/google/android/exoplayer2/text/ttml/TtmlRenderUtil.java @@ -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. * * @param builder The builder. diff --git a/library/src/main/java/com/google/android/exoplayer2/text/webvtt/WebvttCue.java b/library/src/main/java/com/google/android/exoplayer2/text/webvtt/WebvttCue.java index ad5b955f4b..345f3ef50b 100644 --- a/library/src/main/java/com/google/android/exoplayer2/text/webvtt/WebvttCue.java +++ b/library/src/main/java/com/google/android/exoplayer2/text/webvtt/WebvttCue.java @@ -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 * 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() { return (line == DIMEN_UNSET && position == DIMEN_UNSET); diff --git a/library/src/main/java/com/google/android/exoplayer2/text/webvtt/WebvttCueParser.java b/library/src/main/java/com/google/android/exoplayer2/text/webvtt/WebvttCueParser.java index 8950c27ed8..2dd5bc6d46 100644 --- a/library/src/main/java/com/google/android/exoplayer2/text/webvtt/WebvttCueParser.java +++ b/library/src/main/java/com/google/android/exoplayer2/text/webvtt/WebvttCueParser.java @@ -88,7 +88,7 @@ import java.util.regex.Pattern; * @param webvttData Parsable WebVTT file data. * @param builder Builder for WebVTT 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, List styles) { diff --git a/library/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java b/library/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java index ccbcc38ff5..e721059ae4 100644 --- a/library/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java +++ b/library/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java @@ -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) { 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 - * otherwise. + * @param allowNonSeamlessAdaptiveness Whether non-seamless adaptation is allowed. */ public void allowNonSeamlessAdaptiveness(boolean allowNonSeamlessAdaptiveness) { if (this.allowNonSeamlessAdaptiveness != allowNonSeamlessAdaptiveness) { diff --git a/library/src/main/java/com/google/android/exoplayer2/trackselection/MappingTrackSelector.java b/library/src/main/java/com/google/android/exoplayer2/trackselection/MappingTrackSelector.java index 51146a095b..6e0fdce015 100644 --- a/library/src/main/java/com/google/android/exoplayer2/trackselection/MappingTrackSelector.java +++ b/library/src/main/java/com/google/android/exoplayer2/trackselection/MappingTrackSelector.java @@ -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. * * @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. - * - * @return Contains the current tracks and track selection information. + * Returns information about the current tracks and track selection for each renderer. */ public final TrackInfo getTrackInfo() { return activeTrackInfo; @@ -104,7 +102,7 @@ public abstract class MappingTrackSelector extends TrackSelector { * Sets whether the renderer at the specified index is disabled. * * @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) { if (rendererDisabledFlags.get(rendererIndex) == disabled) { @@ -119,7 +117,7 @@ public abstract class MappingTrackSelector extends TrackSelector { * Returns whether the renderer is disabled. * * @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) { return rendererDisabledFlags.get(rendererIndex); @@ -163,7 +161,7 @@ public abstract class MappingTrackSelector extends TrackSelector { * * @param rendererIndex The renderer index. * @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) { Map 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. * @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. * @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. * @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 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}. *

    * 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 - * {@link TrackGroup}. + * Returns the extent to which the renderer supports adaptation between specified tracks within + * a {@link TrackGroup}. * * @param rendererIndex The renderer index. * @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. - * - * @return The {@link TrackGroup}s not associated with any renderer. + * Returns the {@link TrackGroup}s not associated with any renderer. */ public TrackGroupArray getUnassociatedTrackGroups() { return unassociatedTrackGroups; diff --git a/library/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelection.java b/library/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelection.java index b22e1d881b..05fc6061c6 100644 --- a/library/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelection.java +++ b/library/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelection.java @@ -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. * @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. - * - * @return The track formats. + * Returns a copy of the formats of the selected tracks. */ public Format[] getFormats() { 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. * @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. * @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. - * - * @return The track indices. + * Returns a copy of the selected tracks in the track group. */ public int[] getTracks() { 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. * @return The index in the selection, or -1 if the track with the specified index is not part of diff --git a/library/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectionArray.java b/library/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectionArray.java index d099e7e696..20915f0e08 100644 --- a/library/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectionArray.java +++ b/library/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectionArray.java @@ -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. * @return The selection. diff --git a/library/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelector.java b/library/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelector.java index 095b8135df..fcb152179f 100644 --- a/library/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelector.java +++ b/library/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelector.java @@ -32,7 +32,7 @@ public abstract class TrackSelector { 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(); @@ -69,7 +69,7 @@ public abstract class TrackSelector { throws ExoPlaybackException; /** - * Invoked when a selection previously generated by + * Called when a selection previously generated by * {@link #selectTracks(RendererCapabilities[], TrackGroupArray)} is activated. * * @param selectionInfo The opaque object associated with the selection. diff --git a/library/src/main/java/com/google/android/exoplayer2/upstream/BandwidthMeter.java b/library/src/main/java/com/google/android/exoplayer2/upstream/BandwidthMeter.java index 973e291cb1..21bdddf9b8 100644 --- a/library/src/main/java/com/google/android/exoplayer2/upstream/BandwidthMeter.java +++ b/library/src/main/java/com/google/android/exoplayer2/upstream/BandwidthMeter.java @@ -26,7 +26,7 @@ public interface BandwidthMeter { interface EventListener { /** - * Invoked periodically to indicate that bytes have been transferred. + * Called periodically to indicate that bytes have been transferred. *

    * Note: The estimated bitrate is typically derived from more information than just * {@code bytes} and {@code elapsedMs}. diff --git a/library/src/main/java/com/google/android/exoplayer2/upstream/cache/Cache.java b/library/src/main/java/com/google/android/exoplayer2/upstream/cache/Cache.java index b6a3ac8ba9..7f84e97a6e 100644 --- a/library/src/main/java/com/google/android/exoplayer2/upstream/cache/Cache.java +++ b/library/src/main/java/com/google/android/exoplayer2/upstream/cache/Cache.java @@ -51,7 +51,7 @@ public interface Cache { * {@link CacheSpan#file} and {@link CacheSpan#lastAccessTimestamp} may have changed. *

    * 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 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. *

    - * No guarantees are made about the thread or threads on which the listener is invoked, but it - * is guaranteed that listener methods will be invoked in a serial fashion (i.e. one at a time) - * and in the same order as events occurred. + * No guarantees are made about the thread or threads on which the listener is called, but it is + * guaranteed that listener methods will be called in a serial fashion (i.e. one at a time) and in + * the same order as events occurred. * * @param key The key to listen to. * @param listener The listener to add. diff --git a/library/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSource.java b/library/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSource.java index d31c7da867..b704617f4e 100644 --- a/library/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSource.java +++ b/library/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheDataSource.java @@ -45,7 +45,7 @@ public final class CacheDataSource implements DataSource { * Called when bytes have been read from the cache. * * @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); diff --git a/library/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheEvictor.java b/library/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheEvictor.java index f777124f0c..665039f939 100644 --- a/library/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheEvictor.java +++ b/library/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheEvictor.java @@ -21,11 +21,13 @@ package com.google.android.exoplayer2.upstream.cache; */ public interface CacheEvictor extends Cache.Listener { - /** Invoked when cache has beeen initialized. */ + /** + * Called when cache has beeen initialized. + */ 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 key The key being written. diff --git a/library/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheSpan.java b/library/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheSpan.java index 7ef9c8e16c..dbb00c197b 100644 --- a/library/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheSpan.java +++ b/library/src/main/java/com/google/android/exoplayer2/upstream/cache/CacheSpan.java @@ -120,7 +120,7 @@ public final class CacheSpan implements Comparable { } /** - * @return True if this is an open-ended {@link CacheSpan}. False otherwise. + * Returns whether this is an open-ended {@link CacheSpan}. */ public boolean isOpenEnded() { return length == -1; diff --git a/library/src/main/java/com/google/android/exoplayer2/util/ParsableBitArray.java b/library/src/main/java/com/google/android/exoplayer2/util/ParsableBitArray.java index c8d9cd47d4..83f83c7921 100644 --- a/library/src/main/java/com/google/android/exoplayer2/util/ParsableBitArray.java +++ b/library/src/main/java/com/google/android/exoplayer2/util/ParsableBitArray.java @@ -118,7 +118,7 @@ public final class ParsableBitArray { /** * Reads a single bit. * - * @return True if the bit is set. False otherwise. + * @return Whether the bit is set. */ public boolean readBit() { return readBits(1) == 1; diff --git a/library/src/main/java/com/google/android/exoplayer2/util/ParsableNalUnitBitArray.java b/library/src/main/java/com/google/android/exoplayer2/util/ParsableNalUnitBitArray.java index 44d9718b0d..b275e4cf34 100644 --- a/library/src/main/java/com/google/android/exoplayer2/util/ParsableNalUnitBitArray.java +++ b/library/src/main/java/com/google/android/exoplayer2/util/ParsableNalUnitBitArray.java @@ -104,7 +104,7 @@ public final class ParsableNalUnitBitArray { /** * Reads a single bit. * - * @return True if the bit is set. False otherwise. + * @return Whether the bit is set. */ public boolean readBit() { return readBits(1) == 1; diff --git a/library/src/main/java/com/google/android/exoplayer2/util/XmlPullParserUtil.java b/library/src/main/java/com/google/android/exoplayer2/util/XmlPullParserUtil.java index 93830b6755..84a6e4cebf 100644 --- a/library/src/main/java/com/google/android/exoplayer2/util/XmlPullParserUtil.java +++ b/library/src/main/java/com/google/android/exoplayer2/util/XmlPullParserUtil.java @@ -30,7 +30,7 @@ public final class XmlPullParserUtil { * * @param xpp The {@link XmlPullParser} to query. * @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. */ 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. * * @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. */ public static boolean isEndTag(XmlPullParser xpp) throws XmlPullParserException { @@ -53,7 +53,7 @@ public final class XmlPullParserUtil { * * @param xpp The {@link XmlPullParser} to query. * @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. */ 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. * * @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. */ public static boolean isStartTag(XmlPullParser xpp) throws XmlPullParserException { diff --git a/playbacktests/src/main/java/com/google/android/exoplayer2/playbacktests/gts/DashTest.java b/playbacktests/src/main/java/com/google/android/exoplayer2/playbacktests/gts/DashTest.java index c5fce769fc..7a63b8d393 100644 --- a/playbacktests/src/main/java/com/google/android/exoplayer2/playbacktests/gts/DashTest.java +++ b/playbacktests/src/main/java/com/google/android/exoplayer2/playbacktests/gts/DashTest.java @@ -657,8 +657,7 @@ public final class DashTest extends ActivityInstrumentationTestCase2