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 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 byte[][] |
splitNalUnits(byte[] data)
Splits an array of NAL units.
|
public static android.util.Pair<java.lang.Integer,java.lang.Integer> parseAacAudioSpecificConfig(byte[] audioSpecificConfig)
audioSpecificConfig
- The AudioSpecificConfig to parse.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 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
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.