1package com.googlecode.mp4parser.boxes;
2
3import com.googlecode.mp4parser.AbstractBox;
4import com.googlecode.mp4parser.boxes.mp4.objectdescriptors.BitReaderBuffer;
5import com.googlecode.mp4parser.boxes.mp4.objectdescriptors.BitWriterBuffer;
6
7import java.nio.ByteBuffer;
8
9
10public class MLPSpecificBox extends AbstractBox {
11
12    int format_info;
13    int peak_data_rate;
14    int reserved;
15    int reserved2;
16
17    public MLPSpecificBox() {
18        super("dmlp");
19    }
20
21    @Override
22    protected long getContentSize() {
23        return 10;
24    }
25
26    @Override
27    public void _parseDetails(ByteBuffer content) {
28        BitReaderBuffer brb = new BitReaderBuffer(content);
29        format_info = brb.readBits(32);
30        peak_data_rate = brb.readBits(15);
31        reserved = brb.readBits(1);
32        reserved2 = brb.readBits(32);
33    }
34
35    @Override
36    protected void getContent(ByteBuffer byteBuffer) {
37        BitWriterBuffer bwb = new BitWriterBuffer(byteBuffer);
38        bwb.writeBits(format_info, 32);
39        bwb.writeBits(peak_data_rate, 15);
40        bwb.writeBits(reserved, 1);
41        bwb.writeBits(reserved2, 32);
42        //To change body of implemented methods use File | Settings | File Templates.
43    }
44
45    public int getFormat_info() {
46        return format_info;
47    }
48
49    public void setFormat_info(int format_info) {
50        this.format_info = format_info;
51    }
52
53    public int getPeak_data_rate() {
54        return peak_data_rate;
55    }
56
57    public void setPeak_data_rate(int peak_data_rate) {
58        this.peak_data_rate = peak_data_rate;
59    }
60
61    public int getReserved() {
62        return reserved;
63    }
64
65    public void setReserved(int reserved) {
66        this.reserved = reserved;
67    }
68
69    public int getReserved2() {
70        return reserved2;
71    }
72
73    public void setReserved2(int reserved2) {
74        this.reserved2 = reserved2;
75    }
76}
77