Class CryptoInfo
- java.lang.Object
-
- com.google.android.exoplayer2.decoder.CryptoInfo
-
@Deprecated public final class CryptoInfo extends Object
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.Metadata describing the structure of an encrypted input sample.This class is a compatibility wrapper for
MediaCodec.CryptoInfo.
-
-
Field Summary
Fields Modifier and Type Field Description intclearBlocksDeprecated.intencryptedBlocksDeprecated.byte[]ivDeprecated.The 16 byte initialization vector.byte[]keyDeprecated.The 16 byte key id.@com.google.android.exoplayer2.C.CryptoMode intmodeDeprecated.The type of encryption that has been applied.int[]numBytesOfClearDataDeprecated.The number of leading unencrypted bytes in each sub-sample.int[]numBytesOfEncryptedDataDeprecated.The number of trailing encrypted bytes in each sub-sample.intnumSubSamplesDeprecated.The number of subSamples that make up the buffer's contents.
-
Constructor Summary
Constructors Constructor Description CryptoInfo()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MediaCodec.CryptoInfogetFrameworkCryptoInfo()Deprecated.Returns an equivalentMediaCodec.CryptoInfoinstance.voidincreaseClearDataFirstSubSampleBy(int count)Deprecated.Increases the number of clear data for the first sub sample bycount.voidset(int numSubSamples, int[] numBytesOfClearData, int[] numBytesOfEncryptedData, byte[] key, byte[] iv, @com.google.android.exoplayer2.C.CryptoMode int mode, int encryptedBlocks, int clearBlocks)Deprecated.
-
-
-
Field Detail
-
iv
@Nullable public byte[] iv
Deprecated.The 16 byte initialization vector. If the initialization vector of the content is shorter than 16 bytes, 0 byte padding is appended to extend the vector to the required 16 byte length.- See Also:
MediaCodec.CryptoInfo.iv
-
key
@Nullable public byte[] key
Deprecated.The 16 byte key id.- See Also:
MediaCodec.CryptoInfo.key
-
mode
public @com.google.android.exoplayer2.C.CryptoMode int mode
Deprecated.The type of encryption that has been applied. Must be one of theC.CryptoModevalues.- See Also:
MediaCodec.CryptoInfo.mode
-
numBytesOfClearData
@Nullable public int[] numBytesOfClearData
Deprecated.The number of leading unencrypted bytes in each sub-sample. If null, all bytes are treated as encrypted andnumBytesOfEncryptedDatamust be specified.
-
numBytesOfEncryptedData
@Nullable public int[] numBytesOfEncryptedData
Deprecated.The number of trailing encrypted bytes in each sub-sample. If null, all bytes are treated as clear andnumBytesOfClearDatamust be specified.
-
numSubSamples
public int numSubSamples
Deprecated.The number of subSamples that make up the buffer's contents.- See Also:
MediaCodec.CryptoInfo.numSubSamples
-
encryptedBlocks
public int encryptedBlocks
Deprecated.- See Also:
MediaCodec.CryptoInfo.Pattern
-
clearBlocks
public int clearBlocks
Deprecated.- See Also:
MediaCodec.CryptoInfo.Pattern
-
-
Method Detail
-
set
public void set(int numSubSamples, int[] numBytesOfClearData, int[] numBytesOfEncryptedData, byte[] key, byte[] iv, @com.google.android.exoplayer2.C.CryptoMode int mode, int encryptedBlocks, int clearBlocks)Deprecated.
-
getFrameworkCryptoInfo
public MediaCodec.CryptoInfo getFrameworkCryptoInfo()
Deprecated.Returns an equivalentMediaCodec.CryptoInfoinstance.Successive calls to this method on a single
CryptoInfowill return the same instance. Changes to theCryptoInfowill be reflected in the returned object. The return object should not be modified directly.- Returns:
- The equivalent
MediaCodec.CryptoInfoinstance.
-
increaseClearDataFirstSubSampleBy
public void increaseClearDataFirstSubSampleBy(int count)
Deprecated.Increases the number of clear data for the first sub sample bycount.If
countis 0, this method is a no-op. Otherwise, it addscounttonumBytesOfClearData[0].If
numBytesOfClearDatais null (which is permitted), this method will instantiate it to a newint[1].- Parameters:
count- The number of bytes to be added to the first subSample ofnumBytesOfClearData.
-
-