net.sf.fmj.media.codec.video.jpeg
Class JpegRTPHeader
java.lang.Object
net.sf.fmj.media.codec.video.jpeg.JpegRTPHeader
public class JpegRTPHeader
- extends java.lang.Object
A JPEG/RTP header.
A special header is added to each packet that immediately follows the
RTP header:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type specific | Fragment Offset |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type | Q | Width | Height |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- Author:
- Ken Larson, Martin Harvan
Constructor Summary |
JpegRTPHeader(byte typeSpecific,
int fragmentOffset,
byte type,
byte q,
byte width,
byte height)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
HEADER_SIZE
public static final int HEADER_SIZE
- In bytes.
- See Also:
- Constant Field Values
JpegRTPHeader
public JpegRTPHeader(byte typeSpecific,
int fragmentOffset,
byte type,
byte q,
byte width,
byte height)
parse
public static JpegRTPHeader parse(byte[] data,
int offset)
toBytes
public byte[] toBytes()
createQHeader
public static byte[] createQHeader(int length,
int[] lqt,
int[] cqt)
- Creates header containing Quantization tables (used when Q is set to values greater than 127).
- Parameters:
length
- length for the headers (usually 128 - two 64 bytes long tables)lqt
- Luma Quantization tablecqt
- Chroma Quantization table
- Returns:
- Qtable header
getWidthInPixels
public int getWidthInPixels()
getHeightInPixels
public int getHeightInPixels()
getWidthInBlocks
public int getWidthInBlocks()
getHeightInBlocks
public int getHeightInBlocks()
getFragmentOffset
public int getFragmentOffset()
getQ
public int getQ()
getType
public int getType()
getTypeSpecific
public int getTypeSpecific()
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
createRstHeader
public static byte[] createRstHeader(int dri,
int f,
int l,
int count)
- Creates RST header for JPEG/RTP packet.
- Parameters:
dri
- Restart interval - number of MCUs between restart markersf
- first bit (should be set to 1)l
- last bit (should be set to 1)count
- number of restart markers (should be set to 3FFF)
- Returns:
- RST header
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object