FileDocCategorySizeDatePackage
EC3SpecificBox.javaAPI Docmp4parser 1.0-RC-173860Wed Dec 19 20:10:37 GMT 2012com.googlecode.mp4parser.boxes

EC3SpecificBox

public class EC3SpecificBox extends com.googlecode.mp4parser.AbstractBox

Fields Summary
List
entries
int
dataRate
int
numIndSub
Constructors Summary
public EC3SpecificBox()


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

        BitReaderBuffer brb = new BitReaderBuffer(content);
        dataRate = brb.readBits(13);
        numIndSub = brb.readBits(3) + 1;
        // This field indicates the number of independent substreams that are present in the Enhanced AC-3 bitstream. The value
        // of this field is one less than the number of independent substreams present.


        for (int i = 0; i < numIndSub; i++) {
            Entry e = new Entry();
            e.fscod = brb.readBits(2);
            e.bsid = brb.readBits(5);
            e.bsmod = brb.readBits(5);
            e.acmod = brb.readBits(3);
            e.lfeon = brb.readBits(1);
            e.reserved = brb.readBits(3);
            e.num_dep_sub = brb.readBits(4);
            if (e.num_dep_sub > 0) {
                e.chan_loc = brb.readBits(9);
            } else {
                e.reserved2 = brb.readBits(1);
            }
            entries.add(e);
        }
    
public voidaddEntry(com.googlecode.mp4parser.boxes.EC3SpecificBox$Entry entry)

        this.entries.add(entry);
    
public voidgetContent(java.nio.ByteBuffer byteBuffer)

        BitWriterBuffer bwb = new BitWriterBuffer(byteBuffer);
        bwb.writeBits(dataRate, 13);
        bwb.writeBits(entries.size() - 1, 3);
        for (Entry e : entries) {
            bwb.writeBits(e.fscod, 2);
            bwb.writeBits(e.bsid, 5);
            bwb.writeBits(e.bsmod, 5);
            bwb.writeBits(e.acmod, 3);
            bwb.writeBits(e.lfeon, 1);
            bwb.writeBits(e.reserved, 3);
            bwb.writeBits(e.num_dep_sub, 4);
            if (e.num_dep_sub > 0) {
                bwb.writeBits(e.chan_loc, 9);
            } else {
                bwb.writeBits(e.reserved2, 1);
            }
        }
    
public longgetContentSize()

        long size = 2;
        for (Entry entry : entries) {
            if (entry.num_dep_sub > 0) {
                size += 4;
            } else {
                size += 3;
            }
        }
        return size;
    
public intgetDataRate()

        return dataRate;
    
public java.util.ListgetEntries()

        return entries;
    
public intgetNumIndSub()

        return numIndSub;
    
public voidsetDataRate(int dataRate)

        this.dataRate = dataRate;
    
public voidsetEntries(java.util.List entries)

        this.entries = entries;
    
public voidsetNumIndSub(int numIndSub)

        this.numIndSub = numIndSub;