Commit acad64ca by aquilescanta Committed by Oliver Woodman

Rename FormatHolder.decryptionResourceIsProvided to FormatHolder.includesDrmSession

PiperOrigin-RevId: 254187403
parent ae969397
...@@ -499,7 +499,7 @@ public class LibvpxVideoRenderer extends BaseRenderer { ...@@ -499,7 +499,7 @@ public class LibvpxVideoRenderer extends BaseRenderer {
: oldFormat.drmInitData); : oldFormat.drmInitData);
if (drmInitDataChanged) { if (drmInitDataChanged) {
if (format.drmInitData != null) { if (format.drmInitData != null) {
if (formatHolder.decryptionResourceIsProvided) { if (formatHolder.includesDrmSession) {
setSourceDrmSession((DrmSession<ExoMediaCrypto>) formatHolder.drmSession); setSourceDrmSession((DrmSession<ExoMediaCrypto>) formatHolder.drmSession);
} else { } else {
if (drmSessionManager == null) { if (drmSessionManager == null) {
......
...@@ -23,13 +23,10 @@ import com.google.android.exoplayer2.drm.DrmSession; ...@@ -23,13 +23,10 @@ import com.google.android.exoplayer2.drm.DrmSession;
*/ */
public final class FormatHolder { public final class FormatHolder {
/** /** Whether the {@link #format} setter also sets the {@link #drmSession} field. */
* Whether the object expected to populate {@link #format} is also expected to populate {@link
* #drmSession}.
*/
// TODO: Remove once all Renderers and MediaSources have migrated to the new DRM model [Internal // TODO: Remove once all Renderers and MediaSources have migrated to the new DRM model [Internal
// ref: b/129764794]. // ref: b/129764794].
public boolean decryptionResourceIsProvided; public boolean includesDrmSession;
/** An accompanying context for decrypting samples in the format. */ /** An accompanying context for decrypting samples in the format. */
@Nullable public DrmSession<?> drmSession; @Nullable public DrmSession<?> drmSession;
......
...@@ -665,7 +665,7 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements ...@@ -665,7 +665,7 @@ public abstract class SimpleDecoderAudioRenderer extends BaseRenderer implements
if (drmInitDataChanged) { if (drmInitDataChanged) {
if (inputFormat.drmInitData != null) { if (inputFormat.drmInitData != null) {
if (formatHolder.decryptionResourceIsProvided) { if (formatHolder.includesDrmSession) {
setSourceDrmSession((DrmSession<ExoMediaCrypto>) formatHolder.drmSession); setSourceDrmSession((DrmSession<ExoMediaCrypto>) formatHolder.drmSession);
} else { } else {
if (drmSessionManager == null) { if (drmSessionManager == null) {
......
...@@ -1200,7 +1200,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer { ...@@ -1200,7 +1200,7 @@ 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) { if (formatHolder.includesDrmSession) {
setSourceDrmSession((DrmSession<FrameworkMediaCrypto>) formatHolder.drmSession); setSourceDrmSession((DrmSession<FrameworkMediaCrypto>) formatHolder.drmSession);
} else { } else {
if (drmSessionManager == null) { if (drmSessionManager == null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment