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

Mp4MvhdBox

public class Mp4MvhdBox extends AbstractMp4Box
MvhdBox (movie (presentation) header box)

This MP4Box contains important audio information we need. It can be used to calculate track length, depending on the version field this can be in either short or long format

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
timeScale
private long
timeLength
Constructors Summary
public Mp4MvhdBox(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);

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

        return (int) (this.timeLength / this.timeScale);