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 ByteArray<Byte>! |
buildPsshAtom(systemId: UUID!, data: ByteArray?)Builds a version 0 PSSH atom for a given system id, containing the given data. |
java-static ByteArray<Byte>! |
buildPsshAtom(systemId: UUID!, keyIds: Array<UUID!>?, data: ByteArray?)Builds a PSSH atom for the given system id, containing the given key ids and data. |
java-static Boolean |
isPsshAtom(data: ByteArray!)Returns whether the data is a valid PSSH atom. |
java-static PsshAtomUtil.PsshAtom? |
parsePsshAtom(atom: ByteArray!)Parses a PSSH atom. |
java-static ByteArray<Byte>? |
parseSchemeSpecificData(atom: ByteArray!, 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!)Parses the version from a PSSH atom. |
Public functions
buildPsshAtom
java-static fun buildPsshAtom(systemId: UUID!, data: ByteArray?): ByteArray<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?): ByteArray<Byte>!
Builds a PSSH atom for the given system id, containing the given key ids and data.
isPsshAtom
java-static fun isPsshAtom(data: ByteArray!): Boolean
Returns whether the data is a valid PSSH atom.
| Parameters | |
|---|---|
data: ByteArray! |
The data to parse. |
| Returns | |
|---|---|
Boolean |
Whether the data is a valid PSSH atom. |
parsePsshAtom
java-static fun parsePsshAtom(atom: ByteArray!): PsshAtomUtil.PsshAtom?
Parses a PSSH atom. Version 0 and 1 PSSH atoms are supported.
| Parameters | |
|---|---|
atom: ByteArray! |
The atom to parse. |
| 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!, uuid: UUID!): ByteArray<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!): 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.
| Parameters | |
|---|---|
atom: ByteArray! |
The atom to parse. |
| 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!): 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.
| Parameters | |
|---|---|
atom: ByteArray! |
The atom to parse. |
| Returns | |
|---|---|
Int |
The parsed version. -1 if the input is not a valid PSSH atom, or if the PSSH atom has an unsupported version. |