Skip to content

Most visited

Recently visited

navigation
Added in API level 16

MediaCodec.CryptoInfo

public static final class MediaCodec.CryptoInfo
extends Object

java.lang.Object
   ↳ android.media.MediaCodec.CryptoInfo


Metadata describing the structure of a (at least partially) encrypted input sample. A buffer's data is considered to be partitioned into "subSamples", each subSample starts with a (potentially empty) run of plain, unencrypted bytes followed by a (also potentially empty) run of encrypted bytes. numBytesOfClearData can be null to indicate that all data is encrypted. This information encapsulates per-sample metadata as outlined in ISO/IEC FDIS 23001-7:2011 "Common encryption in ISO base media file format files".

Summary

Fields

public byte[] iv

A 16-byte initialization vector

public byte[] key

A 16-byte opaque key

public int mode

The type of encryption that has been applied, see CRYPTO_MODE_UNENCRYPTED and CRYPTO_MODE_AES_CTR.

public int[] numBytesOfClearData

The number of leading unencrypted bytes in each subSample.

public int[] numBytesOfEncryptedData

The number of trailing encrypted bytes in each subSample.

public int numSubSamples

The number of subSamples that make up the buffer's contents.

Public constructors

MediaCodec.CryptoInfo()

Public methods

void set(int newNumSubSamples, int[] newNumBytesOfClearData, int[] newNumBytesOfEncryptedData, byte[] newKey, byte[] newIV, int newMode)
String toString()

Returns a string containing a concise, human-readable description of this object.

Inherited methods

From class java.lang.Object

Fields

iv

Added in API level 16
byte[] iv

A 16-byte initialization vector

key

Added in API level 16
byte[] key

A 16-byte opaque key

mode

Added in API level 16
int mode

The type of encryption that has been applied, see CRYPTO_MODE_UNENCRYPTED and CRYPTO_MODE_AES_CTR.

numBytesOfClearData

Added in API level 16
int[] numBytesOfClearData

The number of leading unencrypted bytes in each subSample.

numBytesOfEncryptedData

Added in API level 16
int[] numBytesOfEncryptedData

The number of trailing encrypted bytes in each subSample.

numSubSamples

Added in API level 16
int numSubSamples

The number of subSamples that make up the buffer's contents.

Public constructors

MediaCodec.CryptoInfo

Added in API level 16
MediaCodec.CryptoInfo ()

Public methods

set

Added in API level 16
void set (int newNumSubSamples, 
                int[] newNumBytesOfClearData, 
                int[] newNumBytesOfEncryptedData, 
                byte[] newKey, 
                byte[] newIV, 
                int newMode)

Parameters
newNumSubSamples int
newNumBytesOfClearData int
newNumBytesOfEncryptedData int
newKey byte
newIV byte
newMode int

toString

Added in API level 16
String toString ()

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:

   getClass().getName() + '@' + Integer.toHexString(hashCode())

See Writing a useful toString method if you intend implementing your own toString method.

Returns
String a printable representation of this object.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.