Fix miscellaneous nits/typos

PiperOrigin-RevId: 335642909
This commit is contained in:
andrewlewis 2020-10-06 15:20:54 +00:00 committed by tonihei
parent 008c80812b
commit ac782235ca
13 changed files with 22 additions and 22 deletions

View File

@ -102,7 +102,7 @@ public class PlayerActivity extends AppCompatActivity
private int startWindow; private int startWindow;
private long startPosition; private long startPosition;
// Fields used only for ad playback. The ads loader is loaded via reflection. // Fields used only for ad playback.
private AdsLoader adsLoader; private AdsLoader adsLoader;
private Uri loadedAdTagUri; private Uri loadedAdTagUri;

View File

@ -23,13 +23,13 @@ import com.google.android.exoplayer2.MediaItem;
*/ */
public interface MediaItemConverter { public interface MediaItemConverter {
/** /**
* Converts an {@link androidx.media2.common.MediaItem Media2 MediaItem} to an {@link MediaItem * Converts a {@link androidx.media2.common.MediaItem Media2 MediaItem} to an {@link MediaItem
* ExoPlayer MediaItem}. * ExoPlayer MediaItem}.
*/ */
MediaItem convertToExoPlayerMediaItem(androidx.media2.common.MediaItem media2MediaItem); MediaItem convertToExoPlayerMediaItem(androidx.media2.common.MediaItem media2MediaItem);
/** /**
* Converts an {@link MediaItem ExoPlayer MediaItem} to an {@link androidx.media2.common.MediaItem * Converts an {@link MediaItem ExoPlayer MediaItem} to a {@link androidx.media2.common.MediaItem
* Media2 MediaItem}. * Media2 MediaItem}.
*/ */
androidx.media2.common.MediaItem convertToMedia2MediaItem(MediaItem exoPlayerMediaItem); androidx.media2.common.MediaItem convertToMedia2MediaItem(MediaItem exoPlayerMediaItem);

View File

@ -157,7 +157,7 @@ import java.util.concurrent.TimeoutException;
new TrackSelectorResult( new TrackSelectorResult(
new RendererConfiguration[renderers.length], new RendererConfiguration[renderers.length],
new TrackSelection[renderers.length], new TrackSelection[renderers.length],
null); /* info= */ null);
period = new Timeline.Period(); period = new Timeline.Period();
maskingWindowIndex = C.INDEX_UNSET; maskingWindowIndex = C.INDEX_UNSET;
playbackInfoUpdateHandler = new Handler(applicationLooper); playbackInfoUpdateHandler = new Handler(applicationLooper);

View File

@ -315,8 +315,8 @@ import com.google.common.collect.ImmutableList;
public boolean updateQueuedPeriods( public boolean updateQueuedPeriods(
Timeline timeline, long rendererPositionUs, long maxRendererReadPositionUs) { Timeline timeline, long rendererPositionUs, long maxRendererReadPositionUs) {
// TODO: Merge this into setTimeline so that the queue gets updated as soon as the new timeline // TODO: Merge this into setTimeline so that the queue gets updated as soon as the new timeline
// is set, once all cases handled by ExoPlayerImplInternal.handleSourceInfoRefreshed can be // is set, once all cases handled by ExoPlayerImplInternal.handleMediaSourceListInfoRefreshed
// handled here. // can be handled here.
MediaPeriodHolder previousPeriodHolder = null; MediaPeriodHolder previousPeriodHolder = null;
MediaPeriodHolder periodHolder = playing; MediaPeriodHolder periodHolder = playing;
while (periodHolder != null) { while (periodHolder != null) {
@ -326,8 +326,8 @@ import com.google.common.collect.ImmutableList;
MediaPeriodInfo newPeriodInfo; MediaPeriodInfo newPeriodInfo;
if (previousPeriodHolder == null) { if (previousPeriodHolder == null) {
// The id and start position of the first period have already been verified by // The id and start position of the first period have already been verified by
// ExoPlayerImplInternal.handleSourceInfoRefreshed. Just update duration, isLastInTimeline // ExoPlayerImplInternal.handleMediaSourceListInfoRefreshed. Just update duration,
// and isLastInPeriod flags. // isLastInTimeline and isLastInPeriod flags.
newPeriodInfo = getUpdatedMediaPeriodInfo(timeline, oldPeriodInfo); newPeriodInfo = getUpdatedMediaPeriodInfo(timeline, oldPeriodInfo);
} else { } else {
newPeriodInfo = newPeriodInfo =

View File

@ -340,7 +340,7 @@ public final class ProgressiveMediaSource extends BaseMediaSource
/* manifest= */ null, /* manifest= */ null,
mediaItem); mediaItem);
if (timelineIsPlaceholder) { if (timelineIsPlaceholder) {
// TODO: Actually prepare the extractors during prepatation so that we don't need a // TODO: Actually prepare the extractors during preparation so that we don't need a
// placeholder. See https://github.com/google/ExoPlayer/issues/4727. // placeholder. See https://github.com/google/ExoPlayer/issues/4727.
timeline = timeline =
new ForwardingTimeline(timeline) { new ForwardingTimeline(timeline) {

View File

@ -339,14 +339,15 @@ public abstract class MappingTrackSelector extends TrackSelector {
* Returns the mapping information for the currently active track selection, or null if no * Returns the mapping information for the currently active track selection, or null if no
* selection is currently active. * selection is currently active.
*/ */
public final @Nullable MappedTrackInfo getCurrentMappedTrackInfo() { @Nullable
public final MappedTrackInfo getCurrentMappedTrackInfo() {
return currentMappedTrackInfo; return currentMappedTrackInfo;
} }
// TrackSelector implementation. // TrackSelector implementation.
@Override @Override
public final void onSelectionActivated(Object info) { public final void onSelectionActivated(@Nullable Object info) {
currentMappedTrackInfo = (MappedTrackInfo) info; currentMappedTrackInfo = (MappedTrackInfo) info;
} }

View File

@ -137,7 +137,7 @@ public abstract class TrackSelector {
* *
* @param info The value of {@link TrackSelectorResult#info} in the activated selection. * @param info The value of {@link TrackSelectorResult#info} in the activated selection.
*/ */
public abstract void onSelectionActivated(Object info); public abstract void onSelectionActivated(@Nullable Object info);
/** /**
* Calls {@link InvalidationListener#onTrackSelectionsInvalidated()} to invalidate all previously * Calls {@link InvalidationListener#onTrackSelectionsInvalidated()} to invalidate all previously

View File

@ -40,19 +40,20 @@ public final class TrackSelectorResult {
* An opaque object that will be returned to {@link TrackSelector#onSelectionActivated(Object)} * An opaque object that will be returned to {@link TrackSelector#onSelectionActivated(Object)}
* should the selections be activated. * should the selections be activated.
*/ */
public final Object info; @Nullable public final Object info;
/** /**
* @param rendererConfigurations A {@link RendererConfiguration} for each renderer. A null entry * @param rendererConfigurations A {@link RendererConfiguration} for each renderer. A null entry
* indicates the corresponding renderer should be disabled. * indicates the corresponding renderer should be disabled.
* @param selections A {@link TrackSelectionArray} containing the selection for each renderer. * @param selections A {@link TrackSelectionArray} containing the selection for each renderer.
* @param info An opaque object that will be returned to {@link * @param info An opaque object that will be returned to {@link
* TrackSelector#onSelectionActivated(Object)} should the selection be activated. * TrackSelector#onSelectionActivated(Object)} should the selection be activated. May be
* {@code null}.
*/ */
public TrackSelectorResult( public TrackSelectorResult(
@NullableType RendererConfiguration[] rendererConfigurations, @NullableType RendererConfiguration[] rendererConfigurations,
@NullableType TrackSelection[] selections, @NullableType TrackSelection[] selections,
Object info) { @Nullable Object info) {
this.rendererConfigurations = rendererConfigurations; this.rendererConfigurations = rendererConfigurations;
this.selections = new TrackSelectionArray(selections); this.selections = new TrackSelectionArray(selections);
this.info = info; this.info = info;

View File

@ -18,6 +18,7 @@ package com.google.android.exoplayer2.trackselection;
import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.fail; import static org.junit.Assert.fail;
import androidx.annotation.Nullable;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.ExoPlaybackException; import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.RendererCapabilities; import com.google.android.exoplayer2.RendererCapabilities;
@ -52,7 +53,7 @@ public class TrackSelectorTest {
} }
@Override @Override
public void onSelectionActivated(Object info) {} public void onSelectionActivated(@Nullable Object info) {}
}; };
} }

View File

@ -46,7 +46,6 @@ import com.google.android.exoplayer2.drm.DrmSessionEventListener;
import com.google.android.exoplayer2.drm.DrmSessionManager; import com.google.android.exoplayer2.drm.DrmSessionManager;
import com.google.android.exoplayer2.mediacodec.MediaCodecInfo; import com.google.android.exoplayer2.mediacodec.MediaCodecInfo;
import com.google.android.exoplayer2.mediacodec.MediaCodecSelector; import com.google.android.exoplayer2.mediacodec.MediaCodecSelector;
import com.google.android.exoplayer2.mediacodec.MediaCodecUtil.DecoderQueryException;
import com.google.android.exoplayer2.testutil.FakeSampleStream; import com.google.android.exoplayer2.testutil.FakeSampleStream;
import com.google.android.exoplayer2.testutil.FakeSampleStream.FakeSampleStreamItem; import com.google.android.exoplayer2.testutil.FakeSampleStream.FakeSampleStreamItem;
import com.google.android.exoplayer2.util.MimeTypes; import com.google.android.exoplayer2.util.MimeTypes;
@ -107,8 +106,7 @@ public class MediaCodecVideoRendererTest {
/* maxDroppedFramesToNotify= */ 1) { /* maxDroppedFramesToNotify= */ 1) {
@Override @Override
@Capabilities @Capabilities
protected int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format) protected int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format) {
throws DecoderQueryException {
return RendererCapabilities.create(FORMAT_HANDLED); return RendererCapabilities.create(FORMAT_HANDLED);
} }

View File

@ -414,5 +414,4 @@ public final class SubtitleView extends FrameLayout implements TextOutput {
return cue; return cue;
} }
} }