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

MovieFragmentBox

public class MovieFragmentBox extends com.googlecode.mp4parser.AbstractContainerBox
aligned(8) class MovieFragmentBox extends Box(moof){ }

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


      
        super(TYPE);
    
Methods Summary
public longgetOffset()

        Box b = this;
        long offset = 0;
        while (b.getParent() != null) {
            for (Box box : b.getParent().getBoxes()) {
                if (b == box) {
                    break;
                }
                offset += box.getSize();
            }
            b = b.getParent();
        }
        return offset;
    
public java.util.ListgetSyncSamples(com.coremedia.iso.boxes.SampleDependencyTypeBox sdtp)

        List<Long> result = new ArrayList<Long>();

        final List<SampleDependencyTypeBox.Entry> sampleEntries = sdtp.getEntries();
        long i = 1;
        for (SampleDependencyTypeBox.Entry sampleEntry : sampleEntries) {
            if (sampleEntry.getSampleDependsOn() == 2) {
                result.add(i);
            }
            i++;
        }

        return result;
    
public intgetTrackCount()

        return getBoxes(TrackFragmentBox.class, false).size();
    
public java.util.ListgetTrackFragmentHeaderBoxes()

        return getBoxes(TrackFragmentHeaderBox.class, true);
    
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<TrackFragmentBox> trackBoxes = this.getBoxes(TrackFragmentBox.class, false);
        long[] trackNumbers = new long[trackBoxes.size()];
        for (int trackCounter = 0; trackCounter < trackBoxes.size(); trackCounter++) {
            TrackFragmentBox trackBoxe = trackBoxes.get(trackCounter);
            trackNumbers[trackCounter] = trackBoxe.getTrackFragmentHeaderBox().getTrackId();
        }
        return trackNumbers;
    
public java.util.ListgetTrackRunBoxes()

        return getBoxes(TrackRunBox.class, true);