Remove Renderer references to Format.drmInitData

PiperOrigin-RevId: 323392470
This commit is contained in:
aquilescanta 2020-07-27 18:43:47 +01:00 committed by Oliver Woodman
parent 51e65ff55a
commit 684994fe61
12 changed files with 12 additions and 12 deletions

View file

@ -126,7 +126,7 @@ public class Libgav1VideoRenderer extends DecoderVideoRenderer {
|| !Gav1Library.isAvailable()) {
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_HANDLED, ADAPTIVE_SEAMLESS, TUNNELING_NOT_SUPPORTED);

View file

@ -103,7 +103,7 @@ public final class FfmpegAudioRenderer extends DecoderAudioRenderer {
|| (!sinkSupportsFormat(format, C.ENCODING_PCM_16BIT)
&& !sinkSupportsFormat(format, C.ENCODING_PCM_FLOAT))) {
return FORMAT_UNSUPPORTED_SUBTYPE;
} else if (format.drmInitData != null && format.exoMediaCryptoType == null) {
} else if (format.exoMediaCryptoType != null) {
return FORMAT_UNSUPPORTED_DRM;
} else {
return FORMAT_HANDLED;

View file

@ -76,7 +76,7 @@ public final class FfmpegVideoRenderer extends DecoderVideoRenderer {
return FORMAT_UNSUPPORTED_TYPE;
} else if (!FfmpegLibrary.supportsFormat(format.sampleMimeType)) {
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);
} else {
return RendererCapabilities.create(

View file

@ -107,7 +107,7 @@ public final class LibflacAudioRenderer extends DecoderAudioRenderer {
}
if (!sinkSupportsFormat(outputFormat)) {
return FORMAT_UNSUPPORTED_SUBTYPE;
} else if (format.drmInitData != null && format.exoMediaCryptoType == null) {
} else if (format.exoMediaCryptoType != null) {
return FORMAT_UNSUPPORTED_DRM;
} else {
return FORMAT_HANDLED;

View file

@ -83,7 +83,7 @@ public class LibopusAudioRenderer extends DecoderAudioRenderer {
@FormatSupport
protected int supportsFormatInternal(Format format) {
boolean drmIsSupported =
format.drmInitData == null
format.exoMediaCryptoType == null
|| OpusLibrary.matchesExpectedExoMediaCryptoType(format.exoMediaCryptoType);
if (!OpusLibrary.isAvailable()
|| !MimeTypes.AUDIO_OPUS.equalsIgnoreCase(format.sampleMimeType)) {

View file

@ -68,7 +68,7 @@ public final class OpusLibrary {
* protected content.
*/
public static boolean matchesExpectedExoMediaCryptoType(
@Nullable Class<? extends ExoMediaCrypto> exoMediaCryptoType) {
Class<? extends ExoMediaCrypto> exoMediaCryptoType) {
return Util.areEqual(OpusLibrary.exoMediaCryptoType, exoMediaCryptoType);
}

View file

@ -128,7 +128,7 @@ public class LibvpxVideoRenderer extends DecoderVideoRenderer {
return RendererCapabilities.create(FORMAT_UNSUPPORTED_TYPE);
}
boolean drmIsSupported =
format.drmInitData == null
format.exoMediaCryptoType == null
|| VpxLibrary.matchesExpectedExoMediaCryptoType(format.exoMediaCryptoType);
if (!drmIsSupported) {
return RendererCapabilities.create(FORMAT_UNSUPPORTED_DRM);

View file

@ -87,7 +87,7 @@ public final class VpxLibrary {
* protected content.
*/
public static boolean matchesExpectedExoMediaCryptoType(
@Nullable Class<? extends ExoMediaCrypto> exoMediaCryptoType) {
Class<? extends ExoMediaCrypto> exoMediaCryptoType) {
return Util.areEqual(VpxLibrary.exoMediaCryptoType, exoMediaCryptoType);
}

View file

@ -213,7 +213,7 @@ public class MediaCodecAudioRenderer extends MediaCodecRenderer implements Media
}
@TunnelingSupport
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);
// 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.

View file

@ -1972,7 +1972,7 @@ public abstract class MediaCodecRenderer extends BaseRenderer {
/** Returns whether this renderer supports the given {@link Format Format's} DRM scheme. */
protected static boolean supportsFormatDrm(Format format) {
return format.drmInitData == null
return format.exoMediaCryptoType == null
|| FrameworkMediaCrypto.class.equals(format.exoMediaCryptoType);
}

View file

@ -103,7 +103,7 @@ public final class MetadataRenderer extends BaseRenderer implements Callback {
public int supportsFormat(Format format) {
if (decoderFactory.supportsFormat(format)) {
return RendererCapabilities.create(
format.drmInitData == null ? FORMAT_HANDLED : FORMAT_UNSUPPORTED_DRM);
format.exoMediaCryptoType == null ? FORMAT_HANDLED : FORMAT_UNSUPPORTED_DRM);
} else {
return RendererCapabilities.create(FORMAT_UNSUPPORTED_TYPE);
}

View file

@ -133,7 +133,7 @@ public final class TextRenderer extends BaseRenderer implements Callback {
public int supportsFormat(Format format) {
if (decoderFactory.supportsFormat(format)) {
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)) {
return RendererCapabilities.create(FORMAT_UNSUPPORTED_SUBTYPE);
} else {