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

SampleAuxiliaryInformationSizesBox

public class SampleAuxiliaryInformationSizesBox extends com.googlecode.mp4parser.AbstractFullBox

Fields Summary
public static final String
TYPE
private int
defaultSampleInfoSize
private List
sampleInfoSizes
private int
sampleCount
private String
auxInfoType
private String
auxInfoTypeParameter
Constructors Summary
public SampleAuxiliaryInformationSizesBox()


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

        parseVersionAndFlags(content);
        if ((getFlags() & 1) == 1) {
            auxInfoType = IsoTypeReader.read4cc(content);
            auxInfoTypeParameter = IsoTypeReader.read4cc(content);
        }

        defaultSampleInfoSize = (short) IsoTypeReader.readUInt8(content);
        sampleCount = l2i(IsoTypeReader.readUInt32(content));

        sampleInfoSizes.clear();

        if (defaultSampleInfoSize == 0) {
            for (int i = 0; i < sampleCount; i++) {
                sampleInfoSizes.add((short) IsoTypeReader.readUInt8(content));
            }
        }
    
public java.lang.StringgetAuxInfoType()

        return auxInfoType;
    
public java.lang.StringgetAuxInfoTypeParameter()

        return auxInfoTypeParameter;
    
protected voidgetContent(java.nio.ByteBuffer byteBuffer)

        writeVersionAndFlags(byteBuffer);
        if ((getFlags() & 1) == 1) {
            byteBuffer.put(IsoFile.fourCCtoBytes(auxInfoType));
            byteBuffer.put(IsoFile.fourCCtoBytes(auxInfoTypeParameter));
        }

        IsoTypeWriter.writeUInt8(byteBuffer, defaultSampleInfoSize);

        if (defaultSampleInfoSize == 0) {
            IsoTypeWriter.writeUInt32(byteBuffer, sampleInfoSizes.size());
            for (short sampleInfoSize : sampleInfoSizes) {
                IsoTypeWriter.writeUInt8(byteBuffer, sampleInfoSize);
            }
        } else {
            IsoTypeWriter.writeUInt32(byteBuffer, sampleCount);
        }
    
protected longgetContentSize()

        int size = 4;
        if ((getFlags() & 1) == 1) {
            size += 8;
        }

        size += 5;
        size += defaultSampleInfoSize == 0 ? sampleInfoSizes.size() : 0;
        return size;
    
public intgetDefaultSampleInfoSize()

        return defaultSampleInfoSize;
    
public intgetSampleCount()

        return sampleCount;
    
public java.util.ListgetSampleInfoSizes()

        return sampleInfoSizes;
    
public voidsetAuxInfoType(java.lang.String auxInfoType)

        this.auxInfoType = auxInfoType;
    
public voidsetAuxInfoTypeParameter(java.lang.String auxInfoTypeParameter)

        this.auxInfoTypeParameter = auxInfoTypeParameter;
    
public voidsetDefaultSampleInfoSize(int defaultSampleInfoSize)

        assert defaultSampleInfoSize <= 255;
        this.defaultSampleInfoSize = defaultSampleInfoSize;
    
public voidsetSampleCount(int sampleCount)

        this.sampleCount = sampleCount;
    
public voidsetSampleInfoSizes(java.util.List sampleInfoSizes)

        this.sampleInfoSizes = sampleInfoSizes;
    
public java.lang.StringtoString()

        return "SampleAuxiliaryInformationSizesBox{" +
                "defaultSampleInfoSize=" + defaultSampleInfoSize +
                ", sampleCount=" + sampleCount +
                ", auxInfoType='" + auxInfoType + '\'" +
                ", auxInfoTypeParameter='" + auxInfoTypeParameter + '\'" +
                '}";