FileDocCategorySizeDatePackage
MovieBox.javaAPI Docmp4parser 1.0-RC-172152Wed Dec 19 20:10:38 GMT 2012com.coremedia.iso.boxes

MovieBox

public class MovieBox extends com.googlecode.mp4parser.AbstractContainerBox
The metadata for a presentation is stored in the single Movie Box which occurs at the top-level of a file. Normally this box is close to the beginning or end of the file, though this is not required.

Fields Summary
public static final String
TYPE
Constructors Summary
public MovieBox()


      
        super(TYPE);
    
Methods Summary
public MovieHeaderBoxgetMovieHeaderBox()

        for (Box box : boxes) {
            if (box instanceof MovieHeaderBox) {
                return (MovieHeaderBox) box;
            }
        }
        return null;
    
public intgetTrackCount()

        return getBoxes(TrackBox.class).size();
    
public long[]getTrackNumbers()
Returns the track numbers associated with this MovieBox.

return
the tracknumbers (IDs) of the tracks in their order of appearance in the file


        List<TrackBox> trackBoxes = this.getBoxes(TrackBox.class);
        long[] trackNumbers = new long[trackBoxes.size()];
        for (int trackCounter = 0; trackCounter < trackBoxes.size(); trackCounter++) {
            AbstractBox trackBoxe = trackBoxes.get(trackCounter);
            TrackBox trackBox = (TrackBox) trackBoxe;
            trackNumbers[trackCounter] = trackBox.getTrackHeaderBox().getTrackId();
        }
        return trackNumbers;