org.jaudiotagger.audio.mp4.atom
Class Mp4EsdsBox

java.lang.Object
  extended by org.jaudiotagger.audio.mp4.atom.AbstractMp4Box
      extended by org.jaudiotagger.audio.mp4.atom.Mp4EsdsBox

public class Mp4EsdsBox
extends AbstractMp4Box

EsdsBox ( stream specific description box), usually holds the Bitrate/No of Channels

It contains a number of (possibly optional?) sections (section 3 - 6) (containing optional filler) with differeent info in each section.

-> 4 bytes version/flags = 8-bit hex version + 24-bit hex flags (current = 0)

Section 3 -> 1 byte ES descriptor type tag = 8-bit hex value 0x03 -> 3 bytes optional extended descriptor type tag string = 3 * 8-bit hex value - types are 0x80,0x81,0xFE -> 1 byte descriptor type length = 8-bit unsigned length -> 2 bytes ES ID = 16-bit unsigned value -> 1 byte stream priority = 8-bit unsigned value - Defaults to 16 and ranges from 0 through to 31

Section 4 -> 1 byte decoder config descriptor type tag = 8-bit hex value 0x04 -> 3 bytes optional extended descriptor type tag string = 3 * 8-bit hex value - types are 0x80,0x81,0xFE -> 1 byte descriptor type length = 8-bit unsigned length * -> 1 byte object type ID = 8-bit unsigned value -> 6 bits stream type = 3/4 byte hex value - type IDs are object descript. = 1 ; clock ref. = 2 - type IDs are scene descript. = 4 ; visual = 4 - type IDs are audio = 5 ; MPEG-7 = 6 ; IPMP = 7 - type IDs are OCI = 8 ; MPEG Java = 9 - type IDs are user private = 32 -> 1 bit upstream flag = 1/8 byte hex value -> 1 bit reserved flag = 1/8 byte hex value set to 1 -> 3 bytes buffer size = 24-bit unsigned value -> 4 bytes maximum bit rate = 32-bit unsigned value -> 4 bytes average bit rate = 32-bit unsigned value

Section 5 -> 1 byte decoder specific descriptor type tag 8-bit hex value 0x05 -> 3 bytes optional extended descriptor type tag string = 3 * 8-bit hex value - types are 0x80,0x81,0xFE -> 1 byte descriptor type length = 8-bit unsigned length -> 1 byte Audio profile Id - 5 bits Profile Id - 3 bits Unknown -> 8 bits other flags - 3 bits unknown - 2 bits is No of Channels - 3 bits unknown

Section 6

-> 1 byte SL config descriptor type tag = 8-bit hex value 0x06 -> 3 bytes optional extended descriptor type tag string = 3 * 8-bit hex value - types are 0x80,0x81,0xFE -> 1 byte descriptor type length = 8-bit unsigned length -> 1 byte SL value = 8-bit hex value set to 0x02


Nested Class Summary
static class Mp4EsdsBox.AudioProfile
          Audio profile, held in Section 5 this is usually type LOW_COMPLEXITY
static class Mp4EsdsBox.Kind
          File type, held in Section 4 , only really expecting type 0x64 (AAC)
 
Field Summary
private  Mp4EsdsBox.AudioProfile audioProfile
           
private static java.util.Map<java.lang.Integer,Mp4EsdsBox.AudioProfile> audioProfileMap
           
static int AVERAGE_BITRATE_LENGTH
           
private  int avgBitrate
           
static int BUFFER_SIZE_LENGTH
           
static int CHANNEL_FLAGS_LENGTH
           
static int CONFIG_TYPE_LENGTH
           
static int DESCRIPTOR_OBJECT_TYPE_LENGTH
           
static int DESCRIPTOR_TYPE_LENGTH
           
static int ES_ID_LENGTH
           
private static int FILLER_END
           
private static int FILLER_OTHER
           
private static int FILLER_START
           
private  Mp4EsdsBox.Kind kind
           
private static java.util.Map<java.lang.Integer,Mp4EsdsBox.Kind> kindMap
           
static int MAX_BITRATE_LENGTH
           
private  int maxBitrate
           
private  int numberOfChannels
           
static int OBJECT_TYPE_LENGTH
           
static int OTHER_FLAG_LENGTH
           
private static int SECTION_FIVE
           
private static int SECTION_FOUR
           
private static int SECTION_SIX
           
private static int SECTION_THREE
           
static int STREAM_PRIORITY_LENGTH
           
static int STREAM_TYPE_LENGTH
           
static int VERSION_FLAG_LENGTH
           
 
Fields inherited from class org.jaudiotagger.audio.mp4.atom.AbstractMp4Box
dataBuffer, header
 
