com.wowza.wms.amf
Class AMFObj

Object
  extended by com.wowza.wms.amf.AMFObj

public class AMFObj
extends Object

AMFObj: class that stores the state of channel between the client and the server.


Constructor Summary
AMFObj(int id)
          Create new AMFObj for a given channel (id)
AMFObj(int id, int objectEncoding)
          Create new AMFObj for a given channel (id)
 
Method Summary
 void addChunk(byte[] buffer, int offset, int len)
          Add a chunk to the chunk list
 void clearByteContainer()
          Clear the byte container
 long getAbsTimecode()
          Get the absolute time code
 int getByteContainerLevel()
          Fake container for processing
 java.util.List<AMFObjChunk> getChunks()
          Get the chunks that make up this packet
 int getId()
          Get channel id
 int getObjectEncoding()
           
 int getSize()
          Get packet size
 int getSrc()
          Get stream id (0 if not stream data)
 long getTimecode()
          Get timecode (milliseconds) sometimes relative
 int getType()
          Get content type IVHost.CONTENTTYPE_*
 long incAbsTimecode(long absTimecode)
          Increment the absolution timecode
 void incByteContainerLevel(int byteContainerLevel)
          Fake container for processing
 boolean isByteContainerEmpty()
          Fake container for processing
 boolean isByteContainerFull()
          Fake container for processing
 boolean isLastSentAbsTimecode()
           
 boolean isLongTimecode()
          Get is a 32 bit timecode
 boolean isNew()
          Is this a new packet.
 boolean isObjectEncodingAMF0()
           
 boolean isObjectEncodingAMF3()
           
 long setAbsTimecodeLong(long absTimecode)
          Set the absolute timecode
 long setAbsTimecodeShort(long absTimecode)
          Set the absolute timecode
 void setByteContainerLevel(int byteContainerLevel)
          Fake container for processing
 void setId(int id)
          Set channel id
 void setLastSentAbsTimecode(boolean isLastSentAbsTimecode)
           
 void setLongTimecode(boolean isLongTimecode)
          Set is a 32 bit timecode
 void setNew(boolean isNew)
          Set is new packet
 void setObjectEncoding(int objectEncoding)
           
 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) sometimes relative
 void setType(int type)
          Set content type IVHost.CONTENTTYPE_*
 String toString()
          Return object as formatted string
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AMFObj

public AMFObj(int id)
Create new AMFObj for a given channel (id)

Parameters:
id - channel id

AMFObj

public AMFObj(int id,
              int objectEncoding)
Create new AMFObj for a given channel (id)

Parameters:
id - channel id
objectEncoding - object encoding level (AMF0 or AMF3)
Method Detail

addChunk

public void addChunk(byte[] buffer,
                     int offset,
                     int len)
Add a chunk to the chunk list

Parameters:
buffer - buffer
offset - offset
len - length

clearByteContainer

public void clearByteContainer()
Clear the byte container


getAbsTimecode

public long getAbsTimecode()
Get the absolute time code

Returns:
absolute timecode

getByteContainerLevel

public int getByteContainerLevel()
Fake container for processing

Returns:
current container level

getChunks

public java.util.List<AMFObjChunk> getChunks()
Get the chunks that make up this packet

Returns:
chunks that make up this packet

getId

public int getId()
Get channel id

Returns:
channel id

getObjectEncoding

public int getObjectEncoding()

getSize

public int getSize()
Get packet size

Returns:
packet size

getSrc

public int getSrc()
Get stream id (0 if not stream data)

Returns:
stream id

getTimecode

public long getTimecode()
Get timecode (milliseconds) sometimes relative

Returns:
timecode (milliseconds)

getType

public int getType()
Get content type IVHost.CONTENTTYPE_*

Returns:
content type

incAbsTimecode

public long incAbsTimecode(long absTimecode)
Increment the absolution timecode

Parameters:
absTimecode - absolute timecode
Returns:
absolute timecode

incByteContainerLevel

public void incByteContainerLevel(int byteContainerLevel)
Fake container for processing

Parameters:
byteContainerLevel - current container level

isByteContainerEmpty

public boolean isByteContainerEmpty()
Fake container for processing

Returns:
is container full

isByteContainerFull

public boolean isByteContainerFull()
Fake container for processing

Returns:
is container full

isLastSentAbsTimecode

public boolean isLastSentAbsTimecode()

isLongTimecode

public boolean isLongTimecode()
Get is a 32 bit timecode

Returns:
true if 32 bit timecode

isNew

public boolean isNew()
Is this a new packet. If new entire packet header needs to be sent

Returns:
is new packet

isObjectEncodingAMF0

public boolean isObjectEncodingAMF0()

isObjectEncodingAMF3

public boolean isObjectEncodingAMF3()

setAbsTimecodeLong

public long setAbsTimecodeLong(long absTimecode)
Set the absolute timecode

Parameters:
absTimecode - absolute timecode
Returns:
absolute timecode

setAbsTimecodeShort

public long setAbsTimecodeShort(long absTimecode)
Set the absolute timecode

Parameters:
absTimecode -
Returns:
absolute timecode

setByteContainerLevel

public void setByteContainerLevel(int byteContainerLevel)
Fake container for processing

Parameters:
byteContainerLevel - current container level

setId

public void setId(int id)
Set channel id

Parameters:
id - channel id

setLastSentAbsTimecode

public void setLastSentAbsTimecode(boolean isLastSentAbsTimecode)

setLongTimecode

public void setLongTimecode(boolean isLongTimecode)
Set is a 32 bit timecode

Parameters:
isLongTimecode - is a 32 bit timecode

setNew

public void setNew(boolean isNew)
Set is new packet

Parameters:
isNew - is new packet

setObjectEncoding

public void setObjectEncoding(int objectEncoding)

setSize

public void setSize(int size)
Set packet size

Parameters:
size - packet size

setSrc

public void setSrc(int src)
Set stream id (0 if not stream data)

Parameters:
src - stream id

setTimecode

public void setTimecode(long timecode)
Set timecode (milliseconds) sometimes relative

Parameters:
timecode - timecode (milliseconds)

setType

public void setType(int type)
Set content type IVHost.CONTENTTYPE_*

Parameters:
type - content type

toString

public String toString()
Return object as formatted string

Overrides:
toString in class Object