Relax DrmSessionManager-in-Renderer requirement for MediaSource-provided DRM
PiperOrigin-RevId: 254048233
This commit is contained in:
parent
2f8bd42b0e
commit
6838b0b29c
@ -499,13 +499,13 @@ public class LibvpxVideoRenderer extends BaseRenderer {
|
||||
: oldFormat.drmInitData);
|
||||
if (drmInitDataChanged) {
|
||||
if (format.drmInitData != null) {
|
||||
if (drmSessionManager == null) {
|
||||
throw ExoPlaybackException.createForRenderer(
|
||||
new IllegalStateException("Media requires a DrmSessionManager"), getIndex());
|
||||
}
|
||||
if (formatHolder.decryptionResourceIsProvided) {
|
||||
setSourceDrmSession((DrmSession<ExoMediaCrypto>) formatHolder.drmSession);
|
||||
} else {
|
||||
if (drmSessionManager == null) {
|
||||
throw ExoPlaybackException.createForRenderer(
|
||||
new IllegalStateException("Media requires a DrmSessionManager"), getIndex());
|
||||
}
|
||||
DrmSession<ExoMediaCrypto> session =
|
||||
drmSessionManager.acquireSession(Looper.myLooper(), newFormat.drmInitData);
|
||||
if (sourceDrmSession != null) {
|
||||
|
@ -664,13 +664,14 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements
|
||||
: oldFormat.drmInitData);
|
||||
if (drmInitDataChanged) {
|
||||
if (inputFormat.drmInitData != null) {
|
||||
if (drmSessionManager == null) {
|
||||
throw ExoPlaybackException.createForRenderer(
|
||||
new IllegalStateException("Media requires a DrmSessionManager"), getIndex());
|
||||
}
|
||||
|
||||
if (formatHolder.decryptionResourceIsProvided) {
|
||||
setSourceDrmSession((DrmSession<ExoMediaCrypto>) formatHolder.drmSession);
|
||||
} else {
|
||||
if (drmSessionManager == null) {
|
||||
throw ExoPlaybackException.createForRenderer(
|
||||
new IllegalStateException("Media requires a DrmSessionManager"), getIndex());
|
||||
}
|
||||
DrmSession<ExoMediaCrypto> session =
|
||||
drmSessionManager.acquireSession(Looper.myLooper(), newFormat.drmInitData);
|
||||
if (sourceDrmSession != null) {
|
||||
|
@ -1200,13 +1200,13 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
|
||||
!Util.areEqual(newFormat.drmInitData, oldFormat == null ? null : oldFormat.drmInitData);
|
||||
if (drmInitDataChanged) {
|
||||
if (newFormat.drmInitData != null) {
|
||||
if (drmSessionManager == null) {
|
||||
throw ExoPlaybackException.createForRenderer(
|
||||
new IllegalStateException("Media requires a DrmSessionManager"), getIndex());
|
||||
}
|
||||
if (formatHolder.decryptionResourceIsProvided) {
|
||||
setSourceDrmSession((DrmSession<FrameworkMediaCrypto>) formatHolder.drmSession);
|
||||
} else {
|
||||
if (drmSessionManager == null) {
|
||||
throw ExoPlaybackException.createForRenderer(
|
||||
new IllegalStateException("Media requires a DrmSessionManager"), getIndex());
|
||||
}
|
||||
DrmSession<FrameworkMediaCrypto> session =
|
||||
drmSessionManager.acquireSession(Looper.myLooper(), newFormat.drmInitData);
|
||||
if (sourceDrmSession != null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user