TrackEncryptionBox


@UnstableApi
public final class TrackEncryptionBox


Encapsulates information parsed from a track encryption (tenc) box or sample group description (sgpd) box in an MP4 stream.

Summary

Public fields

final TrackOutput.CryptoData

A TrackOutput.CryptoData instance containing the encryption information from this TrackEncryptionBox.

final @Nullable byte[]

If perSampleIvSize is 0, holds the default initialization vector as defined in the track encryption box or sample group description box.

final boolean

Indicates the encryption state of the samples in the sample group.

final int

The initialization vector size in bytes for the samples in the corresponding sample group.

final @Nullable String

The protection scheme type, as defined by the 'schm' box, or null if unknown.

Public constructors

TrackEncryptionBox(
    boolean isEncrypted,
    @Nullable String schemeType,
    int perSampleIvSize,
    byte[] keyId,
    int defaultEncryptedBlocks,
    int defaultClearBlocks,
    @Nullable byte[] defaultInitializationVector
)

Public fields

cryptoData

public final TrackOutput.CryptoData cryptoData

A TrackOutput.CryptoData instance containing the encryption information from this TrackEncryptionBox.

defaultInitializationVector

public final @Nullable byte[] defaultInitializationVector

If perSampleIvSize is 0, holds the default initialization vector as defined in the track encryption box or sample group description box. Null otherwise.

isEncrypted

public final boolean isEncrypted

Indicates the encryption state of the samples in the sample group.

perSampleIvSize

public final int perSampleIvSize

The initialization vector size in bytes for the samples in the corresponding sample group.

schemeType

public final @Nullable String schemeType

The protection scheme type, as defined by the 'schm' box, or null if unknown.

Public constructors

TrackEncryptionBox

public TrackEncryptionBox(
    boolean isEncrypted,
    @Nullable String schemeType,
    int perSampleIvSize,
    byte[] keyId,
    int defaultEncryptedBlocks,
    int defaultClearBlocks,
    @Nullable byte[] defaultInitializationVector
)
Parameters
boolean isEncrypted

See isEncrypted.

@Nullable String schemeType

See schemeType.

int perSampleIvSize

See perSampleIvSize.

byte[] keyId

See encryptionKey.

int defaultEncryptedBlocks

See encryptedBlocks.

int defaultClearBlocks

See clearBlocks.

@Nullable byte[] defaultInitializationVector

See defaultInitializationVector.