Fix miscellaneous nits/typos
PiperOrigin-RevId: 335642909
This commit is contained in:
parent
008c80812b
commit
ac782235ca
@ -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;
|
||||
|
@ -45,7 +45,7 @@ public class DefaultMediaItemConverter implements MediaItemConverter {
|
||||
if (media2MediaItem instanceof CallbackMediaItem) {
|
||||
throw new IllegalStateException("CallbackMediaItem isn't supported");
|
||||
}
|
||||
|
||||
|
||||
@Nullable Uri uri = null;
|
||||
@Nullable String mediaId = null;
|
||||
@Nullable String title = null;
|
||||
|
@ -23,13 +23,13 @@ import com.google.android.exoplayer2.MediaItem;
|
||||
*/
|
||||
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);
|
||||
|
@ -157,7 +157,7 @@ import java.util.concurrent.TimeoutException;
|
||||
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);
|
||||
|
@ -315,8 +315,8 @@ import com.google.common.collect.ImmutableList;
|
||||
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) {
|
||||
@ -326,8 +326,8 @@ import com.google.common.collect.ImmutableList;
|
||||
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 =
|
||||
|
@ -340,7 +340,7 @@ public final class ProgressiveMediaSource extends BaseMediaSource
|
||||
/* 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) {
|
||||
|
@ -339,14 +339,15 @@ public abstract class MappingTrackSelector extends TrackSelector {
|
||||
* 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;
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ public abstract class TrackSelector {
|
||||
*
|
||||
* @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
|
||||
|
@ -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;
|
||||
|
@ -18,6 +18,7 @@ package com.google.android.exoplayer2.trackselection;
|
||||
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;
|
||||
@ -52,7 +53,7 @@ public class TrackSelectorTest {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelectionActivated(Object info) {}
|
||||
public void onSelectionActivated(@Nullable Object info) {}
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -107,7 +107,7 @@ public final class DefaultBandwidthMeterTest {
|
||||
/* isAvailable= */ true,
|
||||
CONNECTED);
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void defaultInitialBitrateEstimate_forWifi_isGreaterThanEstimateFor2G() {
|
||||
setActiveNetworkInfo(networkInfoWifi);
|
||||
|
@ -46,7 +46,6 @@ import com.google.android.exoplayer2.drm.DrmSessionEventListener;
|
||||
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;
|
||||
@ -107,8 +106,7 @@ public class MediaCodecVideoRendererTest {
|
||||
/* 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);
|
||||
}
|
||||
|
||||
|
@ -414,5 +414,4 @@ public final class SubtitleView extends FrameLayout implements TextOutput {
|
||||
return cue;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user