com.coremedia.iso.boxes.rtp.MaximumDataRateBox Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of isoparser Show documentation
Show all versions of isoparser Show documentation
A generic parser and writer for all ISO 14496 based files (MP4, Quicktime, DCF, PDCF, ...)
package com.coremedia.iso.boxes.rtp;
import com.coremedia.iso.BoxParser;
import com.coremedia.iso.IsoBufferWrapper;
import com.coremedia.iso.IsoFile;
import com.coremedia.iso.IsoOutputStream;
import com.coremedia.iso.boxes.AbstractBox;
import com.coremedia.iso.boxes.Box;
import java.io.IOException;
/**
* The maximum data rate. This atom contains two numbers:
*
* g, followed by m (both 32-bit values).
*
* - g is the granularity, in milliseconds.
* - m is the maximum data rate given that granularity.
*
*
* For example, if g is 1 second, then m is the maximum data rate over any
* 1 second. There may be multiple 'maxr' atoms, with different values for
* g. The maximum data rate calculation does not include any network headers
* (but does include 12-byte RTP headers).
*/
public class MaximumDataRateBox extends AbstractBox {
public static final String TYPE = "maxr";
public MaximumDataRateBox() {
super(IsoFile.fourCCtoBytes(TYPE));
}
private long g, m;
public long getG() {
return g;
}
public void setG(long g) {
this.g = g;
}
public long getM() {
return m;
}
public void setM(long m) {
this.m = m;
}
protected long getContentSize() {
return 8;
}
public void parse(IsoBufferWrapper in, long size, BoxParser boxParser, Box lastMovieFragmentBox) throws IOException {
g = in.readUInt32();
m = in.readUInt32();
}
protected void getContent(IsoOutputStream os) throws IOException {
os.writeUInt32(g);
os.writeUInt32(m);
}
}