Remove deprecated HlsMasterPlaylist
And some further remaining usages of "master" in the HLS module. These usages are all package-private. PiperOrigin-RevId: 520334163
This commit is contained in:
parent
331d5479e6
commit
4b7875fe21
@ -52,6 +52,7 @@
|
|||||||
* Remove deprecated symbols:
|
* Remove deprecated symbols:
|
||||||
* Remove `DefaultAudioSink` constructors, use `DefaultAudioSink.Builder`
|
* Remove `DefaultAudioSink` constructors, use `DefaultAudioSink.Builder`
|
||||||
instead.
|
instead.
|
||||||
|
* Remove `HlsMasterPlaylist`, use `HlsMultivariantPlaylist` instead.
|
||||||
|
|
||||||
### 1.0.0 (2023-03-22)
|
### 1.0.0 (2023-03-22)
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||||||
private final FullSegmentEncryptionKeyCache keyCache;
|
private final FullSegmentEncryptionKeyCache keyCache;
|
||||||
private final PlayerId playerId;
|
private final PlayerId playerId;
|
||||||
|
|
||||||
private boolean isTimestampMaster;
|
private boolean isPrimaryTimestampSource;
|
||||||
private byte[] scratchSpace;
|
private byte[] scratchSpace;
|
||||||
@Nullable private IOException fatalError;
|
@Nullable private IOException fatalError;
|
||||||
@Nullable private Uri expectedPlaylistUrl;
|
@Nullable private Uri expectedPlaylistUrl;
|
||||||
@ -240,11 +240,11 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||||||
/**
|
/**
|
||||||
* Sets whether this chunk source is responsible for initializing timestamp adjusters.
|
* Sets whether this chunk source is responsible for initializing timestamp adjusters.
|
||||||
*
|
*
|
||||||
* @param isTimestampMaster True if this chunk source is responsible for initializing timestamp
|
* @param isPrimaryTimestampSource True if this chunk source is responsible for initializing
|
||||||
* adjusters.
|
* timestamp adjusters.
|
||||||
*/
|
*/
|
||||||
public void setIsTimestampMaster(boolean isTimestampMaster) {
|
public void setIsPrimaryTimestampSource(boolean isPrimaryTimestampSource) {
|
||||||
this.isTimestampMaster = isTimestampMaster;
|
this.isPrimaryTimestampSource = isPrimaryTimestampSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -505,7 +505,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||||||
muxedCaptionFormats,
|
muxedCaptionFormats,
|
||||||
trackSelection.getSelectionReason(),
|
trackSelection.getSelectionReason(),
|
||||||
trackSelection.getSelectionData(),
|
trackSelection.getSelectionData(),
|
||||||
isTimestampMaster,
|
isPrimaryTimestampSource,
|
||||||
timestampAdjusterProvider,
|
timestampAdjusterProvider,
|
||||||
previous,
|
previous,
|
||||||
/* mediaSegmentKey= */ keyCache.get(mediaSegmentKeyUri),
|
/* mediaSegmentKey= */ keyCache.get(mediaSegmentKeyUri),
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
package androidx.media3.exoplayer.hls;
|
package androidx.media3.exoplayer.hls;
|
||||||
|
|
||||||
import androidx.media3.common.util.UnstableApi;
|
import androidx.media3.common.util.UnstableApi;
|
||||||
import androidx.media3.exoplayer.hls.playlist.HlsMasterPlaylist;
|
|
||||||
import androidx.media3.exoplayer.hls.playlist.HlsMediaPlaylist;
|
import androidx.media3.exoplayer.hls.playlist.HlsMediaPlaylist;
|
||||||
import androidx.media3.exoplayer.hls.playlist.HlsMultivariantPlaylist;
|
import androidx.media3.exoplayer.hls.playlist.HlsMultivariantPlaylist;
|
||||||
|
|
||||||
@ -24,12 +23,6 @@ import androidx.media3.exoplayer.hls.playlist.HlsMultivariantPlaylist;
|
|||||||
@UnstableApi
|
@UnstableApi
|
||||||
public final class HlsManifest {
|
public final class HlsManifest {
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Use {@link #multivariantPlaylist} instead.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@SuppressWarnings("deprecation") // Keeping deprecated field with deprecated class.
|
|
||||||
public final HlsMasterPlaylist masterPlaylist;
|
|
||||||
/** The multivariant playlist of an HLS stream. */
|
/** The multivariant playlist of an HLS stream. */
|
||||||
public final HlsMultivariantPlaylist multivariantPlaylist;
|
public final HlsMultivariantPlaylist multivariantPlaylist;
|
||||||
/** A snapshot of a media playlist referred to by {@link #multivariantPlaylist}. */
|
/** A snapshot of a media playlist referred to by {@link #multivariantPlaylist}. */
|
||||||
@ -39,24 +32,9 @@ public final class HlsManifest {
|
|||||||
* @param multivariantPlaylist The multivariant playlist.
|
* @param multivariantPlaylist The multivariant playlist.
|
||||||
* @param mediaPlaylist The media playlist.
|
* @param mediaPlaylist The media playlist.
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("deprecation") // Intentionally creating deprecated hlsMasterPlaylist field.
|
|
||||||
/* package */ HlsManifest(
|
/* package */ HlsManifest(
|
||||||
HlsMultivariantPlaylist multivariantPlaylist, HlsMediaPlaylist mediaPlaylist) {
|
HlsMultivariantPlaylist multivariantPlaylist, HlsMediaPlaylist mediaPlaylist) {
|
||||||
this.multivariantPlaylist = multivariantPlaylist;
|
this.multivariantPlaylist = multivariantPlaylist;
|
||||||
this.mediaPlaylist = mediaPlaylist;
|
this.mediaPlaylist = mediaPlaylist;
|
||||||
this.masterPlaylist =
|
|
||||||
new HlsMasterPlaylist(
|
|
||||||
multivariantPlaylist.baseUri,
|
|
||||||
multivariantPlaylist.tags,
|
|
||||||
multivariantPlaylist.variants,
|
|
||||||
multivariantPlaylist.videos,
|
|
||||||
multivariantPlaylist.audios,
|
|
||||||
multivariantPlaylist.subtitles,
|
|
||||||
multivariantPlaylist.closedCaptions,
|
|
||||||
multivariantPlaylist.muxedAudioFormat,
|
|
||||||
multivariantPlaylist.muxedCaptionFormats,
|
|
||||||
multivariantPlaylist.hasIndependentSegments,
|
|
||||||
multivariantPlaylist.variableDefinitions,
|
|
||||||
multivariantPlaylist.sessionKeyDrmInitData);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,7 +67,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||||||
* information is available in the multivariant playlist.
|
* information is available in the multivariant playlist.
|
||||||
* @param trackSelectionReason See {@link #trackSelectionReason}.
|
* @param trackSelectionReason See {@link #trackSelectionReason}.
|
||||||
* @param trackSelectionData See {@link #trackSelectionData}.
|
* @param trackSelectionData See {@link #trackSelectionData}.
|
||||||
* @param isMasterTimestampSource True if the chunk can initialize the timestamp adjuster.
|
* @param isPrimaryTimestampSource True if the chunk can initialize the timestamp adjuster.
|
||||||
* @param timestampAdjusterProvider The provider from which to obtain the {@link
|
* @param timestampAdjusterProvider The provider from which to obtain the {@link
|
||||||
* TimestampAdjuster}.
|
* TimestampAdjuster}.
|
||||||
* @param previousChunk The {@link HlsMediaChunk} that preceded this one. May be null.
|
* @param previousChunk The {@link HlsMediaChunk} that preceded this one. May be null.
|
||||||
@ -87,7 +87,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||||||
@Nullable List<Format> muxedCaptionFormats,
|
@Nullable List<Format> muxedCaptionFormats,
|
||||||
@C.SelectionReason int trackSelectionReason,
|
@C.SelectionReason int trackSelectionReason,
|
||||||
@Nullable Object trackSelectionData,
|
@Nullable Object trackSelectionData,
|
||||||
boolean isMasterTimestampSource,
|
boolean isPrimaryTimestampSource,
|
||||||
TimestampAdjusterProvider timestampAdjusterProvider,
|
TimestampAdjusterProvider timestampAdjusterProvider,
|
||||||
@Nullable HlsMediaChunk previousChunk,
|
@Nullable HlsMediaChunk previousChunk,
|
||||||
@Nullable byte[] mediaSegmentKey,
|
@Nullable byte[] mediaSegmentKey,
|
||||||
@ -180,7 +180,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||||||
/* isPublished= */ !segmentBaseHolder.isPreload,
|
/* isPublished= */ !segmentBaseHolder.isPreload,
|
||||||
discontinuitySequenceNumber,
|
discontinuitySequenceNumber,
|
||||||
mediaSegment.hasGapTag,
|
mediaSegment.hasGapTag,
|
||||||
isMasterTimestampSource,
|
isPrimaryTimestampSource,
|
||||||
/* timestampAdjuster= */ timestampAdjusterProvider.getAdjuster(discontinuitySequenceNumber),
|
/* timestampAdjuster= */ timestampAdjusterProvider.getAdjuster(discontinuitySequenceNumber),
|
||||||
mediaSegment.drmInitData,
|
mediaSegment.drmInitData,
|
||||||
previousExtractor,
|
previousExtractor,
|
||||||
@ -249,7 +249,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||||||
@Nullable private final DataSpec initDataSpec;
|
@Nullable private final DataSpec initDataSpec;
|
||||||
@Nullable private final HlsMediaChunkExtractor previousExtractor;
|
@Nullable private final HlsMediaChunkExtractor previousExtractor;
|
||||||
|
|
||||||
private final boolean isMasterTimestampSource;
|
private final boolean isPrimaryTimestampSource;
|
||||||
private final boolean hasGapTag;
|
private final boolean hasGapTag;
|
||||||
private final TimestampAdjuster timestampAdjuster;
|
private final TimestampAdjuster timestampAdjuster;
|
||||||
private final HlsExtractorFactory extractorFactory;
|
private final HlsExtractorFactory extractorFactory;
|
||||||
@ -293,7 +293,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||||||
boolean isPublished,
|
boolean isPublished,
|
||||||
int discontinuitySequenceNumber,
|
int discontinuitySequenceNumber,
|
||||||
boolean hasGapTag,
|
boolean hasGapTag,
|
||||||
boolean isMasterTimestampSource,
|
boolean isPrimaryTimestampSource,
|
||||||
TimestampAdjuster timestampAdjuster,
|
TimestampAdjuster timestampAdjuster,
|
||||||
@Nullable DrmInitData drmInitData,
|
@Nullable DrmInitData drmInitData,
|
||||||
@Nullable HlsMediaChunkExtractor previousExtractor,
|
@Nullable HlsMediaChunkExtractor previousExtractor,
|
||||||
@ -319,7 +319,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||||||
this.initDataLoadRequired = initDataSpec != null;
|
this.initDataLoadRequired = initDataSpec != null;
|
||||||
this.initSegmentEncrypted = initSegmentEncrypted;
|
this.initSegmentEncrypted = initSegmentEncrypted;
|
||||||
this.playlistUrl = playlistUrl;
|
this.playlistUrl = playlistUrl;
|
||||||
this.isMasterTimestampSource = isMasterTimestampSource;
|
this.isPrimaryTimestampSource = isPrimaryTimestampSource;
|
||||||
this.timestampAdjuster = timestampAdjuster;
|
this.timestampAdjuster = timestampAdjuster;
|
||||||
this.hasGapTag = hasGapTag;
|
this.hasGapTag = hasGapTag;
|
||||||
this.extractorFactory = extractorFactory;
|
this.extractorFactory = extractorFactory;
|
||||||
@ -495,7 +495,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||||||
long bytesToRead = dataSource.open(dataSpec);
|
long bytesToRead = dataSource.open(dataSpec);
|
||||||
if (initializeTimestampAdjuster) {
|
if (initializeTimestampAdjuster) {
|
||||||
try {
|
try {
|
||||||
timestampAdjuster.sharedInitializeOrWait(isMasterTimestampSource, startTimeUs);
|
timestampAdjuster.sharedInitializeOrWait(isPrimaryTimestampSource, startTimeUs);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
throw new InterruptedIOException();
|
throw new InterruptedIOException();
|
||||||
}
|
}
|
||||||
|
@ -338,7 +338,7 @@ public final class HlsMediaPeriod implements MediaPeriod, HlsPlaylistTracker.Pla
|
|||||||
// The first enabled wrapper is always allowed to initialize timestamp adjusters. Note
|
// The first enabled wrapper is always allowed to initialize timestamp adjusters. Note
|
||||||
// that the first wrapper will correspond to a variant, or else an audio rendition, or
|
// that the first wrapper will correspond to a variant, or else an audio rendition, or
|
||||||
// else a text rendition, in that order.
|
// else a text rendition, in that order.
|
||||||
sampleStreamWrapper.setIsTimestampMaster(true);
|
sampleStreamWrapper.setIsPrimaryTimestampSource(true);
|
||||||
if (wasReset
|
if (wasReset
|
||||||
|| enabledSampleStreamWrappers.length == 0
|
|| enabledSampleStreamWrappers.length == 0
|
||||||
|| sampleStreamWrapper != enabledSampleStreamWrappers[0]) {
|
|| sampleStreamWrapper != enabledSampleStreamWrappers[0]) {
|
||||||
@ -352,7 +352,7 @@ public final class HlsMediaPeriod implements MediaPeriod, HlsPlaylistTracker.Pla
|
|||||||
// audio or video, since they are expected to contain dense samples. Text wrappers are not
|
// audio or video, since they are expected to contain dense samples. Text wrappers are not
|
||||||
// permitted except in the case above in which no variant or audio rendition wrappers are
|
// permitted except in the case above in which no variant or audio rendition wrappers are
|
||||||
// enabled.
|
// enabled.
|
||||||
sampleStreamWrapper.setIsTimestampMaster(i < audioVideoSampleStreamWrapperCount);
|
sampleStreamWrapper.setIsPrimaryTimestampSource(i < audioVideoSampleStreamWrapperCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -526,9 +526,9 @@ public final class HlsMediaPeriod implements MediaPeriod, HlsPlaylistTracker.Pla
|
|||||||
this.sampleStreamWrappers = sampleStreamWrappers.toArray(new HlsSampleStreamWrapper[0]);
|
this.sampleStreamWrappers = sampleStreamWrappers.toArray(new HlsSampleStreamWrapper[0]);
|
||||||
this.manifestUrlIndicesPerWrapper = manifestUrlIndicesPerWrapper.toArray(new int[0][]);
|
this.manifestUrlIndicesPerWrapper = manifestUrlIndicesPerWrapper.toArray(new int[0][]);
|
||||||
pendingPrepareCount = this.sampleStreamWrappers.length;
|
pendingPrepareCount = this.sampleStreamWrappers.length;
|
||||||
// Set timestamp masters and trigger preparation (if not already prepared)
|
// Set primary timestamp source and trigger preparation (if not already prepared)
|
||||||
for (int i = 0; i < audioVideoSampleStreamWrapperCount; i++) {
|
for (int i = 0; i < audioVideoSampleStreamWrapperCount; i++) {
|
||||||
this.sampleStreamWrappers[i].setIsTimestampMaster(true);
|
this.sampleStreamWrappers[i].setIsPrimaryTimestampSource(true);
|
||||||
}
|
}
|
||||||
for (HlsSampleStreamWrapper sampleStreamWrapper : this.sampleStreamWrappers) {
|
for (HlsSampleStreamWrapper sampleStreamWrapper : this.sampleStreamWrappers) {
|
||||||
sampleStreamWrapper.continuePreparing();
|
sampleStreamWrapper.continuePreparing();
|
||||||
|
@ -558,8 +558,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIsTimestampMaster(boolean isTimestampMaster) {
|
public void setIsPrimaryTimestampSource(boolean isPrimaryTimestampSource) {
|
||||||
chunkSource.setIsTimestampMaster(isTimestampMaster);
|
chunkSource.setIsPrimaryTimestampSource(isPrimaryTimestampSource);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,65 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2016 The Android Open Source Project
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
package androidx.media3.exoplayer.hls.playlist;
|
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.media3.common.DrmInitData;
|
|
||||||
import androidx.media3.common.Format;
|
|
||||||
import androidx.media3.common.util.UnstableApi;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Use {@link HlsMultivariantPlaylist} instead.
|
|
||||||
*/
|
|
||||||
@UnstableApi
|
|
||||||
@Deprecated
|
|
||||||
public final class HlsMasterPlaylist extends HlsMultivariantPlaylist {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates an HLS multivariant playlist.
|
|
||||||
*
|
|
||||||
* @deprecated Use {@link HlsMultivariantPlaylist#HlsMultivariantPlaylist} instead.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public HlsMasterPlaylist(
|
|
||||||
String baseUri,
|
|
||||||
List<String> tags,
|
|
||||||
List<Variant> variants,
|
|
||||||
List<Rendition> videos,
|
|
||||||
List<Rendition> audios,
|
|
||||||
List<Rendition> subtitles,
|
|
||||||
List<Rendition> closedCaptions,
|
|
||||||
@Nullable Format muxedAudioFormat,
|
|
||||||
@Nullable List<Format> muxedCaptionFormats,
|
|
||||||
boolean hasIndependentSegments,
|
|
||||||
Map<String, String> variableDefinitions,
|
|
||||||
List<DrmInitData> sessionKeyDrmInitData) {
|
|
||||||
super(
|
|
||||||
baseUri,
|
|
||||||
tags,
|
|
||||||
variants,
|
|
||||||
videos,
|
|
||||||
audios,
|
|
||||||
subtitles,
|
|
||||||
closedCaptions,
|
|
||||||
muxedAudioFormat,
|
|
||||||
muxedCaptionFormats,
|
|
||||||
hasIndependentSegments,
|
|
||||||
variableDefinitions,
|
|
||||||
sessionKeyDrmInitData);
|
|
||||||
}
|
|
||||||
}
|
|
@ -28,9 +28,8 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/** Represents an HLS multivariant playlist. */
|
/** Represents an HLS multivariant playlist. */
|
||||||
// TODO(b/211458101): Make non-final once HlsMasterPlaylist is removed.
|
|
||||||
@UnstableApi
|
@UnstableApi
|
||||||
public class HlsMultivariantPlaylist extends HlsPlaylist {
|
public final class HlsMultivariantPlaylist extends HlsPlaylist {
|
||||||
|
|
||||||
/** Represents an empty multivariant playlist, from which no attributes can be inherited. */
|
/** Represents an empty multivariant playlist, from which no attributes can be inherited. */
|
||||||
public static final HlsMultivariantPlaylist EMPTY =
|
public static final HlsMultivariantPlaylist EMPTY =
|
||||||
|
@ -237,7 +237,7 @@ public final class HlsPlaylistParser implements ParsingLoadable.Parser<HlsPlayli
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an instance where parsed media playlists inherit attributes from the given master
|
* Creates an instance where parsed media playlists inherit attributes from the given multivariant
|
||||||
* playlist.
|
* playlist.
|
||||||
*
|
*
|
||||||
* @param multivariantPlaylist The multivariant playlist from which media playlists will inherit
|
* @param multivariantPlaylist The multivariant playlist from which media playlists will inherit
|
||||||
|
Loading…
x
Reference in New Issue
Block a user