public final class CodecSpecificDataUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
buildAacAudioSpecificConfig(int audioObjectType,
int sampleRateIndex,
int channelConfig)
Builds a simple AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1
|
static byte[] |
buildAacLcAudioSpecificConfig(int sampleRate,
int numChannels)
Builds a simple HE-AAC LC AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1
|
static java.lang.String |
buildAvcCodecString(int profileIdc,
int constraintsFlagsAndReservedZero2Bits,
int levelIdc)
Builds an RFC 6381 AVC codec string using the provided parameters.
|
static byte[] |
buildNalUnit(byte[] data,
int offset,
int length)
Constructs a NAL unit consisting of the NAL start code followed by the specified data.
|
static android.util.Pair<java.lang.Integer,java.lang.Integer> |
parseAacAudioSpecificConfig(byte[] audioSpecificConfig)
Parses an AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1
|
static android.util.Pair<java.lang.Integer,java.lang.Integer> |
parseAacAudioSpecificConfig(ParsableBitArray bitArray,
boolean forceReadToEnd)
Parses an AudioSpecificConfig, as defined in ISO 14496-3 1.6.2.1
|
static byte[][] |
splitNalUnits(byte[] data)
Splits an array of NAL units.
|
public static android.util.Pair<java.lang.Integer,java.lang.Integer> parseAacAudioSpecificConfig(byte[] audioSpecificConfig)
throws ParserException
audioSpecificConfig - A byte array containing the AudioSpecificConfig to parse.ParserException - If the AudioSpecificConfig cannot be parsed as it's not supported.public static android.util.Pair<java.lang.Integer,java.lang.Integer> parseAacAudioSpecificConfig(ParsableBitArray bitArray, boolean forceReadToEnd) throws ParserException
bitArray - A ParsableBitArray containing the AudioSpecificConfig to parse. The
position is advanced to the end of the AudioSpecificConfig.forceReadToEnd - Whether the entire AudioSpecificConfig should be read. Required for
knowing the length of the configuration payload.ParserException - If the AudioSpecificConfig cannot be parsed as it's not supported.public static byte[] buildAacLcAudioSpecificConfig(int sampleRate,
int numChannels)
sampleRate - The sample rate in Hz.numChannels - The number of channels.public static byte[] buildAacAudioSpecificConfig(int audioObjectType,
int sampleRateIndex,
int channelConfig)
audioObjectType - The audio object type.sampleRateIndex - The sample rate index.channelConfig - The channel configuration.public static java.lang.String buildAvcCodecString(int profileIdc,
int constraintsFlagsAndReservedZero2Bits,
int levelIdc)
profileIdc - The encoding profile.constraintsFlagsAndReservedZero2Bits - The constraint flags followed by the reserved zero
2 bits, all contained in the least significant byte of the integer.levelIdc - The encoding level.public static byte[] buildNalUnit(byte[] data,
int offset,
int length)
data - An array containing the data that should follow the NAL start code.offset - The start offset into data.length - The number of bytes to copy from data@Nullable public static byte[][] splitNalUnits(byte[] data)
If the input consists of NAL start code delimited units, then the returned array consists of the split NAL units, each of which is still prefixed with the NAL start code. For any other input, null is returned.
data - An array of data.