Skip to content

Commit

Permalink
Fix miscellaneous nits/typos
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 335642909
  • Loading branch information
andrewlewis authored and tonihei committed Oct 6, 2020
1 parent 008c808 commit ac78223
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public class PlayerActivity extends AppCompatActivity
private int startWindow;
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 Uri loadedAdTagUri;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public MediaItem convertToExoPlayerMediaItem(androidx.media2.common.MediaItem me
if (media2MediaItem instanceof CallbackMediaItem) {
throw new IllegalStateException("CallbackMediaItem isn't supported");
}

@Nullable Uri uri = null;
@Nullable String mediaId = null;
@Nullable String title = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
*/
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}.
*/
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}.
*/
androidx.media2.common.MediaItem convertToMedia2MediaItem(MediaItem exoPlayerMediaItem);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public ExoPlayerImpl(
new TrackSelectorResult(
new RendererConfiguration[renderers.length],
new TrackSelection[renderers.length],
null);
/* info= */ null);
period = new Timeline.Period();
maskingWindowIndex = C.INDEX_UNSET;
playbackInfoUpdateHandler = new Handler(applicationLooper);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ public void clear() {
public boolean updateQueuedPeriods(
Timeline timeline, long rendererPositionUs, long maxRendererReadPositionUs) {
// 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
// handled here.
// is set, once all cases handled by ExoPlayerImplInternal.handleMediaSourceListInfoRefreshed
// can be handled here.
MediaPeriodHolder previousPeriodHolder = null;
MediaPeriodHolder periodHolder = playing;
while (periodHolder != null) {
Expand All @@ -326,8 +326,8 @@ public boolean updateQueuedPeriods(
MediaPeriodInfo newPeriodInfo;
if (previousPeriodHolder == null) {
// The id and start position of the first period have already been verified by
// ExoPlayerImplInternal.handleSourceInfoRefreshed. Just update duration, isLastInTimeline
// and isLastInPeriod flags.
// ExoPlayerImplInternal.handleMediaSourceListInfoRefreshed. Just update duration,
// isLastInTimeline and isLastInPeriod flags.
newPeriodInfo = getUpdatedMediaPeriodInfo(timeline, oldPeriodInfo);
} else {
newPeriodInfo =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ private void notifySourceInfoRefreshed() {
/* manifest= */ null,
mediaItem);
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.
timeline =
new ForwardingTimeline(timeline) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,14 +339,15 @@ public TrackGroupArray getUnmappedTrackGroups() {
* Returns the mapping information for the currently active track selection, or null if no
* selection is currently active.
*/
public final @Nullable MappedTrackInfo getCurrentMappedTrackInfo() {
@Nullable
public final MappedTrackInfo getCurrentMappedTrackInfo() {
return currentMappedTrackInfo;
}

// TrackSelector implementation.

@Override
public final void onSelectionActivated(Object info) {
public final void onSelectionActivated(@Nullable Object info) {
currentMappedTrackInfo = (MappedTrackInfo) info;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public abstract TrackSelectorResult selectTracks(
*
* @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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,20 @@ public final class TrackSelectorResult {
* An opaque object that will be returned to {@link TrackSelector#onSelectionActivated(Object)}
* 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
* indicates the corresponding renderer should be disabled.
* @param selections A {@link TrackSelectionArray} containing the selection for each renderer.
* @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(
@NullableType RendererConfiguration[] rendererConfigurations,
@NullableType TrackSelection[] selections,
Object info) {
@Nullable Object info) {
this.rendererConfigurations = rendererConfigurations;
this.selections = new TrackSelectionArray(selections);
this.info = info;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import static com.google.common.truth.Truth.assertThat;
import static org.junit.Assert.fail;

import androidx.annotation.Nullable;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.RendererCapabilities;
Expand Down Expand Up @@ -52,7 +53,7 @@ public TrackSelectorResult selectTracks(
}

@Override
public void onSelectionActivated(Object info) {}
public void onSelectionActivated(@Nullable Object info) {}
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void setUp() {
/* isAvailable= */ true,
CONNECTED);
}

@Test
public void defaultInitialBitrateEstimate_forWifi_isGreaterThanEstimateFor2G() {
setActiveNetworkInfo(networkInfoWifi);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
import com.google.android.exoplayer2.drm.DrmSessionManager;
import com.google.android.exoplayer2.mediacodec.MediaCodecInfo;
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.FakeSampleStreamItem;
import com.google.android.exoplayer2.util.MimeTypes;
Expand Down Expand Up @@ -107,8 +106,7 @@ public void setUp() throws Exception {
/* maxDroppedFramesToNotify= */ 1) {
@Override
@Capabilities
protected int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format)
throws DecoderQueryException {
protected int supportsFormat(MediaCodecSelector mediaCodecSelector, Format format) {
return RendererCapabilities.create(FORMAT_HANDLED);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,5 +414,4 @@ private Cue removeEmbeddedStyling(Cue cue) {
return cue;
}


}

0 comments on commit ac78223

Please sign in to comment.