Commit 684994fe by aquilescanta Committed by Oliver Woodman

Remove Renderer references to Format.drmInitData

PiperOrigin-RevId: 323392470
parent 51e65ff5
...@@ -126,7 +126,7 @@ public class Libgav1VideoRenderer extends DecoderVideoRenderer { ...@@ -126,7 +126,7 @@ public class Libgav1VideoRenderer extends DecoderVideoRenderer {
|| !Gav1Library.isAvailable()) { || !Gav1Library.isAvailable()) {
return RendererCapabilities.create(FORMAT_UNSUPPORTED_TYPE); return RendererCapabilities.create(FORMAT_UNSUPPORTED_TYPE);
} }
if (format.drmInitData != null && format.exoMediaCryptoType == null) { if (format.exoMediaCryptoType != null) {
return RendererCapabilities.create(FORMAT_UNSUPPORTED_DRM); return RendererCapabilities.create(FORMAT_UNSUPPORTED_DRM);
} }
return RendererCapabilities.create(FORMAT_HANDLED, ADAPTIVE_SEAMLESS, TUNNELING_NOT_SUPPORTED); return RendererCapabilities.create(FORMAT_HANDLED, ADAPTIVE_SEAMLESS, TUNNELING_NOT_SUPPORTED);
......
...@@ -103,7 +103,7 @@ public final class FfmpegAudioRenderer extends DecoderAudioRenderer { ...@@ -103,7 +103,7 @@ public final class FfmpegAudioRenderer extends DecoderAudioRenderer {
|| (!sinkSupportsFormat(format, C.ENCODING_PCM_16BIT) || (!sinkSupportsFormat(format, C.ENCODING_PCM_16BIT)
&& !sinkSupportsFormat(format, C.ENCODING_PCM_FLOAT))) { && !sinkSupportsFormat(format, C.ENCODING_PCM_FLOAT))) {
return FORMAT_UNSUPPORTED_SUBTYPE; return FORMAT_UNSUPPORTED_SUBTYPE;
} else if (format.drmInitData != null && format.exoMediaCryptoType == null) { } else if (format.exoMediaCryptoType != null) {
return FORMAT_UNSUPPORTED_DRM; return FORMAT_UNSUPPORTED_DRM;
} else { } else {
return FORMAT_HANDLED; return FORMAT_HANDLED;
......
...@@ -76,7 +76,7 @@ public final class FfmpegVideoRenderer extends DecoderVideoRenderer { ...@@ -76,7 +76,7 @@ public final class FfmpegVideoRenderer extends DecoderVideoRenderer {
return FORMAT_UNSUPPORTED_TYPE; return FORMAT_UNSUPPORTED_TYPE;
} else if (!FfmpegLibrary.supportsFormat(format.sampleMimeType)) { } else if (!FfmpegLibrary.supportsFormat(format.sampleMimeType)) {
return RendererCapabilities.create(FORMAT_UNSUPPORTED_SUBTYPE); return RendererCapabilities.create(FORMAT_UNSUPPORTED_SUBTYPE);
} else if (format.drmInitData != null && format.exoMediaCryptoType == null) { } else if (format.exoMediaCryptoType != null) {
return RendererCapabilities.create(FORMAT_UNSUPPORTED_DRM); return RendererCapabilities.create(FORMAT_UNSUPPORTED_DRM);
} else { } else {
return RendererCapabilities.create( return RendererCapabilities.create(
......
...@@ -107,7 +107,7 @@ public final class LibflacAudioRenderer extends DecoderAudioRenderer { ...@@ -107,7 +107,7 @@ public final class LibflacAudioRenderer extends DecoderAudioRenderer {
} }
if (!sinkSupportsFormat(outputFormat)) { if (!sinkSupportsFormat(outputFormat)) {
return FORMAT_UNSUPPORTED_SUBTYPE; return FORMAT_UNSUPPORTED_SUBTYPE;
} else if (format.drmInitData != null && format.exoMediaCryptoType == null) { } else if (format.exoMediaCryptoType != null) {
return FORMAT_UNSUPPORTED_DRM; return FORMAT_UNSUPPORTED_DRM;
} else { } else {
return FORMAT_HANDLED; return FORMAT_HANDLED;
......
...@@ -83,7 +83,7 @@ public class LibopusAudioRenderer extends DecoderAudioRenderer { ...@@ -83,7 +83,7 @@ public class LibopusAudioRenderer extends DecoderAudioRenderer {
@FormatSupport @FormatSupport
protected int supportsFormatInternal(Format format) { protected int supportsFormatInternal(Format format) {
boolean drmIsSupported = boolean drmIsSupported =
format.drmInitData == null format.exoMediaCryptoType == null
|| OpusLibrary.matchesExpectedExoMediaCryptoType(format.exoMediaCryptoType); || OpusLibrary.matchesExpectedExoMediaCryptoType(format.exoMediaCryptoType);
if (!OpusLibrary.isAvailable() if (!OpusLibrary.isAvailable()
|| !MimeTypes.AUDIO_OPUS.equalsIgnoreCase(format.sampleMimeType)) { || !MimeTypes.AUDIO_OPUS.equalsIgnoreCase(format.sampleMimeType)) {
......
...@@ -68,7 +68,7 @@ public final class OpusLibrary { ...@@ -68,7 +68,7 @@ public final class OpusLibrary {
* protected content. * protected content.
*/ */
public static boolean matchesExpectedExoMediaCryptoType( public static boolean matchesExpectedExoMediaCryptoType(
@Nullable Class<? extends ExoMediaCrypto> exoMediaCryptoType) { Class<? extends ExoMediaCrypto> exoMediaCryptoType) {
return Util.areEqual(OpusLibrary.exoMediaCryptoType, exoMediaCryptoType); return Util.areEqual(OpusLibrary.exoMediaCryptoType, exoMediaCryptoType);
} }
......
...@@ -128,7 +128,7 @@ public class LibvpxVideoRenderer extends DecoderVideoRenderer { ...@@ -128,7 +128,7 @@ public class LibvpxVideoRenderer extends DecoderVideoRenderer {
return RendererCapabilities.create(FORMAT_UNSUPPORTED_TYPE); return RendererCapabilities.create(FORMAT_UNSUPPORTED_TYPE);
} }
boolean drmIsSupported = boolean drmIsSupported =
format.drmInitData == null format.exoMediaCryptoType == null
|| VpxLibrary.matchesExpectedExoMediaCryptoType(format.exoMediaCryptoType); || VpxLibrary.matchesExpectedExoMediaCryptoType(format.exoMediaCryptoType);
if (!drmIsSupported) { if (!drmIsSupported) {
return RendererCapabilities.create(FORMAT_UNSUPPORTED_DRM); return RendererCapabilities.create(FORMAT_UNSUPPORTED_DRM);
......
...@@ -87,7 +87,7 @@ public final class VpxLibrary { ...@@ -87,7 +87,7 @@ public final class VpxLibrary {
* protected content. * protected content.
*/ */
public static boolean matchesExpectedExoMediaCryptoType( public static boolean matchesExpectedExoMediaCryptoType(
@Nullable Class<? extends ExoMediaCrypto> exoMediaCryptoType) { Class<? extends ExoMediaCrypto> exoMediaCryptoType) {
return Util.areEqual(VpxLibrary.exoMediaCryptoType, exoMediaCryptoType); return Util.areEqual(VpxLibrary.exoMediaCryptoType, exoMediaCryptoType);
} }
......
...@@ -213,7 +213,7 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media ...@@ -213,7 +213,7 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
} }
@TunnelingSupport @TunnelingSupport
int tunnelingSupport = Util.SDK_INT >= 21 ? TUNNELING_SUPPORTED : TUNNELING_NOT_SUPPORTED; int tunnelingSupport = Util.SDK_INT >= 21 ? TUNNELING_SUPPORTED : TUNNELING_NOT_SUPPORTED;
boolean formatHasDrm = format.drmInitData != null || format.exoMediaCryptoType != null; boolean formatHasDrm = format.exoMediaCryptoType != null;
boolean supportsFormatDrm = supportsFormatDrm(format); boolean supportsFormatDrm = supportsFormatDrm(format);
// In passthrough mode, if the format needs decryption then we need to use a passthrough // In passthrough mode, if the format needs decryption then we need to use a passthrough
// decoder. Else we don't don't need a decoder at all. // decoder. Else we don't don't need a decoder at all.
......
...@@ -1972,7 +1972,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer { ...@@ -1972,7 +1972,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
/** Returns whether this renderer supports the given {@link Format Format's} DRM scheme. */ /** Returns whether this renderer supports the given {@link Format Format's} DRM scheme. */
protected static boolean supportsFormatDrm(Format format) { protected static boolean supportsFormatDrm(Format format) {
return format.drmInitData == null return format.exoMediaCryptoType == null
|| FrameworkMediaCrypto.class.equals(format.exoMediaCryptoType); || FrameworkMediaCrypto.class.equals(format.exoMediaCryptoType);
} }
......
...@@ -103,7 +103,7 @@ public final class MetadataRenderer extends BaseRenderer implements Callback { ...@@ -103,7 +103,7 @@ public final class MetadataRenderer extends BaseRenderer implements Callback {
public int supportsFormat(Format format) { public int supportsFormat(Format format) {
if (decoderFactory.supportsFormat(format)) { if (decoderFactory.supportsFormat(format)) {
return RendererCapabilities.create( return RendererCapabilities.create(
format.drmInitData == null ? FORMAT_HANDLED : FORMAT_UNSUPPORTED_DRM); format.exoMediaCryptoType == null ? FORMAT_HANDLED : FORMAT_UNSUPPORTED_DRM);
} else { } else {
return RendererCapabilities.create(FORMAT_UNSUPPORTED_TYPE); return RendererCapabilities.create(FORMAT_UNSUPPORTED_TYPE);
} }
......
...@@ -133,7 +133,7 @@ public final class TextRenderer extends BaseRenderer implements Callback { ...@@ -133,7 +133,7 @@ public final class TextRenderer extends BaseRenderer implements Callback {
public int supportsFormat(Format format) { public int supportsFormat(Format format) {
if (decoderFactory.supportsFormat(format)) { if (decoderFactory.supportsFormat(format)) {
return RendererCapabilities.create( return RendererCapabilities.create(
format.drmInitData == null ? FORMAT_HANDLED : FORMAT_UNSUPPORTED_DRM); format.exoMediaCryptoType == null ? FORMAT_HANDLED : FORMAT_UNSUPPORTED_DRM);
} else if (MimeTypes.isText(format.sampleMimeType)) { } else if (MimeTypes.isText(format.sampleMimeType)) {
return RendererCapabilities.create(FORMAT_UNSUPPORTED_SUBTYPE); return RendererCapabilities.create(FORMAT_UNSUPPORTED_SUBTYPE);
} else { } else {
......
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