org.objectweb.jonathan.protocols.rtp
Class RTPHeader

java.lang.Object
  extended by org.objectweb.jonathan.protocols.rtp.RTPHeader

public final class RTPHeader
extends Object

RTPHeader is a utility class representing a RTP header


Field Summary
static int length
          the length in byte of a RTP header
 boolean marker
          the marker status
 byte payload
          the type of payload
 short sequence_no
          the sequence number of the RTP packet
 int source_id
          the source id of the RTP packet
 int timestamp
          the timestamp of the RTP packet
 
Constructor Summary
RTPHeader()
          Build a new uninitialized RTP header
RTPHeader(UnMarshaller msg)
          Build a new RTP header from an input message
 
Method Summary
 void decode(UnMarshaller msg)
          Initialize a RTP header from an input message
 void encode(byte[] array)
          Marshalls the RTP header into an output message
 String toString()
          Returns a string describing the contents of the RTP header
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

length

public static int length
the length in byte of a RTP header


payload

public byte payload
the type of payload


marker

public boolean marker
the marker status


sequence_no

public short sequence_no
the sequence number of the RTP packet


timestamp

public int timestamp
the timestamp of the RTP packet


source_id

public int source_id
the source id of the RTP packet

Constructor Detail

RTPHeader

public RTPHeader()
Build a new uninitialized RTP header


RTPHeader

public RTPHeader(UnMarshaller msg)
          throws org.objectweb.jonathan.apis.kernel.JonathanException
Build a new RTP header from an input message

Parameters:
msg - the input message from which the RTP header will be extracted
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - thrown if the unmarshalling fails
Method Detail

decode

public void decode(UnMarshaller msg)
            throws org.objectweb.jonathan.apis.kernel.JonathanException
Initialize a RTP header from an input message

Parameters:
msg - the input message from which the RTP header will be extracted
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - thrown if the unmarshalling fails

encode

public void encode(byte[] array)
            throws org.objectweb.jonathan.apis.kernel.JonathanException
Marshalls the RTP header into an output message

Parameters:
msg - an array of bytes at least of size 12 where the RTP header should be encoded
Throws:
org.objectweb.jonathan.apis.kernel.JonathanException - if an error occurs.

toString

public String toString()
Returns a string describing the contents of the RTP header

Overrides:
toString in class Object
Returns:
String a string describing the contents of the RTP header