Class PacketHandler
Class PacketHandler
java.lang.Object
|
+----PacketHandler
- public class PacketHandler
- extends Object
RTP Packet Handler contains methods to assemble and disassemble
incoming RTP packets received over the RTP multicast receiver socket
-
PacketHandler(MenuWindow)
- Constructor function to randomly generate sequence number,
timestamp and SSRC.
-
assemble(byte[])
- Assembles data passed from Chat Tool or Whiteboard module with
RTP header.
-
disassemble(DatagramPacket)
- Segments the RTP header from the data portion of the incoming
RTP packet, before updating a vector for keeping track of the
number of active senders during a particular transmission
interval.
-
getRTP_Header()
- returns RTP header obtained from the disassemble function of
this class
-
updateActiveSenderVec(int)
- Checks whether the SSRC read from the incoming packet is
already present in the vector.
PacketHandler
public PacketHandler(MenuWindow parent)
- Constructor function to randomly generate sequence number,
timestamp and SSRC. The SSRC generated is stored in the
StateInfo class for reference by other parts of the program.
disassemble
public byte[] disassemble(DatagramPacket pkt)
- Segments the RTP header from the data portion of the incoming
RTP packet, before updating a vector for keeping track of the
number of active senders during a particular transmission
interval. The RTP header is then stored and can be retrieved
using getRTP_Header.
updateActiveSenderVec
public void updateActiveSenderVec(int SSRCRead)
- Checks whether the SSRC read from the incoming packet is
already present in the vector. If not, add on to the vector
and increment the variable : activeSenders.
assemble
public byte[] assemble(byte data_buf[])
- Assembles data passed from Chat Tool or Whiteboard module with
RTP header. Function also pads data to 32-bit boundary and sets
the padding bit of the header to 1 accordingly.
@ return array of bytes pertaining to the assembled packet.
getRTP_Header
public RTP_Header getRTP_Header()
- returns RTP header obtained from the disassemble function of
this class