• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package com.googlecode.mp4parser.boxes;
2 
3 import com.googlecode.mp4parser.AbstractBox;
4 import com.googlecode.mp4parser.boxes.mp4.objectdescriptors.BitReaderBuffer;
5 import com.googlecode.mp4parser.boxes.mp4.objectdescriptors.BitWriterBuffer;
6 
7 import java.nio.ByteBuffer;
8 
9 
10 public class MLPSpecificBox extends AbstractBox {
11 
12     int format_info;
13     int peak_data_rate;
14     int reserved;
15     int reserved2;
16 
MLPSpecificBox()17     public MLPSpecificBox() {
18         super("dmlp");
19     }
20 
21     @Override
getContentSize()22     protected long getContentSize() {
23         return 10;
24     }
25 
26     @Override
_parseDetails(ByteBuffer content)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
getContent(ByteBuffer byteBuffer)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 
getFormat_info()45     public int getFormat_info() {
46         return format_info;
47     }
48 
setFormat_info(int format_info)49     public void setFormat_info(int format_info) {
50         this.format_info = format_info;
51     }
52 
getPeak_data_rate()53     public int getPeak_data_rate() {
54         return peak_data_rate;
55     }
56 
setPeak_data_rate(int peak_data_rate)57     public void setPeak_data_rate(int peak_data_rate) {
58         this.peak_data_rate = peak_data_rate;
59     }
60 
getReserved()61     public int getReserved() {
62         return reserved;
63     }
64 
setReserved(int reserved)65     public void setReserved(int reserved) {
66         this.reserved = reserved;
67     }
68 
getReserved2()69     public int getReserved2() {
70         return reserved2;
71     }
72 
setReserved2(int reserved2)73     public void setReserved2(int reserved2) {
74         this.reserved2 = reserved2;
75     }
76 }
77