FileDocCategorySizeDatePackage
Mp4MdhdBox.javaAPI DocJaudiotagger 2.0.42394Wed Mar 30 16:11:44 BST 2011org.jaudiotagger.audio.mp4.atom

Mp4MdhdBox

public class Mp4MdhdBox extends AbstractMp4Box
MdhdBox ( media (stream) header), holds the Sampling Rate used.

Fields Summary
public static final int
VERSION_FLAG_POS
public static final int
OTHER_FLAG_POS
public static final int
CREATED_DATE_SHORT_POS
public static final int
MODIFIED_DATE_SHORT_POS
public static final int
TIMESCALE_SHORT_POS
public static final int
DURATION_SHORT_POS
public static final int
CREATED_DATE_LONG_POS
public static final int
MODIFIED_DATE_LONG_POS
public static final int
TIMESCALE_LONG_POS
public static final int
DURATION_LONG_POS
public static final int
VERSION_FLAG_LENGTH
public static final int
OTHER_FLAG_LENGTH
public static final int
CREATED_DATE_SHORT_LENGTH
public static final int
MODIFIED_DATE_SHORT_LENGTH
public static final int
CREATED_DATE_LONG_LENGTH
public static final int
MODIFIED_DATE_LONG_LENGTH
public static final int
TIMESCALE_LENGTH
public static final int
DURATION_SHORT_LENGTH
public static final int
DURATION_LONG_LENGTH
private static final int
LONG_FORMAT
private int
samplingRate
Constructors Summary
public Mp4MdhdBox(Mp4BoxHeader header, ByteBuffer dataBuffer)

param
header header info
param
dataBuffer data of box (doesnt include header data)


                          
        
    
        this.header = header;

        byte version = dataBuffer.get(VERSION_FLAG_POS);

        long timeLength;
        if (version == LONG_FORMAT)
        {
            this.samplingRate = Utils.getIntBE(dataBuffer, TIMESCALE_LONG_POS, (TIMESCALE_LONG_POS + TIMESCALE_LENGTH - 1));
            timeLength = Utils.getLongBE(dataBuffer, DURATION_LONG_POS, (DURATION_LONG_POS + DURATION_LONG_LENGTH - 1));
        }
        else
        {
            this.samplingRate = Utils.getIntBE(dataBuffer, TIMESCALE_SHORT_POS, (TIMESCALE_SHORT_POS + TIMESCALE_LENGTH - 1));
            timeLength = Utils.getIntBE(dataBuffer, DURATION_SHORT_POS, (DURATION_SHORT_POS + DURATION_SHORT_LENGTH - 1));
        }
    
Methods Summary
public intgetSampleRate()

        return samplingRate;