PsshAtomUtil
@UnstableApi
class PsshAtomUtil
Utility methods for handling PSSH atoms.
Summary
Nested types |
|---|
class PsshAtomUtil.PsshAtomA class representing the mp4 PSSH Atom as specified in ISO/IEC 23001-7. |
Public functions |
|
|---|---|
java-static Array<Byte>! |
buildPsshAtom(systemId: UUID!, data: ByteArray<Byte>?)Builds a version 0 PSSH atom for a given system id, containing the given data. |
java-static Array<Byte>! |
Builds a PSSH atom for the given system id, containing the given key ids and data. |
java-static Boolean |
isPsshAtom(data: ByteArray<Byte>!)Returns whether the data is a valid PSSH atom. |
java-static PsshAtomUtil.PsshAtom? |
parsePsshAtom(atom: ByteArray<Byte>!)Parses a PSSH atom. |
java-static Array<Byte>? |
parseSchemeSpecificData(atom: ByteArray<Byte>!, uuid: UUID!)Parses the scheme specific data from a PSSH atom. |
java-static UUID? |
Parses the UUID from a PSSH atom. |
java-static Int |
parseVersion(atom: ByteArray<Byte>!)Parses the version from a PSSH atom. |
Public functions
buildPsshAtom
java-static fun buildPsshAtom(systemId: UUID!, data: ByteArray<Byte>?): Array<Byte>!
Builds a version 0 PSSH atom for a given system id, containing the given data.
buildPsshAtom
java-static fun buildPsshAtom(systemId: UUID!, keyIds: Array<UUID!>?, data: ByteArray<Byte>?): Array<Byte>!
Builds a PSSH atom for the given system id, containing the given key ids and data.
isPsshAtom
java-static fun isPsshAtom(data: ByteArray<Byte>!): Boolean
Returns whether the data is a valid PSSH atom.
| Returns | |
|---|---|
Boolean |
Whether the data is a valid PSSH atom. |
parsePsshAtom
java-static fun parsePsshAtom(atom: ByteArray<Byte>!): PsshAtomUtil.PsshAtom?
Parses a PSSH atom. Version 0 and 1 PSSH atoms are supported.
| Returns | |
|---|---|
PsshAtomUtil.PsshAtom? |
The parsed PSSH atom. Null if the input is not a valid PSSH atom, or if the PSSH atom has an unsupported version. |
parseSchemeSpecificData
java-static fun parseSchemeSpecificData(atom: ByteArray<Byte>!, uuid: UUID!): Array<Byte>?
Parses the scheme specific data from a PSSH atom. Version 0 and 1 PSSH atoms are supported.
The scheme specific data is only parsed if the data is a valid PSSH atom matching the given UUID, or if the data is a valid PSSH atom of any type in the case that the passed UUID is null.
parseUuid
java-static fun parseUuid(atom: ByteArray<Byte>!): UUID?
Parses the UUID from a PSSH atom. Version 0 and 1 PSSH atoms are supported.
The UUID is only parsed if the data is a valid PSSH atom.
| Returns | |
|---|---|
UUID? |
The parsed UUID. Null if the input is not a valid PSSH atom, or if the PSSH atom has an unsupported version. |
parseVersion
java-static fun parseVersion(atom: ByteArray<Byte>!): Int
Parses the version from a PSSH atom. Version 0 and 1 PSSH atoms are supported.
The version is only parsed if the data is a valid PSSH atom.
| Returns | |
|---|---|
Int |
The parsed version. -1 if the input is not a valid PSSH atom, or if the PSSH atom has an unsupported version. |