Misc analysis fixes
PiperOrigin-RevId: 320921457
This commit is contained in:
parent
cdfee89181
commit
21e56f571d
@ -29,7 +29,6 @@ import com.google.android.exoplayer2.SimpleExoPlayer;
|
||||
import com.google.android.exoplayer2.Timeline;
|
||||
import com.google.android.exoplayer2.ext.cast.CastPlayer;
|
||||
import com.google.android.exoplayer2.ext.cast.SessionAvailabilityListener;
|
||||
import com.google.android.exoplayer2.source.DefaultMediaSourceFactory;
|
||||
import com.google.android.exoplayer2.source.TrackGroupArray;
|
||||
import com.google.android.exoplayer2.trackselection.DefaultTrackSelector;
|
||||
import com.google.android.exoplayer2.trackselection.MappingTrackSelector;
|
||||
@ -61,7 +60,6 @@ import java.util.ArrayList;
|
||||
private static final DefaultHttpDataSourceFactory DATA_SOURCE_FACTORY =
|
||||
new DefaultHttpDataSourceFactory(USER_AGENT);
|
||||
|
||||
private final DefaultMediaSourceFactory defaultMediaSourceFactory;
|
||||
private final PlayerView localPlayerView;
|
||||
private final PlayerControlView castControlView;
|
||||
private final DefaultTrackSelector trackSelector;
|
||||
@ -97,7 +95,6 @@ import java.util.ArrayList;
|
||||
|
||||
trackSelector = new DefaultTrackSelector(context);
|
||||
exoPlayer = new SimpleExoPlayer.Builder(context).setTrackSelector(trackSelector).build();
|
||||
defaultMediaSourceFactory = DefaultMediaSourceFactory.newInstance(context, DATA_SOURCE_FACTORY);
|
||||
exoPlayer.addListener(this);
|
||||
localPlayerView.setPlayer(exoPlayer);
|
||||
|
||||
|
@ -102,7 +102,6 @@ public class LibvpxVideoRenderer extends DecoderVideoRenderer {
|
||||
* @param numInputBuffers Number of input buffers.
|
||||
* @param numOutputBuffers Number of output buffers.
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public LibvpxVideoRenderer(
|
||||
long allowedJoiningTimeMs,
|
||||
@Nullable Handler eventHandler,
|
||||
|
@ -16,8 +16,8 @@ apply from: "${buildscript.sourceFile.parentFile}/javadoc_util.gradle"
|
||||
|
||||
android.libraryVariants.all { variant ->
|
||||
def name = variant.buildType.name
|
||||
if (!name.equals("release")) {
|
||||
return; // Skip non-release builds.
|
||||
if (name != "release") {
|
||||
return // Skip non-release builds.
|
||||
}
|
||||
def allSourceDirs = variant.sourceSets.inject ([]) {
|
||||
acc, val -> acc << val.javaDirectories
|
||||
|
@ -497,7 +497,6 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
private final CopyOnWriteArraySet<DeviceListener> deviceListeners;
|
||||
private final CopyOnWriteArraySet<VideoRendererEventListener> videoDebugListeners;
|
||||
private final CopyOnWriteArraySet<AudioRendererEventListener> audioDebugListeners;
|
||||
private final BandwidthMeter bandwidthMeter;
|
||||
private final AnalyticsCollector analyticsCollector;
|
||||
private final AudioBecomingNoisyManager audioBecomingNoisyManager;
|
||||
private final AudioFocusManager audioFocusManager;
|
||||
@ -559,7 +558,6 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
|
||||
/** @param builder The {@link Builder} to obtain all construction parameters. */
|
||||
protected SimpleExoPlayer(Builder builder) {
|
||||
bandwidthMeter = builder.bandwidthMeter;
|
||||
analyticsCollector = builder.analyticsCollector;
|
||||
priorityTaskManager = builder.priorityTaskManager;
|
||||
audioAttributes = builder.audioAttributes;
|
||||
@ -594,7 +592,7 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
builder.trackSelector,
|
||||
builder.mediaSourceFactory,
|
||||
builder.loadControl,
|
||||
bandwidthMeter,
|
||||
builder.bandwidthMeter,
|
||||
analyticsCollector,
|
||||
builder.useLazyPreparation,
|
||||
builder.seekParameters,
|
||||
@ -1030,7 +1028,6 @@ public class SimpleExoPlayer extends BasePlayer
|
||||
}
|
||||
|
||||
/** @deprecated Use {@link #setPlaybackSpeed(float)} instead. */
|
||||
@SuppressWarnings("deprecation")
|
||||
@Deprecated
|
||||
@RequiresApi(23)
|
||||
public void setPlaybackParams(@Nullable PlaybackParams params) {
|
||||
|
@ -919,6 +919,7 @@ public final class DownloadHelper {
|
||||
return DownloadRequest.TYPE_HLS;
|
||||
case C.TYPE_SS:
|
||||
return DownloadRequest.TYPE_SS;
|
||||
case C.TYPE_OTHER:
|
||||
default:
|
||||
return DownloadRequest.TYPE_PROGRESSIVE;
|
||||
}
|
||||
|
@ -266,7 +266,6 @@ public final class SinglePeriodTimeline extends Timeline {
|
||||
}
|
||||
|
||||
// Provide backwards compatibility.
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public Window getWindow(int windowIndex, Window window, long defaultPositionProjectionUs) {
|
||||
Assertions.checkIndex(windowIndex, 0, 1);
|
||||
|
@ -45,7 +45,6 @@ public final class CacheDataSourceFactory implements DataSource.Factory {
|
||||
}
|
||||
|
||||
/** @see CacheDataSource#CacheDataSource(Cache, DataSource, int) */
|
||||
@SuppressWarnings("deprecation")
|
||||
public CacheDataSourceFactory(
|
||||
Cache cache, DataSource.Factory upstreamFactory, @CacheDataSource.Flags int flags) {
|
||||
this(
|
||||
|
@ -26,7 +26,7 @@ import java.util.NoSuchElementException;
|
||||
public final class IntArrayQueue {
|
||||
|
||||
/** Default capacity needs to be a power of 2. */
|
||||
private static int DEFAULT_INITIAL_CAPACITY = 16;
|
||||
private static final int DEFAULT_INITIAL_CAPACITY = 16;
|
||||
|
||||
private int headIndex;
|
||||
private int tailIndex;
|
||||
|
@ -1631,7 +1631,6 @@ public final class AnalyticsCollectorTest {
|
||||
reportedEvents.add(new ReportedEvent(EVENT_SEEK_PROCESSED, eventTime));
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void onPlaybackSpeedChanged(EventTime eventTime, float playbackSpeed) {
|
||||
reportedEvents.add(new ReportedEvent(EVENT_PLAYBACK_SPEED_CHANGED, eventTime));
|
||||
|
@ -67,10 +67,6 @@ public class DownloadHelperTest {
|
||||
|
||||
private static final Format VIDEO_FORMAT_LOW = createVideoFormat(/* bitrate= */ 200_000);
|
||||
private static final Format VIDEO_FORMAT_HIGH = createVideoFormat(/* bitrate= */ 800_000);
|
||||
private static Format audioFormatUs;
|
||||
private static Format audioFormatZh;
|
||||
private static Format textFormatUs;
|
||||
private static Format textFormatZh;
|
||||
|
||||
private static final TrackGroup TRACK_GROUP_VIDEO_BOTH =
|
||||
new TrackGroup(VIDEO_FORMAT_LOW, VIDEO_FORMAT_HIGH);
|
||||
@ -79,35 +75,31 @@ public class DownloadHelperTest {
|
||||
private static TrackGroup trackGroupAudioZh;
|
||||
private static TrackGroup trackGroupTextUs;
|
||||
private static TrackGroup trackGroupTextZh;
|
||||
|
||||
private static TrackGroupArray trackGroupArrayAll;
|
||||
private static TrackGroupArray trackGroupArraySingle;
|
||||
private static TrackGroupArray[] trackGroupArrays;
|
||||
|
||||
private static MediaItem testMediaItem;
|
||||
|
||||
private DownloadHelper downloadHelper;
|
||||
|
||||
@BeforeClass
|
||||
public static void staticSetUp() {
|
||||
audioFormatUs = createAudioFormat(/* language= */ "US");
|
||||
audioFormatZh = createAudioFormat(/* language= */ "ZH");
|
||||
textFormatUs = createTextFormat(/* language= */ "US");
|
||||
textFormatZh = createTextFormat(/* language= */ "ZH");
|
||||
Format audioFormatUs = createAudioFormat(/* language= */ "US");
|
||||
Format audioFormatZh = createAudioFormat(/* language= */ "ZH");
|
||||
Format textFormatUs = createTextFormat(/* language= */ "US");
|
||||
Format textFormatZh = createTextFormat(/* language= */ "ZH");
|
||||
|
||||
trackGroupAudioUs = new TrackGroup(audioFormatUs);
|
||||
trackGroupAudioZh = new TrackGroup(audioFormatZh);
|
||||
trackGroupTextUs = new TrackGroup(textFormatUs);
|
||||
trackGroupTextZh = new TrackGroup(textFormatZh);
|
||||
|
||||
trackGroupArrayAll =
|
||||
TrackGroupArray trackGroupArrayAll =
|
||||
new TrackGroupArray(
|
||||
TRACK_GROUP_VIDEO_BOTH,
|
||||
trackGroupAudioUs,
|
||||
trackGroupAudioZh,
|
||||
trackGroupTextUs,
|
||||
trackGroupTextZh);
|
||||
trackGroupArraySingle =
|
||||
TrackGroupArray trackGroupArraySingle =
|
||||
new TrackGroupArray(TRACK_GROUP_VIDEO_SINGLE, trackGroupAudioUs);
|
||||
trackGroupArrays =
|
||||
new TrackGroupArray[] {trackGroupArrayAll, trackGroupArraySingle};
|
||||
|
@ -895,7 +895,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
||||
}
|
||||
|
||||
// We won't assign the array to a variable that erases the generic type, and then write into it.
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@SuppressWarnings({"unchecked"})
|
||||
private static ChunkSampleStream<DashChunkSource>[] newSampleStreamArray(int length) {
|
||||
return new ChunkSampleStream[length];
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType;
|
||||
}
|
||||
|
||||
// We won't assign the array to a variable that erases the generic type, and then write into it.
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@SuppressWarnings({"unchecked"})
|
||||
private static ChunkSampleStream<SsChunkSource>[] newSampleStreamArray(int length) {
|
||||
return new ChunkSampleStream[length];
|
||||
}
|
||||
|
@ -184,7 +184,7 @@ public class FakeAdaptiveMediaPeriod extends FakeMediaPeriod
|
||||
}
|
||||
|
||||
// We won't assign the array to a variable that erases the generic type, and then write into it.
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@SuppressWarnings({"unchecked"})
|
||||
private static ChunkSampleStream<FakeChunkSource>[] newSampleStreamArray(int length) {
|
||||
return new ChunkSampleStream[length];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user