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