mirror of
https://github.com/samsonjs/media.git
synced 2026-04-07 11:35:46 +00:00
Remove Renderer references to Format.drmInitData
PiperOrigin-RevId: 323392470
This commit is contained in:
parent
51e65ff55a
commit
684994fe61
12 changed files with 12 additions and 12 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in a new issue