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

SubSampleInformationBox

public class SubSampleInformationBox extends com.googlecode.mp4parser.AbstractFullBox
aligned(8) class SubSampleInformationBox extends FullBox('subs', version, 0) { unsigned int(32) entry_count; int i,j; for (i=0; i < entry_count; i++) { unsigned int(32) sample_delta; unsigned int(16) subsample_count; if (subsample_count > 0) { for (j=0; j < subsample_count; j++) { if(version == 1) { unsigned int(32) subsample_size; } else { unsigned int(16) subsample_size; } unsigned int(8) subsample_priority; unsigned int(8) discardable; unsigned int(32) reserved = 0; } } } }

Fields Summary
public static final String
TYPE
private long
entryCount
private List
entries
Constructors Summary
public SubSampleInformationBox()


      
        super(TYPE);
    
Methods Summary
public void_parseDetails(java.nio.ByteBuffer content)

        parseVersionAndFlags(content);

        entryCount = IsoTypeReader.readUInt32(content);

        for (int i = 0; i < entryCount; i++) {
            SampleEntry sampleEntry = new SampleEntry();
            sampleEntry.setSampleDelta(IsoTypeReader.readUInt32(content));
            int subsampleCount = IsoTypeReader.readUInt16(content);
            for (int j = 0; j < subsampleCount; j++) {
                SampleEntry.SubsampleEntry subsampleEntry = new SampleEntry.SubsampleEntry();
                subsampleEntry.setSubsampleSize(getVersion() == 1 ? IsoTypeReader.readUInt32(content) : IsoTypeReader.readUInt16(content));
                subsampleEntry.setSubsamplePriority(IsoTypeReader.readUInt8(content));
                subsampleEntry.setDiscardable(IsoTypeReader.readUInt8(content));
                subsampleEntry.setReserved(IsoTypeReader.readUInt32(content));
                sampleEntry.addSubsampleEntry(subsampleEntry);
            }
            entries.add(sampleEntry);
        }

    
protected voidgetContent(java.nio.ByteBuffer byteBuffer)

        writeVersionAndFlags(byteBuffer);
        IsoTypeWriter.writeUInt32(byteBuffer, entries.size());
        for (SampleEntry sampleEntry : entries) {
            IsoTypeWriter.writeUInt32(byteBuffer, sampleEntry.getSampleDelta());
            IsoTypeWriter.writeUInt16(byteBuffer, sampleEntry.getSubsampleCount());
            List<SampleEntry.SubsampleEntry> subsampleEntries = sampleEntry.getSubsampleEntries();
            for (SampleEntry.SubsampleEntry subsampleEntry : subsampleEntries) {
                if (getVersion() == 1) {
                    IsoTypeWriter.writeUInt32(byteBuffer, subsampleEntry.getSubsampleSize());
                } else {
                    IsoTypeWriter.writeUInt16(byteBuffer, l2i(subsampleEntry.getSubsampleSize()));
                }
                IsoTypeWriter.writeUInt8(byteBuffer, subsampleEntry.getSubsamplePriority());
                IsoTypeWriter.writeUInt8(byteBuffer, subsampleEntry.getDiscardable());
                IsoTypeWriter.writeUInt32(byteBuffer, subsampleEntry.getReserved());
            }
        }
    
protected longgetContentSize()

        long entries = 8 + ((4 + 2) * entryCount);
        int subsampleEntries = 0;
        for (SampleEntry sampleEntry : this.entries) {
            subsampleEntries += sampleEntry.getSubsampleCount() * (((getVersion() == 1) ? 4 : 2) + 1 + 1 + 4);
        }
        return entries + subsampleEntries;
    
public java.util.ListgetEntries()

        return entries;
    
public voidsetEntries(java.util.List entries)

        this.entries = entries;
        entryCount = entries.size();
    
public java.lang.StringtoString()

        return "SubSampleInformationBox{" +
                "entryCount=" + entryCount +
                ", entries=" + entries +
                '}";