Replace non-inclusively named constant

Issue: #7565
PiperOrigin-RevId: 353649187
This commit is contained in:
olly 2021-01-25 16:11:39 +00:00 committed by Ian Baker
parent b0258e7192
commit a1f06987eb
23 changed files with 63 additions and 51 deletions

View File

@ -152,7 +152,7 @@ public final class MainActivity extends Activity {
.setUuidAndExoMediaDrmProvider(drmSchemeUuid, FrameworkMediaDrm.DEFAULT_PROVIDER) .setUuidAndExoMediaDrmProvider(drmSchemeUuid, FrameworkMediaDrm.DEFAULT_PROVIDER)
.build(drmCallback); .build(drmCallback);
} else { } else {
drmSessionManager = DrmSessionManager.getDummyDrmSessionManager(); drmSessionManager = DrmSessionManager.DRM_UNSUPPORTED;
} }
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(this); DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(this);

View File

@ -197,7 +197,7 @@ public final class MainActivity extends Activity {
.setUuidAndExoMediaDrmProvider(drmSchemeUuid, FrameworkMediaDrm.DEFAULT_PROVIDER) .setUuidAndExoMediaDrmProvider(drmSchemeUuid, FrameworkMediaDrm.DEFAULT_PROVIDER)
.build(drmCallback); .build(drmCallback);
} else { } else {
drmSessionManager = DrmSessionManager.getDummyDrmSessionManager(); drmSessionManager = DrmSessionManager.DRM_UNSUPPORTED;
} }
DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(this); DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(this);

View File

@ -64,7 +64,7 @@ public final class DefaultDrmSessionManagerProvider implements DrmSessionManager
@Nullable @Nullable
MediaItem.DrmConfiguration drmConfiguration = mediaItem.playbackProperties.drmConfiguration; MediaItem.DrmConfiguration drmConfiguration = mediaItem.playbackProperties.drmConfiguration;
if (drmConfiguration == null || Util.SDK_INT < 18) { if (drmConfiguration == null || Util.SDK_INT < 18) {
return DrmSessionManager.getDummyDrmSessionManager(); return DrmSessionManager.DRM_UNSUPPORTED;
} }
HttpDataSource.Factory dataSourceFactory = HttpDataSource.Factory dataSourceFactory =
drmHttpDataSourceFactory != null drmHttpDataSourceFactory != null

View File

