提交 2f20fd7c 编写于 作者: O olly 提交者: Oliver Woodman

Simple language + Javadoc consistency

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

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=128678638
上级 dfdb3bbc
......@@ -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) {
......
......@@ -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.
* <p>
......@@ -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();
......
......@@ -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.
* </li>
* <li>Registered {@link EventListener}s are invoked on the thread that created the
* {@link ExoPlayer} instance.</li>
* <li>Registered {@link EventListener}s are called on the thread that created the {@link ExoPlayer}
* instance.</li>
* <li>An internal playback thread is responsible for managing playback and invoking the
* {@link Renderer}s in order to load and play the media.</li>
* <li>{@link Renderer} implementations (or any upstream components that they depend on) may
......@@ -89,7 +89,7 @@ import com.google.android.exoplayer2.source.Timeline;
*
* <p>The possible playback state transitions are shown below. Transitions can be triggered either
* by changes in the state of the {@link Renderer}s being used, or as a result of
* {@link #setMediaSource(MediaSource)}, {@link #stop()} or {@link #release()} being invoked.</p>
* {@link #setMediaSource(MediaSource)}, {@link #stop()} or {@link #release()} being called.</p>
* <p align="center"><img src="doc-files/exoplayer-playbackstate.png"
* alt="ExoPlayer playback state transitions"
* border="0"/></p>
......@@ -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.
* <p>
* 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.
* <p>
* 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();
......
......@@ -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.
......
......@@ -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);
......
......@@ -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);
......
......@@ -26,7 +26,7 @@ import java.io.IOException;
* <p>
* 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.
* <p align="center"><img src="doc-files/renderer-states.png"
* alt="Renderer state transitions"
......@@ -210,7 +210,7 @@ public interface Renderer extends ExoPlayerComponent {
* This method may be called when the renderer is in the following states:
* {@link #STATE_ENABLED}, {@link #STATE_STARTED}.
*
* @return True if the renderer is ready to render media. False otherwise.
* @return Whether the renderer is ready to render media.
*/
boolean isReady();
......
......@@ -1177,7 +1177,7 @@ public final class AudioTrack {
* Updates the values returned by {@link #getTimestampNanoTime()} and
* {@link #getTimestampFramePosition()}.
*
* @return True if the timestamp values were updated. False otherwise.
* @return Whether the timestamp values were updated.
*/
public boolean updateTimestamp() {
return false;
......
......@@ -182,7 +182,7 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
* passthrough is supported.
*
* @param mimeType The type of input media.
* @return True if passthrough playback should be used. False otherwise.
* @return Whether passthrough playback should be used.
*/
protected boolean allowPassthrough(String mimeType) {
return audioTrack.isPassthroughSupported(mimeType);
......@@ -236,7 +236,7 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
/**
* Called when the audio session id becomes known. Once the id is known it will not change (and
* hence this method will not be invoked again) unless the renderer is disabled and then
* hence this method will not be called again) unless the renderer is disabled and then
* subsequently re-enabled.
* <p>
* The default implementation is a no-op. One reason for overriding this method would be to
......
......@@ -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.
* <p>
* The default implementation is a no-op.
......
......@@ -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
......
......@@ -279,7 +279,7 @@ public abstract class SimpleDecoder<I extends DecoderInputBuffer, O extends Outp
* {@code inputBuffer}, but may be set/unset as required. If the flag is set when the call
* returns then the output buffer will not be made available to dequeue. The output buffer
* may not have been populated in this case.
* @param reset True if the decoder must be reset before decoding.
* @param reset Whether the decoder must be reset before decoding.
* @return A decoder exception if an error occurred, or null if decoding was successful.
*/
protected abstract E decode(I inputBuffer, O outputBuffer, boolean reset);
......
......@@ -217,7 +217,7 @@ public final class DrmInitData implements Comparator<SchemeData>, 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);
......
......@@ -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.
* <p>
* 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.
* <p>
* This method may be called when the manager is in any state.
*
......
......@@ -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);
......
......@@ -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.
* <p>
* 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}.
*/
......
......@@ -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();
......
......@@ -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.
* <p>
* The corresponding sample data will have already been passed to the output via calls to
* {@link #sampleData(ExtractorInput, int, boolean)} or
......
......@@ -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;
......
......@@ -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.
......
......@@ -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 {
......
......@@ -202,7 +202,7 @@ import java.util.List;
}
/**
* Gets the child leaf of the given type.
* Returns the child leaf of the given type.
* <p>
* 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.
* <p>
* 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.
......
......@@ -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.
*/
......
......@@ -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);
......
......@@ -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.
*/
......
......@@ -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;
/**
......
......@@ -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;
......
......@@ -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;
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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();
......
......@@ -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}.
......
......@@ -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}.
......
......@@ -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) {
......
......@@ -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.
* <p>
* 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.
* <p>
* 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.
* <p>
* The default implementation is a no-op.
*/
......@@ -774,7 +773,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
}
/**
* Invoked immediately before an input buffer is queued into the codec.
* Called immediately before an input buffer is queued into the codec.
* <p>
* The default implementation is a no-op.
*
......@@ -785,7 +784,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
}
/**
* Invoked when an output buffer is successfully processed.
* Called when an output buffer is successfully processed.
* <p>
* 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.
......
......@@ -45,7 +45,7 @@ public final class MetadataRenderer<T> extends BaseRenderer implements Callback
public interface Output<T> {
/**
* Invoked each time there is a metadata associated with current playback time.
* Called each time there is a metadata associated with current playback time.
*
* @param metadata The metadata to process.
*/
......@@ -67,11 +67,11 @@ public final class MetadataRenderer<T> 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<T> output, Looper outputLooper,
......
......@@ -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.
* <p>
* 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
* <em>not</em> be invoked in addition to this method.
* <em>not</em> be called in addition to this method.
*
* @param dataSpec Defines the data being loaded.
* @param 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.
......
......@@ -33,10 +33,10 @@ public interface MediaPeriod extends SequenceableLoader {
interface Callback extends SequenceableLoader.Callback<MediaPeriod> {
/**
* Invoked when preparation completes.
* Called when preparation completes.
* <p>
* 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.
* <p>
* {@link Callback#onPeriodPrepared(MediaPeriod)} is invoked when preparation completes. If
* {@link Callback#onPeriodPrepared(MediaPeriod)} is called when preparation completes. If
* preparation fails, {@link #maybeThrowPrepareError()} will throw an {@link IOException} if
* invoked.
* called.
*
* @param callback A callback to receive updates from the period.
* @param allocator An {@link Allocator} from which to obtain media buffer allocations.
......
......@@ -28,7 +28,7 @@ public interface MediaSource {
interface InvalidationListener {
/**
* Invoked when the timeline is invalidated.
* Called when the timeline is invalidated.
* <p>
* May only be called on the player's thread.
*
......
......@@ -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();
......
......@@ -28,8 +28,8 @@ public interface SequenceableLoader {
interface Callback<T extends SequenceableLoader> {
/**
* 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);
......
......@@ -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.
......
......@@ -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.
......
......@@ -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();
......
......@@ -322,7 +322,7 @@ public class ChunkSampleStream<T extends ChunkSource> implements SampleStream, S
* Discard upstream media chunks until the queue length is equal to the length specified.
*
* @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) {
......
......@@ -47,7 +47,7 @@ public interface ChunkSource {
int getPreferredQueueSize(long playbackPositionUs, List<? extends MediaChunk> queue);
/**
* Gets the next chunk to load.
* Returns the next chunk to load.
* <p>
* 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.
* <p>
* 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.
* <p>
* 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);
......
......@@ -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.
......
......@@ -54,9 +54,9 @@ public interface FormatEvaluator {
/**
* Update the supplied evaluation.
* <p>
* 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
......
......@@ -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();
......
......@@ -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);
......
......@@ -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;
......
......@@ -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);
......
......@@ -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.
* <p>
* 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) {
......
......@@ -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;
......
......@@ -55,7 +55,7 @@ import java.util.List;
public interface Callback extends SequenceableLoader.Callback<HlsSampleStreamWrapper> {
/**
* Invoked when the wrapper has been prepared.
* Called when the wrapper has been prepared.
*/
void onPrepared();
......
......@@ -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.
* <p>
* This method may return null if the master source has yet to initialize a suitable adjuster.
......
......@@ -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.
......
......@@ -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) {
......
......@@ -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) {
......
......@@ -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.
......
......@@ -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);
......
......@@ -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<WebvttCssStyle> styles) {
......
......@@ -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) {
......
......@@ -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<TrackGroupArray, TrackSelection> overrides = trackSelectionOverrides.get(rendererIndex);
......@@ -453,7 +451,7 @@ public abstract class MappingTrackSelector extends TrackSelector {
}
/**
* Gets the array of {@link TrackGroup}s associated to the renderer at a specified index.
* Returns the array of {@link TrackGroup}s associated to the renderer at a specified index.
*
* @param rendererIndex The renderer index.
* @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}.
* <p>
* 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;
......
......@@ -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
......
......@@ -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.
......
......@@ -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.
......
......@@ -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.
* <p>
* Note: The estimated bitrate is typically derived from more information than just
* {@code bytes} and {@code elapsedMs}.
......
......@@ -51,7 +51,7 @@ public interface Cache {
* {@link CacheSpan#file} and {@link CacheSpan#lastAccessTimestamp} may have changed.
* <p>
* 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.
* <p>
* 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.
......
......@@ -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);
......
......@@ -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.
......
......@@ -120,7 +120,7 @@ public final class CacheSpan implements Comparable<CacheSpan> {
}
/**
* @return True if this is an open-ended {@link CacheSpan}. False otherwise.
* Returns whether this is an open-ended {@link CacheSpan}.
*/
public boolean isOpenEnded() {
return length == -1;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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 {
......
......@@ -657,8 +657,7 @@ public final class DashTest extends ActivityInstrumentationTestCase2<HostActivit
* @param streamName The name of the test stream for metric logging.
* @param manifestPath The manifest path.
* @param metricsLogger Logger to log metrics from the test.
* @param fullPlaybackNoSeeking True if the test will play the entire source with no seeking.
* False otherwise.
* @param fullPlaybackNoSeeking Whether the test will play the entire source with no seeking.
* @param audioFormat The audio format.
* @param isWidevineEncrypted Whether the video is Widevine encrypted.
* @param videoMimeType The video mime type.
......
......@@ -95,8 +95,7 @@ public abstract class ExoHostedTest implements HostedTest, ExoPlayer.EventListen
* expected playing time equals the duration of the media being played. Else
* {@link #EXPECTED_PLAYING_TIME_UNSET} should be passed to indicate that the test should not
* assert an expected playing time.
* @param failOnPlayerError True if a player error should be considered a test failure. False
* otherwise.
* @param failOnPlayerError Whether a player error should be considered a test failure.
*/
public ExoHostedTest(String tag, long expectedPlayingTimeMs, boolean failOnPlayerError) {
this.tag = tag;
......
......@@ -61,7 +61,7 @@ public final class HostActivity extends Activity implements SurfaceHolder.Callba
/**
* Called on the main thread to check whether the test is ready to be stopped.
*
* @return True if the test is ready to be stopped. False otherwise.
* @return Whether the test is ready to be stopped.
*/
boolean canStop();
......@@ -222,7 +222,7 @@ public final class HostActivity extends Activity implements SurfaceHolder.Callba
mainHandler.removeCallbacks(checkCanStopRunnable);
// We post opening of the stopped condition so that any events posted to the main thread as a
// result of hostedTest.onStop() are guaranteed to be handled before hostedTest.onFinished()
// is invoked from runTest.
// is called from runTest.
mainHandler.post(new Runnable() {
@Override
public void run() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册