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);
|
: oldFormat.drmInitData);
|
||||||
if (drmInitDataChanged) {
|
if (drmInitDataChanged) {
|
||||||
if (format.drmInitData != null) {
|
if (format.drmInitData != null) {
|
||||||
|
if (formatHolder.decryptionResourceIsProvided) {
|
||||||
|
setSourceDrmSession((DrmSession<ExoMediaCrypto>) formatHolder.drmSession);
|
||||||
|
} else {
|
||||||
if (drmSessionManager == null) {
|
if (drmSessionManager == null) {
|
||||||
throw ExoPlaybackException.createForRenderer(
|
throw ExoPlaybackException.createForRenderer(
|
||||||
new IllegalStateException("Media requires a DrmSessionManager"), getIndex());
|
new IllegalStateException("Media requires a DrmSessionManager"), getIndex());
|
||||||
}
|
}
|
||||||
if (formatHolder.decryptionResourceIsProvided) {
|
|
||||||
setSourceDrmSession((DrmSession<ExoMediaCrypto>) formatHolder.drmSession);
|
|
||||||
} else {
|
|
||||||
DrmSession<ExoMediaCrypto> session =
|
DrmSession<ExoMediaCrypto> session =
|
||||||
drmSessionManager.acquireSession(Looper.myLooper(), newFormat.drmInitData);
|
drmSessionManager.acquireSession(Looper.myLooper(), newFormat.drmInitData);
|
||||||
if (sourceDrmSession != null) {
|
if (sourceDrmSession != null) {
|
||||||
|
@ -664,13 +664,14 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements
|
|||||||
: oldFormat.drmInitData);
|
: oldFormat.drmInitData);
|
||||||
if (drmInitDataChanged) {
|
if (drmInitDataChanged) {
|
||||||
if (inputFormat.drmInitData != null) {
|
if (inputFormat.drmInitData != null) {
|
||||||
|
|
||||||
|
if (formatHolder.decryptionResourceIsProvided) {
|
||||||
|
setSourceDrmSession((DrmSession<ExoMediaCrypto>) formatHolder.drmSession);
|
||||||
|
} else {
|
||||||
if (drmSessionManager == null) {
|
if (drmSessionManager == null) {
|
||||||
throw ExoPlaybackException.createForRenderer(
|
throw ExoPlaybackException.createForRenderer(
|
||||||
new IllegalStateException("Media requires a DrmSessionManager"), getIndex());
|
new IllegalStateException("Media requires a DrmSessionManager"), getIndex());
|
||||||
}
|
}
|
||||||
if (formatHolder.decryptionResourceIsProvided) {
|
|
||||||
setSourceDrmSession((DrmSession<ExoMediaCrypto>) formatHolder.drmSession);
|
|
||||||
} else {
|
|
||||||
DrmSession<ExoMediaCrypto> session =
|
DrmSession<ExoMediaCrypto> session =
|
||||||
drmSessionManager.acquireSession(Looper.myLooper(), newFormat.drmInitData);
|
drmSessionManager.acquireSession(Looper.myLooper(), newFormat.drmInitData);
|
||||||
if (sourceDrmSession != null) {
|
if (sourceDrmSession != null) {
|
||||||
|
@ -1200,13 +1200,13 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
|
|||||||
!Util.areEqual(newFormat.drmInitData, oldFormat == null ? null : oldFormat.drmInitData);
|
!Util.areEqual(newFormat.drmInitData, oldFormat == null ? null : oldFormat.drmInitData);
|
||||||
if (drmInitDataChanged) {
|
if (drmInitDataChanged) {
|
||||||
if (newFormat.drmInitData != null) {
|
if (newFormat.drmInitData != null) {
|
||||||
|
if (formatHolder.decryptionResourceIsProvided) {
|
||||||
|
setSourceDrmSession((DrmSession<FrameworkMediaCrypto>) formatHolder.drmSession);
|
||||||
|
} else {
|
||||||
if (drmSessionManager == null) {
|
if (drmSessionManager == null) {
|
||||||
throw ExoPlaybackException.createForRenderer(
|
throw ExoPlaybackException.createForRenderer(
|
||||||
new IllegalStateException("Media requires a DrmSessionManager"), getIndex());
|
new IllegalStateException("Media requires a DrmSessionManager"), getIndex());
|
||||||
}
|
}
|
||||||
if (formatHolder.decryptionResourceIsProvided) {
|
|
||||||
setSourceDrmSession((DrmSession<FrameworkMediaCrypto>) formatHolder.drmSession);
|
|
||||||
} else {
|
|
||||||
DrmSession<FrameworkMediaCrypto> session =
|
DrmSession<FrameworkMediaCrypto> session =
|
||||||
drmSessionManager.acquireSession(Looper.myLooper(), newFormat.drmInitData);
|
drmSessionManager.acquireSession(Looper.myLooper(), newFormat.drmInitData);
|
||||||
if (sourceDrmSession != null) {
|
if (sourceDrmSession != null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user