Constructor Summary
Mp4EsdsBox(Mp4BoxHeader header, java.nio.ByteBuffer dataBuffer)
          DataBuffer must start from from the start of the body
 
Method Summary
 Mp4EsdsBox.AudioProfile getAudioProfile()
          Get audio profile, usually AAC Low Complexity
 int getAvgBitrate()
           
 Mp4EsdsBox.Kind getKind()
          Only expext MPG_Audio, TODO shouldnt matter if another type of audio, but something gone wrong if type of video
 int getMaxBitrate()
           
 int getNumberOfChannels()
           
 int processSectionHeader(java.nio.ByteBuffer dataBuffer)
          Process header, skipping filler bytes and calculating size
 
Methods inherited from class org.jaudiotagger.audio.mp4.atom.AbstractMp4Box
getData, getHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERSION_FLAG_LENGTH

public static final int VERSION_FLAG_LENGTH
See Also:
Constant Field Values

OTHER_FLAG_LENGTH

public static final int OTHER_FLAG_LENGTH
See Also:
Constant Field Values

DESCRIPTOR_TYPE_LENGTH

public static final int DESCRIPTOR_TYPE_LENGTH
See Also:
Constant Field Values

ES_ID_LENGTH

public static final int ES_ID_LENGTH
See Also:
Constant Field Values

STREAM_PRIORITY_LENGTH

public static final int STREAM_PRIORITY_LENGTH
See Also:
Constant Field Values

CONFIG_TYPE_LENGTH

public static final int CONFIG_TYPE_LENGTH
See Also:
Constant Field Values

OBJECT_TYPE_LENGTH

public static final int OBJECT_TYPE_LENGTH
See Also:
Constant Field Values

STREAM_TYPE_LENGTH

public static final int STREAM_TYPE_LENGTH
See Also:
Constant Field Values

BUFFER_SIZE_LENGTH

public static final int BUFFER_SIZE_LENGTH
See Also:
Constant Field Values

MAX_BITRATE_LENGTH

public static final int MAX_BITRATE_LENGTH
See Also:
Constant Field Values

AVERAGE_BITRATE_LENGTH

public static final int AVERAGE_BITRATE_LENGTH
See Also:
Constant Field Values

DESCRIPTOR_OBJECT_TYPE_LENGTH

public static final int DESCRIPTOR_OBJECT_TYPE_LENGTH
See Also:
Constant Field Values

CHANNEL_FLAGS_LENGTH

public static final int CHANNEL_FLAGS_LENGTH
See Also:
Constant Field Values

kind

private Mp4EsdsBox.Kind kind

audioProfile

private Mp4EsdsBox.AudioProfile audioProfile

numberOfChannels

private int numberOfChannels

maxBitrate

private int maxBitrate

avgBitrate

private int avgBitrate

SECTION_THREE

private static final int SECTION_THREE
See Also:
Constant Field Values

SECTION_FOUR

private static final int SECTION_FOUR
See Also:
Constant Field Values

SECTION_FIVE

private static final int SECTION_FIVE
See Also:
Constant Field Values

SECTION_SIX

private static final int SECTION_SIX
See Also:
Constant Field Values

FILLER_START

private static final int FILLER_START
See Also:
Constant Field Values

FILLER_OTHER

private static final int FILLER_OTHER
See Also:
Constant Field Values

FILLER_END

private static final int FILLER_END
See Also:
Constant Field Values

kindMap

private static java.util.Map<java.lang.Integer,Mp4EsdsBox.Kind> kindMap

audioProfileMap

private static java.util.Map<java.lang.Integer,Mp4EsdsBox.AudioProfile> audioProfileMap
Constructor Detail

Mp4EsdsBox

public Mp4EsdsBox(Mp4BoxHeader header,
                  java.nio.ByteBuffer dataBuffer)
DataBuffer must start from from the start of the body

Parameters:
header - header info
dataBuffer - data of box (doesnt include header data)
Method Detail

getNumberOfChannels

public int getNumberOfChannels()

getMaxBitrate

public int getMaxBitrate()
Returns:
maximum bit rate (bps)

getAvgBitrate

public int getAvgBitrate()
Returns:
average bit rate (bps)

processSectionHeader

public int processSectionHeader(java.nio.ByteBuffer dataBuffer)
Process header, skipping filler bytes and calculating size

Parameters:
dataBuffer -
Returns:
section header

getKind

public Mp4EsdsBox.Kind getKind()
Only expext MPG_Audio, TODO shouldnt matter if another type of audio, but something gone wrong if type of video

Returns:
the file type for the track

getAudioProfile

public Mp4EsdsBox.AudioProfile getAudioProfile()
Get audio profile, usually AAC Low Complexity

Returns:
the audio profile