Class DtsUtil
- java.lang.Object
-
- com.google.android.exoplayer2.audio.DtsUtil
-
public final class DtsUtil extends Object
Utility methods for parsing DTS frames.
-
-
Field Summary
Fields Modifier and Type Field Description static intDTS_HD_MAX_RATE_BYTES_PER_SECONDMaximum rate for a DTS-HD audio stream, in bytes per second.static intDTS_MAX_RATE_BYTES_PER_SECONDMaximum rate for a DTS audio stream, in bytes per second.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetDtsFrameSize(byte[] data)Returns the size in bytes of the given DTS frame.static booleanisSyncWord(int word)Returns whether a given integer matches a DTS sync word.static intparseDtsAudioSampleCount(byte[] data)Returns the number of audio samples represented by the given DTS frame.static intparseDtsAudioSampleCount(ByteBuffer buffer)LikeparseDtsAudioSampleCount(byte[])but reads from aByteBuffer.static FormatparseDtsFormat(byte[] frame, String trackId, String language, DrmInitData drmInitData)Returns the DTS format givendatacontaining the DTS frame according to ETSI TS 102 114 subsections 5.3/5.4.
-
-
-
Field Detail
-
DTS_MAX_RATE_BYTES_PER_SECOND
public static final int DTS_MAX_RATE_BYTES_PER_SECOND
Maximum rate for a DTS audio stream, in bytes per second.DTS allows an 'open' bitrate, but we assume the maximum listed value: 1536 kbit/s.
- See Also:
- Constant Field Values
-
DTS_HD_MAX_RATE_BYTES_PER_SECOND
public static final int DTS_HD_MAX_RATE_BYTES_PER_SECOND
Maximum rate for a DTS-HD audio stream, in bytes per second.- See Also:
- Constant Field Values
-
-
Method Detail
-
isSyncWord
public static boolean isSyncWord(int word)
Returns whether a given integer matches a DTS sync word. Synchronization and storage modes are defined in ETSI TS 102 114 V1.1.1 (2002-08), Section 5.3.- Parameters:
word- An integer.- Returns:
- Whether a given integer matches a DTS sync word.
-
parseDtsFormat
public static Format parseDtsFormat(byte[] frame, @Nullable String trackId, @Nullable String language, @Nullable DrmInitData drmInitData)
Returns the DTS format givendatacontaining the DTS frame according to ETSI TS 102 114 subsections 5.3/5.4.- Parameters:
frame- The DTS frame to parse.trackId- The track identifier to set on the format.language- The language to set on the format.drmInitData-DrmInitDatato be included in the format.- Returns:
- The DTS format parsed from data in the header.
-
parseDtsAudioSampleCount
public static int parseDtsAudioSampleCount(byte[] data)
Returns the number of audio samples represented by the given DTS frame.- Parameters:
data- The frame to parse.- Returns:
- The number of audio samples represented by the frame.
-
parseDtsAudioSampleCount
public static int parseDtsAudioSampleCount(ByteBuffer buffer)
LikeparseDtsAudioSampleCount(byte[])but reads from aByteBuffer. The buffer's position is not modified.- Parameters:
buffer- TheByteBufferfrom which to read.- Returns:
- The number of audio samples represented by the syncframe.
-
getDtsFrameSize
public static int getDtsFrameSize(byte[] data)
Returns the size in bytes of the given DTS frame.- Parameters:
data- The frame to parse.- Returns:
- The frame's size in bytes.
-
-