Added in API level 24

Pattern


class Pattern
kotlin.Any
   ↳ android.media.MediaCodec.CryptoInfo.Pattern

Metadata describing an encryption pattern for the protected bytes in a subsample. An encryption pattern consists of a repeating sequence of crypto blocks comprised of a number of encrypted blocks followed by a number of unencrypted, or skipped, blocks.

Summary

Public constructors
Pattern(blocksToEncrypt: Int, blocksToSkip: Int)

Construct a sample encryption pattern given the number of blocks to encrypt and skip in the pattern.

Public methods
Int

Return the number of blocks to encrypt in a sample encryption pattern.

Int

Return the number of blocks to skip in a sample encryption pattern.

Unit
set(blocksToEncrypt: Int, blocksToSkip: Int)

Set the number of blocks to encrypt and skip in a sample encryption pattern.

Public constructors

Pattern

Added in API level 24
Pattern(
    blocksToEncrypt: Int,
    blocksToSkip: Int)

Construct a sample encryption pattern given the number of blocks to encrypt and skip in the pattern. If both parameters are zero, pattern encryption is inoperative.

Public methods

getEncryptBlocks

Added in API level 24
fun getEncryptBlocks(): Int

Return the number of blocks to encrypt in a sample encryption pattern.

getSkipBlocks

Added in API level 24
fun getSkipBlocks(): Int

Return the number of blocks to skip in a sample encryption pattern.

set

Added in API level 24
fun set(
    blocksToEncrypt: Int,
    blocksToSkip: Int
): Unit

Set the number of blocks to encrypt and skip in a sample encryption pattern. If both parameters are zero, pattern encryption is inoperative.