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 `DefaultAudioSink` constructors, use `DefaultAudioSink.Builder`
|
||||
instead.
|
||||
* Remove `HlsMasterPlaylist`, use `HlsMultivariantPlaylist` instead.
|
||||
|
||||
### 1.0.0 (2023-03-22)
|
||||
|
||||
|
@ -131,7 +131,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
private final FullSegmentEncryptionKeyCache keyCache;
|
||||
private final PlayerId playerId;
|
||||
|
||||
private boolean isTimestampMaster;
|
||||
private boolean isPrimaryTimestampSource;
|
||||
private byte[] scratchSpace;
|
||||
@Nullable private IOException fatalError;
|
||||
@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.
|
||||
*
|
||||
* @param isTimestampMaster True if this chunk source is responsible for initializing timestamp
|
||||
* adjusters.
|
||||
* @param isPrimaryTimestampSource True if this chunk source is responsible for initializing
|
||||
* timestamp adjusters.
|
||||
*/
|
||||
public void setIsTimestampMaster(boolean isTimestampMaster) {
|
||||
this.isTimestampMaster = isTimestampMaster;
|
||||
public void setIsPrimaryTimestampSource(boolean isPrimaryTimestampSource) {
|
||||
this.isPrimaryTimestampSource = isPrimaryTimestampSource;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -505,7 +505,7 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
||||
muxedCaptionFormats,
|
||||
trackSelection.getSelectionReason(),
|
||||
trackSelection.getSelectionData(),
|
||||
isTimestampMaster,
|
||||
isPrimaryTimestampSource,
|
||||
timestampAdjusterProvider,
|
||||
previous,
|
||||
/* mediaSegmentKey= */ keyCache.get(mediaSegmentKeyUri),
|
||||
|
@ -16,7 +16,6 @@
|
||||
package androidx.media3.exoplayer.hls;
|
||||
|
||||
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.HlsMultivariantPlaylist;
|
||||
|
||||
@ -24,12 +23,6 @@ import androidx.media3.exoplayer.hls.playlist.HlsMultivariantPlaylist;
|
||||
@UnstableApi
|
||||
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. */
|
||||
public final HlsMultivariantPlaylist 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 mediaPlaylist The media playlist.
|
||||
*/
|
||||
@SuppressWarnings("deprecation") // Intentionally creating deprecated hlsMasterPlaylist field.
|
||||
/* package */ HlsManifest(
|
||||
HlsMultivariantPlaylist multivariantPlaylist, HlsMediaPlaylist mediaPlaylist) {
|
||||
this.multivariantPlaylist = multivariantPlaylist;
|
||||
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.
|
||||
* @param trackSelectionReason See {@link #trackSelectionReason}.
|
||||
* @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
|
||||
* TimestampAdjuster}.
|
||||
* @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,
|
||||
@C.SelectionReason int trackSelectionReason,
|
||||
@Nullable Object trackSelectionData,
|
||||
boolean isMasterTimestampSource,
|
||||
boolean isPrimaryTimestampSource,
|
||||
TimestampAdjusterProvider timestampAdjusterProvider,
|
||||
@Nullable HlsMediaChunk previousChunk,
|
||||
@Nullable byte[] mediaSegmentKey,
|
||||
@ -180,7 +180,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
/* isPublished= */ !segmentBaseHolder.isPreload,
|
||||
discontinuitySequenceNumber,
|
||||
mediaSegment.hasGapTag,
|
||||
isMasterTimestampSource,
|
||||
isPrimaryTimestampSource,
|
||||
/* timestampAdjuster= */ timestampAdjusterProvider.getAdjuster(discontinuitySequenceNumber),
|
||||
mediaSegment.drmInitData,
|
||||
previousExtractor,
|
||||
@ -249,7 +249,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
@Nullable private final DataSpec initDataSpec;
|
||||
@Nullable private final HlsMediaChunkExtractor previousExtractor;
|
||||
|
||||
private final boolean isMasterTimestampSource;
|
||||
private final boolean isPrimaryTimestampSource;
|
||||
private final boolean hasGapTag;
|
||||
private final TimestampAdjuster timestampAdjuster;
|
||||
private final HlsExtractorFactory extractorFactory;
|
||||
@ -293,7 +293,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
boolean isPublished,
|
||||
int discontinuitySequenceNumber,
|
||||
boolean hasGapTag,
|
||||
boolean isMasterTimestampSource,
|
||||
boolean isPrimaryTimestampSource,
|
||||
TimestampAdjuster timestampAdjuster,
|
||||
@Nullable DrmInitData drmInitData,
|
||||
@Nullable HlsMediaChunkExtractor previousExtractor,
|
||||
@ -319,7 +319,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
this.initDataLoadRequired = initDataSpec != null;
|
||||
this.initSegmentEncrypted = initSegmentEncrypted;
|
||||
this.playlistUrl = playlistUrl;
|
||||
this.isMasterTimestampSource = isMasterTimestampSource;
|
||||
this.isPrimaryTimestampSource = isPrimaryTimestampSource;
|
||||
this.timestampAdjuster = timestampAdjuster;
|
||||
this.hasGapTag = hasGapTag;
|
||||
this.extractorFactory = extractorFactory;
|
||||
@ -495,7 +495,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
long bytesToRead = dataSource.open(dataSpec);
|
||||
if (initializeTimestampAdjuster) {
|
||||
try {
|
||||
timestampAdjuster.sharedInitializeOrWait(isMasterTimestampSource, startTimeUs);
|
||||
timestampAdjuster.sharedInitializeOrWait(isPrimaryTimestampSource, startTimeUs);
|
||||
} catch (InterruptedException e) {
|
||||
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
|
||||
// that the first wrapper will correspond to a variant, or else an audio rendition, or
|
||||
// else a text rendition, in that order.
|
||||
sampleStreamWrapper.setIsTimestampMaster(true);
|
||||
sampleStreamWrapper.setIsPrimaryTimestampSource(true);
|
||||
if (wasReset
|
||||
|| enabledSampleStreamWrappers.length == 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
|
||||
// permitted except in the case above in which no variant or audio rendition wrappers are
|
||||
// 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.manifestUrlIndicesPerWrapper = manifestUrlIndicesPerWrapper.toArray(new int[0][]);
|
||||
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++) {
|
||||
this.sampleStreamWrappers[i].setIsTimestampMaster(true);
|
||||
this.sampleStreamWrappers[i].setIsPrimaryTimestampSource(true);
|
||||
}
|
||||
for (HlsSampleStreamWrapper sampleStreamWrapper : this.sampleStreamWrappers) {
|
||||
sampleStreamWrapper.continuePreparing();
|
||||
|
@ -558,8 +558,8 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
|
||||
}
|
||||
}
|
||||
|
||||
public void setIsTimestampMaster(boolean isTimestampMaster) {
|
||||
chunkSource.setIsTimestampMaster(isTimestampMaster);
|
||||
public void setIsPrimaryTimestampSource(boolean isPrimaryTimestampSource) {
|
||||
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;
|
||||
|
||||
/** Represents an HLS multivariant playlist. */
|
||||
// TODO(b/211458101): Make non-final once HlsMasterPlaylist is removed.
|
||||
@UnstableApi
|
||||
public class HlsMultivariantPlaylist extends HlsPlaylist {
|
||||
public final class HlsMultivariantPlaylist extends HlsPlaylist {
|
||||
|
||||
/** Represents an empty multivariant playlist, from which no attributes can be inherited. */
|
||||
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.
|
||||
*
|
||||
* @param multivariantPlaylist The multivariant playlist from which media playlists will inherit
|
||||
|
Loading…
x
Reference in New Issue
Block a user