mirror of
https://github.com/androidx/media.git
synced 2025-05-16 20:19:57 +08:00
Rename EMPTY_MEDIA_ITEM
to PLACEHOLDER_MEDIA_ITEM
The `MediaItem` instances in the following cases are not actually empty but acts as a placeholder. `EMPTY_MEDIA_ITEM` can also be confused with `MediaItem.EMPTY`. PiperOrigin-RevId: 495843012 (cherry picked from commit 74559b4a188e476378f3f0df908598ce763d909a)
This commit is contained in:
parent
5ff90692b6
commit
4b7a005340
@ -158,7 +158,7 @@ public abstract class Timeline implements Bundleable {
|
||||
|
||||
private static final Object FAKE_WINDOW_UID = new Object();
|
||||
|
||||
private static final MediaItem EMPTY_MEDIA_ITEM =
|
||||
private static final MediaItem PLACEHOLDER_MEDIA_ITEM =
|
||||
new MediaItem.Builder()
|
||||
.setMediaId("com.google.android.exoplayer2.Timeline")
|
||||
.setUri(Uri.EMPTY)
|
||||
@ -258,7 +258,7 @@ public abstract class Timeline implements Bundleable {
|
||||
/** Creates window. */
|
||||
public Window() {
|
||||
uid = SINGLE_WINDOW_UID;
|
||||
mediaItem = EMPTY_MEDIA_ITEM;
|
||||
mediaItem = PLACEHOLDER_MEDIA_ITEM;
|
||||
}
|
||||
|
||||
/** Sets the data held by this window. */
|
||||
@ -280,7 +280,7 @@ public abstract class Timeline implements Bundleable {
|
||||
int lastPeriodIndex,
|
||||
long positionInFirstPeriodUs) {
|
||||
this.uid = uid;
|
||||
this.mediaItem = mediaItem != null ? mediaItem : EMPTY_MEDIA_ITEM;
|
||||
this.mediaItem = mediaItem != null ? mediaItem : PLACEHOLDER_MEDIA_ITEM;
|
||||
this.tag =
|
||||
mediaItem != null && mediaItem.localConfiguration != null
|
||||
? mediaItem.localConfiguration.tag
|
||||
|
@ -59,7 +59,7 @@ public final class ConcatenatingMediaSource extends CompositeMediaSource<MediaSo
|
||||
private static final int MSG_UPDATE_TIMELINE = 4;
|
||||
private static final int MSG_ON_COMPLETION = 5;
|
||||
|
||||
private static final MediaItem EMPTY_MEDIA_ITEM =
|
||||
private static final MediaItem PLACEHOLDER_MEDIA_ITEM =
|
||||
new MediaItem.Builder().setUri(Uri.EMPTY).build();
|
||||
|
||||
// Accessed on any thread.
|
||||
@ -449,7 +449,7 @@ public final class ConcatenatingMediaSource extends CompositeMediaSource<MediaSo
|
||||
public MediaItem getMediaItem() {
|
||||
// This method is actually never called because getInitialTimeline is implemented and hence the
|
||||
// MaskingMediaSource does not need to create a placeholder timeline for this media source.
|
||||
return EMPTY_MEDIA_ITEM;
|
||||
return PLACEHOLDER_MEDIA_ITEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1004,7 +1004,7 @@ public final class ConcatenatingMediaSource extends CompositeMediaSource<MediaSo
|
||||
|
||||
@Override
|
||||
public MediaItem getMediaItem() {
|
||||
return EMPTY_MEDIA_ITEM;
|
||||
return PLACEHOLDER_MEDIA_ITEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -70,7 +70,7 @@ public final class MergingMediaSource extends CompositeMediaSource<Integer> {
|
||||
}
|
||||
|
||||
private static final int PERIOD_COUNT_UNSET = -1;
|
||||
private static final MediaItem EMPTY_MEDIA_ITEM =
|
||||
private static final MediaItem PLACEHOLDER_MEDIA_ITEM =
|
||||
new MediaItem.Builder().setMediaId("MergingMediaSource").build();
|
||||
|
||||
private final boolean adjustPeriodTimeOffsets;
|
||||
@ -161,7 +161,7 @@ public final class MergingMediaSource extends CompositeMediaSource<Integer> {
|
||||
|
||||
@Override
|
||||
public MediaItem getMediaItem() {
|
||||
return mediaSources.length > 0 ? mediaSources[0].getMediaItem() : EMPTY_MEDIA_ITEM;
|
||||
return mediaSources.length > 0 ? mediaSources[0].getMediaItem() : PLACEHOLDER_MEDIA_ITEM;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user