public final class Ac3Util extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Ac3Util.SyncFrameInfo
Holds sample format information as presented by a syncframe header.
|
Modifier and Type | Field and Description |
---|---|
static int |
TRUEHD_RECHUNK_SAMPLE_COUNT
The number of samples to store in each output chunk when rechunking TrueHD streams.
|
static int |
TRUEHD_SYNCFRAME_PREFIX_LENGTH
The number of bytes that must be parsed from a TrueHD syncframe to calculate the sample count.
|
Modifier and Type | Method and Description |
---|---|
static int |
findTrueHdSyncframeOffset(ByteBuffer buffer)
Returns the offset relative to the buffer's position of the start of a TrueHD syncframe, or
C.INDEX_UNSET if no syncframe was found. |
static int |
getAc3SyncframeAudioSampleCount()
Returns the number of audio samples in an AC-3 syncframe.
|
static Format |
parseAc3AnnexFFormat(ParsableByteArray data,
String trackId,
String language,
DrmInitData drmInitData)
Returns the AC-3 format given
data containing the AC3SpecificBox according to ETSI TS
102 366 Annex F. |
static Ac3Util.SyncFrameInfo |
parseAc3SyncframeInfo(ParsableBitArray data)
Returns (E-)AC-3 format information given
data containing a syncframe. |
static int |
parseAc3SyncframeSize(byte[] data)
Returns the size in bytes of the given (E-)AC-3 syncframe.
|
static Format |
parseEAc3AnnexFFormat(ParsableByteArray data,
String trackId,
String language,
DrmInitData drmInitData)
Returns the E-AC-3 format given
data containing the EC3SpecificBox according to ETSI TS
102 366 Annex F. |
static int |
parseEAc3SyncframeAudioSampleCount(ByteBuffer buffer)
Reads the number of audio samples represented by the given E-AC-3 syncframe.
|
static int |
parseTrueHdSyncframeAudioSampleCount(byte[] syncframe)
Returns the number of audio samples represented by the given TrueHD syncframe, or 0 if the
buffer is not the start of a syncframe.
|
static int |
parseTrueHdSyncframeAudioSampleCount(ByteBuffer buffer,
int offset)
Reads the number of audio samples represented by a TrueHD syncframe.
|
public static final int TRUEHD_RECHUNK_SAMPLE_COUNT
public static final int TRUEHD_SYNCFRAME_PREFIX_LENGTH
public static Format parseAc3AnnexFFormat(ParsableByteArray data, String trackId, String language, DrmInitData drmInitData)
data
containing the AC3SpecificBox according to ETSI TS
102 366 Annex F. The reading position of data
will be modified.data
- The AC3SpecificBox to parse.trackId
- The track identifier to set on the format.language
- The language to set on the format.drmInitData
- DrmInitData
to be included in the format.public static Format parseEAc3AnnexFFormat(ParsableByteArray data, String trackId, String language, DrmInitData drmInitData)
data
containing the EC3SpecificBox according to ETSI TS
102 366 Annex F. The reading position of data
will be modified.data
- The EC3SpecificBox to parse.trackId
- The track identifier to set on the format.language
- The language to set on the format.drmInitData
- DrmInitData
to be included in the format.public static Ac3Util.SyncFrameInfo parseAc3SyncframeInfo(ParsableBitArray data)
data
containing a syncframe. The reading
position of data
will be modified.data
- The data to parse, positioned at the start of the syncframe.public static int parseAc3SyncframeSize(byte[] data)
data
- The syncframe to parse.C.LENGTH_UNSET
if the input is invalid.public static int getAc3SyncframeAudioSampleCount()
public static int parseEAc3SyncframeAudioSampleCount(ByteBuffer buffer)
buffer
- The ByteBuffer
from which to read the syncframe.public static int findTrueHdSyncframeOffset(ByteBuffer buffer)
C.INDEX_UNSET
if no syncframe was found. The buffer's position is not modified.buffer
- The ByteBuffer
within which to find a syncframe.C.INDEX_UNSET
if no syncframe was found.public static int parseTrueHdSyncframeAudioSampleCount(byte[] syncframe)
syncframe
- The bytes from which to read the syncframe. Must be at least TRUEHD_SYNCFRAME_PREFIX_LENGTH
bytes long.public static int parseTrueHdSyncframeAudioSampleCount(ByteBuffer buffer, int offset)
buffer
- The ByteBuffer
from which to read the syncframe.offset
- The offset of the start of the syncframe relative to the buffer's position.