Make DRM code removable from ProgressiveMediaSource
Add a constructor that takes a DrmSessionManagerProvider. This allows R8 to strip the default implementation. #minor-release PiperOrigin-RevId: 425330083
This commit is contained in:
parent
40517200fc
commit
d4eb1edff6
@ -92,11 +92,38 @@ public final class ProgressiveMediaSource extends BaseMediaSource
|
|||||||
public Factory(
|
public Factory(
|
||||||
DataSource.Factory dataSourceFactory,
|
DataSource.Factory dataSourceFactory,
|
||||||
ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory) {
|
ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory) {
|
||||||
|
this(
|
||||||
|
dataSourceFactory,
|
||||||
|
progressiveMediaExtractorFactory,
|
||||||
|
new DefaultDrmSessionManagerProvider(),
|
||||||
|
new DefaultLoadErrorHandlingPolicy(),
|
||||||
|
DEFAULT_LOADING_CHECK_INTERVAL_BYTES);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new factory for {@link ProgressiveMediaSource}s.
|
||||||
|
*
|
||||||
|
* @param dataSourceFactory A factory for {@link DataSource}s to read the media.
|
||||||
|
* @param progressiveMediaExtractorFactory A factory for the {@link ProgressiveMediaExtractor}
|
||||||
|
* to extract media from its container.
|
||||||
|
* @param drmSessionManagerProvider A provider to obtain a {@link DrmSessionManager} for a
|
||||||
|
* {@link MediaItem}.
|
||||||
|
* @param loadErrorHandlingPolicy A policy to handle load error.
|
||||||
|
* @param continueLoadingCheckIntervalBytes The number of bytes that should be loaded between
|
||||||
|
* each invocation of {@link
|
||||||
|
* MediaPeriod.Callback#onContinueLoadingRequested(SequenceableLoader)}.
|
||||||
|
*/
|
||||||
|
public Factory(
|
||||||
|
DataSource.Factory dataSourceFactory,
|
||||||
|
ProgressiveMediaExtractor.Factory progressiveMediaExtractorFactory,
|
||||||
|
DrmSessionManagerProvider drmSessionManagerProvider,
|
||||||
|
LoadErrorHandlingPolicy loadErrorHandlingPolicy,
|
||||||
|
int continueLoadingCheckIntervalBytes) {
|
||||||
this.dataSourceFactory = dataSourceFactory;
|
this.dataSourceFactory = dataSourceFactory;
|
||||||
this.progressiveMediaExtractorFactory = progressiveMediaExtractorFactory;
|
this.progressiveMediaExtractorFactory = progressiveMediaExtractorFactory;
|
||||||
drmSessionManagerProvider = new DefaultDrmSessionManagerProvider();
|
this.drmSessionManagerProvider = drmSessionManagerProvider;
|
||||||
loadErrorHandlingPolicy = new DefaultLoadErrorHandlingPolicy();
|
this.loadErrorHandlingPolicy = loadErrorHandlingPolicy;
|
||||||
continueLoadingCheckIntervalBytes = DEFAULT_LOADING_CHECK_INTERVAL_BYTES;
|
this.continueLoadingCheckIntervalBytes = continueLoadingCheckIntervalBytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user