|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Objectcom.wowza.wms.amf.AMFPacket
public class AMFPacket
AMFPacket: data container for data being transferred to and from the server from the Flash client. AMFPacket is also used to store data read/written to/from an flv file.
| Constructor Summary | |
|---|---|
AMFPacket()
Create new empty packet |
|
AMFPacket(int type,
int src,
int size)
Create new packet with given values |
|
| Method Summary | |
|---|---|
int |
addData(byte[] data,
int offset,
int size)
Add data to the packet |
int |
addDataEx(byte[] srcData,
int srcOffset,
int destOffset,
int srcBytes)
Add data to the packet |
static int |
calcTotalPacketSize(int packetSize,
int headerSize,
int chunkSize,
int amfNumber,
boolean isLongTimecode)
Calculate the total packet size for given packet parameters |
AMFPacket |
clone()
|
long |
getAbsTimecode()
Get absolute timecode (milliseconds) |
byte[] |
getData()
Get data as byte[] |
java.nio.ByteBuffer |
getDataBuffer()
Get data as ByteBuffer |
int |
getFirstByte()
Get first byte of data (used to peek into packet) |
int |
getMissing()
Get the number of bytes remaining unfilled in the packet |
int |
getSecondByte()
Get second byte of data (used to peek into packet) |
long |
getSeq()
Get packet sequence number. |
int |
getSize()
Get packet size |
int |
getSrc()
Get stream id (0 if not stream data) |
long |
getTimecode()
Get timecode (milliseconds) relative |
int |
getType()
Get content type IVHost.CONTENTTYPE_* |
boolean |
isAudio()
Is this an audio packet IVHost.CONTENTTYPE_AUDIO |
boolean |
isVideo()
Is this an audio packet IVHost.CONTENTTYPE_VIDEO |
void |
setAbsTimecode(long absTimecode)
Set absolute timecode (milliseconds) |
void |
setDataBuffer(byte[] data)
Set the data buffer to a byte array |
void |
setDataBuffer(java.nio.ByteBuffer data)
Set the data for this packet |
void |
setSeq(long seq)
Set packet sequence. |
void |
setSize(int size)
Set packet size |
void |
setSrc(int src)
Set stream id (0 if not stream data) |
void |
setTimecode(long timecode)
Set timecode (milliseconds) relative |
void |
setTimecodes(long timecode,
long absTimecode)
Set both relative and absolute timecode in one call (milliseconds) |
void |
setType(int type)
Set content type IVHost.CONTENTTYPE_* |
String |
toString()
Return object as formatted string |
void |
truncatePacket(int newSize)
|
| Methods inherited from class Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AMFPacket()
public AMFPacket(int type,
int src,
int size)
type - packet content type: IVHost.CONTENTTYPE_*src - stream idsize - packet size (bytes)| Method Detail |
|---|
public int addData(byte[] data,
int offset,
int size)
data - byte buffer with dataoffset - offset in byte buffersize - size of data
public int addDataEx(byte[] srcData,
int srcOffset,
int destOffset,
int srcBytes)
srcData - - source byte buffer with datasrcOffset - - start copying from source buffer at this offsetdestOffset - - copy into destination buffer from this offsetsrcBytes - - size of data to copy
public static int calcTotalPacketSize(int packetSize,
int headerSize,
int chunkSize,
int amfNumber,
boolean isLongTimecode)
packetSize - data sizeheaderSize - header sizechunkSize - chunk sizeamfNumber - amf numberisLongTimecode - is long timecode
public AMFPacket clone()
clone in class Objectpublic long getAbsTimecode()
public byte[] getData()
public java.nio.ByteBuffer getDataBuffer()
public int getFirstByte()
public int getMissing()
public int getSecondByte()
public long getSeq()
public int getSize()
public int getSrc()
public long getTimecode()
public int getType()
public boolean isAudio()
public boolean isVideo()
public void setAbsTimecode(long absTimecode)
absTimecode - absolute timecodepublic void setDataBuffer(byte[] data)
data - data buffer byte arraypublic void setDataBuffer(java.nio.ByteBuffer data)
data - byte buffer that holds packet datapublic void setSeq(long seq)
seq - packet sequencepublic void setSize(int size)
size - packet sizepublic void setSrc(int src)
src - stream idpublic void setTimecode(long timecode)
timecode - timecode (milliseconds)
public void setTimecodes(long timecode,
long absTimecode)
timecode - relative timecode (milliseconds)absTimecode - absolute timecode (milliseconds)public void setType(int type)
type - content typepublic String toString()
toString in class Objectpublic void truncatePacket(int newSize)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||