local.net
Class RtpPacket

java.lang.Object
  |
  +--local.net.RtpPacket

public class RtpPacket
extends java.lang.Object

RtpPacket implements a RTP packet.


Constructor Summary
RtpPacket(byte[] buffer, int packet_length)
          Creates a new RTP packet
 
Method Summary
 int getCscrCount()
          Gets the CSCR count (CC)
 long[] getCscrList()
          Gets the CSCR list
 int getHeaderLength()
          Gets the RTP header length
 int getLength()
          Gets the RTP packet length
 byte[] getPacket()
          Gets the RTP packet
 byte[] getPayload()
          Gets the payload
 int getPayloadLength()
          Gets the RTP header length
 int getPayloadType()
          Gets the payload type (PT)
 int getSequenceNumber()
          Gets the sequence number
 long getSscr()
          Gets the SSCR
 long getTimestamp()
          Gets the timestamp
 int getVersion()
          Gets the version (V)
 boolean hasExtension()
          Whether has extension (X)
 boolean hasMarker()
          Whether has marker (M)
 boolean hasPadding()
          Whether has padding (P)
 void init(int ptype)
          init the RTP packet header (only PT)
 void init(int ptype, int seqn, long timestamp, long sscr)
          init the RTP packet header (PT, SQN, TimeStamp, SSCR)
 void init(int ptype, long sscr)
          init the RTP packet header (PT and SSCR)
 void setCscrList(long[] cscr)
          Sets the CSCR list
 void setExtension(boolean x)
          Set extension (X)
 void setMarker(boolean m)
          Set marker (M)
 void setPadding(boolean p)
          Set padding (P)
 void setPayload(byte[] payload, int len)
          Sets the payload
 void setPayloadLength(int len)
          Sets the RTP payload length
 void setPayloadType(int pt)
          Sets the payload type (PT)
 void setSequenceNumber(int sn)
          Sets the sequence number
 void setSscr(long ssrc)
          Sets the SSCR
 void setTimestamp(long timestamp)
          Sets the timestamp
 void setVersion(int v)
          Sets the version (V)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RtpPacket

public RtpPacket(byte[] buffer,
                 int packet_length)
Creates a new RTP packet
Method Detail

getPacket

public byte[] getPacket()
Gets the RTP packet

getLength

public int getLength()
Gets the RTP packet length

getHeaderLength

public int getHeaderLength()
Gets the RTP header length

getPayloadLength

public int getPayloadLength()
Gets the RTP header length

setPayloadLength

public void setPayloadLength(int len)
Sets the RTP payload length

getVersion

public int getVersion()
Gets the version (V)

setVersion

public void setVersion(int v)
Sets the version (V)

hasPadding

public boolean hasPadding()
Whether has padding (P)

setPadding

public void setPadding(boolean p)
Set padding (P)

hasExtension

public boolean hasExtension()
Whether has extension (X)

setExtension

public void setExtension(boolean x)
Set extension (X)

getCscrCount

public int getCscrCount()
Gets the CSCR count (CC)

hasMarker

public boolean hasMarker()
Whether has marker (M)

setMarker

public void setMarker(boolean m)
Set marker (M)

getPayloadType

public int getPayloadType()
Gets the payload type (PT)

setPayloadType

public void setPayloadType(int pt)
Sets the payload type (PT)

getSequenceNumber

public int getSequenceNumber()
Gets the sequence number

setSequenceNumber

public void setSequenceNumber(int sn)
Sets the sequence number

getTimestamp

public long getTimestamp()
Gets the timestamp

setTimestamp

public void setTimestamp(long timestamp)
Sets the timestamp

getSscr

public long getSscr()
Gets the SSCR

setSscr

public void setSscr(long ssrc)
Sets the SSCR

getCscrList

public long[] getCscrList()
Gets the CSCR list

setCscrList

public void setCscrList(long[] cscr)
Sets the CSCR list

setPayload

public void setPayload(byte[] payload,
                       int len)
Sets the payload

getPayload

public byte[] getPayload()
Gets the payload

init

public void init(int ptype)
init the RTP packet header (only PT)

init

public void init(int ptype,
                 long sscr)
init the RTP packet header (PT and SSCR)

init

public void init(int ptype,
                 int seqn,
                 long timestamp,
                 long sscr)
init the RTP packet header (PT, SQN, TimeStamp, SSCR)