@ -22,13 +22,8 @@ import com.google.android.exoplayer2.Format;
/** Manages a DRM session. */ /** Manages a DRM session. */
public interface DrmSessionManager { public interface DrmSessionManager {
/** Returns {@link #DUMMY}. */ /** An instance that supports no DRM schemes. */
static DrmSessionManager getDummyDrmSessionManager() { DrmSessionManager DRM_UNSUPPORTED =
return DUMMY;
}
/** {@link DrmSessionManager} that supports no DRM schemes. */
DrmSessionManager DUMMY =
new DrmSessionManager() { new DrmSessionManager() {
@Override @Override
@ -54,6 +49,23 @@ public interface DrmSessionManager {
} }
}; };
/**
* An instance that supports no DRM schemes.
*
* @deprecated Use {@link #DRM_UNSUPPORTED}.
*/
@Deprecated DrmSessionManager DUMMY = DRM_UNSUPPORTED;
/**
* Returns {@link #DRM_UNSUPPORTED}.
*
* @deprecated Use {@link #DRM_UNSUPPORTED}.
*/
@Deprecated
static DrmSessionManager getDummyDrmSessionManager() {
return DRM_UNSUPPORTED;
}
/** /**
* Acquires any required resources. * Acquires any required resources.
* *

View File

@ -337,7 +337,7 @@ public final class ExtractorMediaSource extends CompositeMediaSource<Void> {
.build(), .build(),
dataSourceFactory, dataSourceFactory,
extractorsFactory, extractorsFactory,
DrmSessionManager.getDummyDrmSessionManager(), DrmSessionManager.DRM_UNSUPPORTED,
loadableLoadErrorHandlingPolicy, loadableLoadErrorHandlingPolicy,
continueLoadingCheckIntervalBytes); continueLoadingCheckIntervalBytes);
} }

View File

@ -7613,7 +7613,7 @@ public final class ExoPlayerTest {
FakeMediaSource firstMediaSource = FakeMediaSource firstMediaSource =
new FakeMediaSource( new FakeMediaSource(
/* timeline= */ null, /* timeline= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
(unusedFormat, unusedMediaPeriodId) -> (unusedFormat, unusedMediaPeriodId) ->
ImmutableList.of( ImmutableList.of(
oneByteSample(firstSampleTimeUs, C.BUFFER_FLAG_KEY_FRAME), END_OF_STREAM_ITEM), oneByteSample(firstSampleTimeUs, C.BUFFER_FLAG_KEY_FRAME), END_OF_STREAM_ITEM),
@ -7621,7 +7621,7 @@ public final class ExoPlayerTest {
FakeMediaSource secondMediaSource = FakeMediaSource secondMediaSource =
new FakeMediaSource( new FakeMediaSource(
timelineWithOffsets, timelineWithOffsets,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
(unusedFormat, unusedMediaPeriodId) -> (unusedFormat, unusedMediaPeriodId) ->
ImmutableList.of( ImmutableList.of(
oneByteSample(firstSampleTimeUs, C.BUFFER_FLAG_KEY_FRAME), END_OF_STREAM_ITEM), oneByteSample(firstSampleTimeUs, C.BUFFER_FLAG_KEY_FRAME), END_OF_STREAM_ITEM),
@ -8155,7 +8155,7 @@ public final class ExoPlayerTest {
allocator, allocator,
/* singleSampleTimeUs= */ 0, /* singleSampleTimeUs= */ 0,
mediaSourceEventDispatcher, mediaSourceEventDispatcher,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
drmEventDispatcher, drmEventDispatcher,
/* deferOnPrepared= */ true) { /* deferOnPrepared= */ true) {
@Override @Override

View File

@ -1005,7 +1005,7 @@ public final class AnalyticsCollectorTest {
FakeMediaSource fakeMediaSource = FakeMediaSource fakeMediaSource =
new FakeMediaSource( new FakeMediaSource(
adTimeline, adTimeline,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
(unusedFormat, mediaPeriodId) -> { (unusedFormat, mediaPeriodId) -> {
if (mediaPeriodId.isAd()) { if (mediaPeriodId.isAd()) {
return ImmutableList.of( return ImmutableList.of(
@ -1265,7 +1265,7 @@ public final class AnalyticsCollectorTest {
FakeMediaSource fakeMediaSource = FakeMediaSource fakeMediaSource =
new FakeMediaSource( new FakeMediaSource(
adTimeline, adTimeline,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
(unusedFormat, mediaPeriodId) -> { (unusedFormat, mediaPeriodId) -> {
if (mediaPeriodId.isAd()) { if (mediaPeriodId.isAd()) {
return ImmutableList.of( return ImmutableList.of(

View File

@ -107,7 +107,7 @@ public class DecoderAudioRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
FORMAT, FORMAT,
ImmutableList.of(END_OF_STREAM_ITEM)); ImmutableList.of(END_OF_STREAM_ITEM));

View File

@ -121,7 +121,7 @@ public class MediaCodecAudioRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ AUDIO_AAC, /* initialFormat= */ AUDIO_AAC,
ImmutableList.of( ImmutableList.of(
@ -178,7 +178,7 @@ public class MediaCodecAudioRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ AUDIO_AAC, /* initialFormat= */ AUDIO_AAC,
ImmutableList.of( ImmutableList.of(
@ -256,7 +256,7 @@ public class MediaCodecAudioRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ AUDIO_AAC, /* initialFormat= */ AUDIO_AAC,
ImmutableList.of( ImmutableList.of(

View File

@ -151,7 +151,7 @@ public class MetadataRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
EMSG_FORMAT, EMSG_FORMAT,
ImmutableList.of( ImmutableList.of(

View File

@ -35,7 +35,7 @@ public class DefaultDrmSessionManagerProviderTest {
DrmSessionManager drmSessionManager = DrmSessionManager drmSessionManager =
new DefaultDrmSessionManagerProvider().get(MediaItem.fromUri(Uri.EMPTY)); new DefaultDrmSessionManagerProvider().get(MediaItem.fromUri(Uri.EMPTY));
assertThat(drmSessionManager).isEqualTo(DrmSessionManager.DUMMY); assertThat(drmSessionManager).isEqualTo(DrmSessionManager.DRM_UNSUPPORTED);
} }
@Test @Test
@ -49,6 +49,6 @@ public class DefaultDrmSessionManagerProviderTest {
DrmSessionManager drmSessionManager = new DefaultDrmSessionManagerProvider().get(mediaItem); DrmSessionManager drmSessionManager = new DefaultDrmSessionManagerProvider().get(mediaItem);
assertThat(drmSessionManager).isNotEqualTo(DrmSessionManager.DUMMY); assertThat(drmSessionManager).isNotEqualTo(DrmSessionManager.DRM_UNSUPPORTED);
} }
} }

View File

@ -212,7 +212,7 @@ public final class MergingMediaPeriodTest {
new DefaultAllocator(/* trimOnReset= */ false, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ false, /* individualAllocationSize= */ 1024),
trackDataFactory, trackDataFactory,
mediaSourceEventDispatcher, mediaSourceEventDispatcher,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* deferOnPrepared= */ false); /* deferOnPrepared= */ false);
selectTracksPositionUs = C.TIME_UNSET; selectTracksPositionUs = C.TIME_UNSET;

View File

@ -49,7 +49,7 @@ public final class ProgressiveMediaPeriodTest {
Uri.parse("asset://android_asset/media/mp4/sample.mp4"), Uri.parse("asset://android_asset/media/mp4/sample.mp4"),
new AssetDataSource(ApplicationProvider.getApplicationContext()), new AssetDataSource(ApplicationProvider.getApplicationContext()),
() -> new Extractor[] {new Mp4Extractor()}, () -> new Extractor[] {new Mp4Extractor()},
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher() new DrmSessionEventListener.EventDispatcher()
.withParameters(/* windowIndex= */ 0, mediaPeriodId), .withParameters(/* windowIndex= */ 0, mediaPeriodId),
new DefaultLoadErrorHandlingPolicy(), new DefaultLoadErrorHandlingPolicy(),

View File

@ -187,7 +187,7 @@ public final class DecoderVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ H264_FORMAT, /* initialFormat= */ H264_FORMAT,
ImmutableList.of(oneByteSample(/* timeUs= */ 0, C.BUFFER_FLAG_KEY_FRAME))); ImmutableList.of(oneByteSample(/* timeUs= */ 0, C.BUFFER_FLAG_KEY_FRAME)));
@ -218,7 +218,7 @@ public final class DecoderVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ H264_FORMAT, /* initialFormat= */ H264_FORMAT,
ImmutableList.of(oneByteSample(/* timeUs= */ 0, C.BUFFER_FLAG_KEY_FRAME))); ImmutableList.of(oneByteSample(/* timeUs= */ 0, C.BUFFER_FLAG_KEY_FRAME)));
@ -248,7 +248,7 @@ public final class DecoderVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ H264_FORMAT, /* initialFormat= */ H264_FORMAT,
ImmutableList.of(oneByteSample(/* timeUs= */ 0, C.BUFFER_FLAG_KEY_FRAME))); ImmutableList.of(oneByteSample(/* timeUs= */ 0, C.BUFFER_FLAG_KEY_FRAME)));
@ -281,7 +281,7 @@ public final class DecoderVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ H264_FORMAT, /* initialFormat= */ H264_FORMAT,
ImmutableList.of( ImmutableList.of(
@ -291,7 +291,7 @@ public final class DecoderVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ H264_FORMAT, /* initialFormat= */ H264_FORMAT,
ImmutableList.of(oneByteSample(/* timeUs= */ 0), END_OF_STREAM_ITEM)); ImmutableList.of(oneByteSample(/* timeUs= */ 0), END_OF_STREAM_ITEM));
@ -333,7 +333,7 @@ public final class DecoderVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ H264_FORMAT, /* initialFormat= */ H264_FORMAT,
ImmutableList.of( ImmutableList.of(
@ -343,7 +343,7 @@ public final class DecoderVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ H264_FORMAT, /* initialFormat= */ H264_FORMAT,
ImmutableList.of(oneByteSample(/* timeUs= */ 0), END_OF_STREAM_ITEM)); ImmutableList.of(oneByteSample(/* timeUs= */ 0), END_OF_STREAM_ITEM));

View File

@ -128,7 +128,7 @@ public class MediaCodecVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ VIDEO_H264, /* initialFormat= */ VIDEO_H264,
ImmutableList.of( ImmutableList.of(
@ -167,7 +167,7 @@ public class MediaCodecVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ VIDEO_H264, /* initialFormat= */ VIDEO_H264,
ImmutableList.of( ImmutableList.of(
@ -212,7 +212,7 @@ public class MediaCodecVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ pAsp1, /* initialFormat= */ pAsp1,
ImmutableList.of(oneByteSample(/* timeUs= */ 0, C.BUFFER_FLAG_KEY_FRAME))); ImmutableList.of(oneByteSample(/* timeUs= */ 0, C.BUFFER_FLAG_KEY_FRAME)));
@ -264,7 +264,7 @@ public class MediaCodecVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ VIDEO_H264, /* initialFormat= */ VIDEO_H264,
ImmutableList.of(oneByteSample(/* timeUs= */ 0, C.BUFFER_FLAG_KEY_FRAME))); ImmutableList.of(oneByteSample(/* timeUs= */ 0, C.BUFFER_FLAG_KEY_FRAME)));
@ -303,7 +303,7 @@ public class MediaCodecVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ VIDEO_H264, /* initialFormat= */ VIDEO_H264,
ImmutableList.of(oneByteSample(/* timeUs= */ 0, C.BUFFER_FLAG_KEY_FRAME))); ImmutableList.of(oneByteSample(/* timeUs= */ 0, C.BUFFER_FLAG_KEY_FRAME)));
@ -333,7 +333,7 @@ public class MediaCodecVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ VIDEO_H264, /* initialFormat= */ VIDEO_H264,
ImmutableList.of(oneByteSample(/* timeUs= */ 0, C.BUFFER_FLAG_KEY_FRAME))); ImmutableList.of(oneByteSample(/* timeUs= */ 0, C.BUFFER_FLAG_KEY_FRAME)));
@ -362,7 +362,7 @@ public class MediaCodecVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ VIDEO_H264, /* initialFormat= */ VIDEO_H264,
ImmutableList.of(oneByteSample(/* timeUs= */ 0, C.BUFFER_FLAG_KEY_FRAME))); ImmutableList.of(oneByteSample(/* timeUs= */ 0, C.BUFFER_FLAG_KEY_FRAME)));
@ -393,7 +393,7 @@ public class MediaCodecVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ VIDEO_H264, /* initialFormat= */ VIDEO_H264,
ImmutableList.of( ImmutableList.of(
@ -403,7 +403,7 @@ public class MediaCodecVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ VIDEO_H264, /* initialFormat= */ VIDEO_H264,
ImmutableList.of( ImmutableList.of(
@ -447,7 +447,7 @@ public class MediaCodecVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ VIDEO_H264, /* initialFormat= */ VIDEO_H264,
ImmutableList.of( ImmutableList.of(
@ -457,7 +457,7 @@ public class MediaCodecVideoRendererTest {
new FakeSampleStream( new FakeSampleStream(
new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024), new DefaultAllocator(/* trimOnReset= */ true, /* individualAllocationSize= */ 1024),
/* mediaSourceEventDispatcher= */ null, /* mediaSourceEventDispatcher= */ null,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* initialFormat= */ VIDEO_H264, /* initialFormat= */ VIDEO_H264,
ImmutableList.of( ImmutableList.of(

View File

@ -201,7 +201,7 @@ public final class DashMediaPeriodTest {
periodIndex, periodIndex,
mock(DashChunkSource.Factory.class), mock(DashChunkSource.Factory.class),
mock(TransferListener.class), mock(TransferListener.class),
DrmSessionManager.getDummyDrmSessionManager(), DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher() new DrmSessionEventListener.EventDispatcher()
.withParameters(/* windowIndex= */ 0, mediaPeriodId), .withParameters(/* windowIndex= */ 0, mediaPeriodId),
mock(LoadErrorHandlingPolicy.class), mock(LoadErrorHandlingPolicy.class),

View File

@ -42,6 +42,6 @@ public final class DownloadHelperTest {
DownloadHelper.DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_CONTEXT, DownloadHelper.DEFAULT_TRACK_SELECTOR_PARAMETERS_WITHOUT_CONTEXT,
(handler, videoListener, audioListener, text, metadata) -> new Renderer[0], (handler, videoListener, audioListener, text, metadata) -> new Renderer[0],
new FakeDataSource.Factory(), new FakeDataSource.Factory(),
/* drmSessionManager= */ DrmSessionManager.getDummyDrmSessionManager()); /* drmSessionManager= */ DrmSessionManager.DRM_UNSUPPORTED);
} }
} }

View File

@ -260,7 +260,7 @@ import java.util.List;
@Override @Override
protected DrmSessionManager buildDrmSessionManager() { protected DrmSessionManager buildDrmSessionManager() {
if (widevineLicenseUrl == null) { if (widevineLicenseUrl == null) {
return DrmSessionManager.getDummyDrmSessionManager(); return DrmSessionManager.DRM_UNSUPPORTED;
} }
MediaDrmCallback drmCallback = MediaDrmCallback drmCallback =
new HttpMediaDrmCallback(widevineLicenseUrl, new DefaultHttpDataSourceFactory()); new HttpMediaDrmCallback(widevineLicenseUrl, new DefaultHttpDataSourceFactory());

View File

@ -227,7 +227,7 @@ public abstract class ExoHostedTest implements AnalyticsListener, HostedTest {
protected DrmSessionManager buildDrmSessionManager() { protected DrmSessionManager buildDrmSessionManager() {
// Do nothing. Interested subclasses may override. // Do nothing. Interested subclasses may override.
return DrmSessionManager.getDummyDrmSessionManager(); return DrmSessionManager.DRM_UNSUPPORTED;
} }
protected DefaultTrackSelector buildTrackSelector(HostActivity host) { protected DefaultTrackSelector buildTrackSelector(HostActivity host) {

View File

@ -175,7 +175,7 @@ public class FakeAdaptiveMediaPeriod
/* callback= */ this, /* callback= */ this,
allocator, allocator,
positionUs, positionUs,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
new DefaultLoadErrorHandlingPolicy(/* minimumLoadableRetryCount= */ 3), new DefaultLoadErrorHandlingPolicy(/* minimumLoadableRetryCount= */ 3),
mediaSourceEventDispatcher); mediaSourceEventDispatcher);

View File

@ -42,7 +42,7 @@ public class FakeAdaptiveMediaSource extends FakeMediaSource {
FakeChunkSource.Factory chunkSourceFactory) { FakeChunkSource.Factory chunkSourceFactory) {
super( super(
timeline, timeline,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
/* trackDataFactory= */ (unusedFormat, unusedMediaPeriodId) -> { /* trackDataFactory= */ (unusedFormat, unusedMediaPeriodId) -> {
throw new RuntimeException("Unused TrackDataFactory"); throw new RuntimeException("Unused TrackDataFactory");
}, },

View File

@ -116,7 +116,7 @@ public class FakeMediaPeriod implements MediaPeriod {
allocator, allocator,
TrackDataFactory.singleSampleWithTimeUs(singleSampleTimeUs), TrackDataFactory.singleSampleWithTimeUs(singleSampleTimeUs),
mediaSourceEventDispatcher, mediaSourceEventDispatcher,
DrmSessionManager.DUMMY, DrmSessionManager.DRM_UNSUPPORTED,
new DrmSessionEventListener.EventDispatcher(), new DrmSessionEventListener.EventDispatcher(),
/* deferOnPrepared */ false); /* deferOnPrepared */ false);
} }

View File

@ -104,7 +104,7 @@ public class FakeMediaSource extends BaseMediaSource {
* can be manually set later using {@link #setNewSourceInfo(Timeline)}. * can be manually set later using {@link #setNewSourceInfo(Timeline)}.
*/ */
public FakeMediaSource(@Nullable Timeline timeline, Format... formats) { public FakeMediaSource(@Nullable Timeline timeline, Format... formats) {
this(timeline, DrmSessionManager.DUMMY, formats); this(timeline, DrmSessionManager.DRM_UNSUPPORTED, formats);
} }
/** /**