SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.media.transform.srtp
Class PacketManipulator

java.lang.Object
  extended by net.java.sip.communicator.impl.media.transform.srtp.PacketManipulator

public class PacketManipulator
extends Object

PacketManipulator contains methods for parsing RTP packets. It is used to get certain RTP packet field from a RawPacket, which holds the content of a RTP packet. Because all the methods operates on certain RawPacket, all methods in this class are static methods.

Author:
Bing SU (nova.su@gmail.com)

Constructor Summary
PacketManipulator()
           
 
Method Summary
static int GetRTPHeaderLength(RawPacket pkt)
          Get RTP header length from a RTP packet
static int GetRTPPaddingSize(RawPacket pkt)
          Get RTP padding size from a RTP packet
static int GetRTPPayloadLength(RawPacket pkt)
          Get RTP payload length from a RTP packet
static byte GetRTPPayloadType(RawPacket pkt)
          Get RTP payload type from a RTP packet
static int GetRTPSequenceNumber(RawPacket pkt)
          Get RTP sequence number from a RTP packet
static long GetRTPSSRC(RawPacket pkt)
          Get RTP SSRC from a RTP packet
static boolean IsPacketMarked(RawPacket pkt)
          Test whether if a RTP packet is padded
static byte[] ReadTimeStampIntoByteArray(RawPacket pkt)
          Get RTP timestamp from a RTP packet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PacketManipulator

public PacketManipulator()
Method Detail

GetRTPPaddingSize

public static int GetRTPPaddingSize(RawPacket pkt)
Get RTP padding size from a RTP packet

Parameters:
pkt - the source RTP packet
Returns:
RTP padding size from source RTP packet

GetRTPHeaderLength

public static int GetRTPHeaderLength(RawPacket pkt)
Get RTP header length from a RTP packet

Parameters:
pkt - the source RTP packet
Returns:
RTP header length from source RTP packet

GetRTPPayloadLength

public static int GetRTPPayloadLength(RawPacket pkt)
Get RTP payload length from a RTP packet

Parameters:
pkt - the source RTP packet
Returns:
RTP payload length from source RTP packet

GetRTPSSRC

public static long GetRTPSSRC(RawPacket pkt)
Get RTP SSRC from a RTP packet

Parameters:
pkt - the source RTP packet
Returns:
RTP SSRC from source RTP packet

GetRTPSequenceNumber

public static int GetRTPSequenceNumber(RawPacket pkt)
Get RTP sequence number from a RTP packet

Parameters:
pkt - the source RTP packet
Returns:
RTP sequence num from source packet

IsPacketMarked

public static boolean IsPacketMarked(RawPacket pkt)
Test whether if a RTP packet is padded

Parameters:
pkt - the source RTP packet
Returns:
whether if source RTP packet is padded

GetRTPPayloadType

public static byte GetRTPPayloadType(RawPacket pkt)
Get RTP payload type from a RTP packet

Parameters:
pkt - the source RTP packet
Returns:
RTP payload type of source RTP packet

ReadTimeStampIntoByteArray

public static byte[] ReadTimeStampIntoByteArray(RawPacket pkt)
Get RTP timestamp from a RTP packet

Parameters:
pkt - the source RTP packet
Returns:
RTP timestamp of source RTP packet

SIP Communicator: the OpenSource Java VoIP and Instant Messaging client.

SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.