// Path: src/se/omnitor/protocol/rtp/packets/RTPPacket.java
// public class RTPPacket {
// 
//     private long csrcCount;
//     private long sequenceNumber;
//     private long timeStamp;
//     private long ssrc;
//     private byte[] data;
//     private byte markerByte;
// 
//     /**
//      * Gets the CSRC count. <br>
//      * <br>
//      * The CSRC count contains the number of CSRC identifiers that
//      * follow the fixed header.
//      *
//      * @return The CSRC count
//      */
//     public long getCsrcCount() {
// 	return csrcCount;
//     }
// 
//     /**
//      * Sets the CSRC count.
//      *
//      * @param csrcCount The CSRC count to set
//      */
//     public void setCsrcCount(long csrcCount) {
// 	this.csrcCount = csrcCount;
//     }
// 
//     /**
//      * Gets the sequence number. <br>
//      * <br>
//      * The sequence number increments by one for each RTP data packet
//      * sent, and may be used by the receiver to detect packet loss and
//      * to restore packet sequence. The initial value of the sequence
//      * number is random (unpredictable) to make known-plaintext attacks
//      * on encryption more difficult, even if the source itself does not
//      * encrypt, because the packets may flow through a translator that
//      * does.
//      *
//      * @return The sequence number
//      */
//     public long getSequenceNumber() {
// 	return sequenceNumber;
//     }
// 
//     /**
//      * Sets the sequence number
//      *
//      * @param seqNo The sequencenumber
//      */
//     public void setSequenceNumber(long seqNo) {
// 	this.sequenceNumber = seqNo;
//     }
// 
//     /**
//      * Gets the time stamp. <br>
//      * <br>
//      * The timestamp reflects the sampling instant of the first octet
//      * in the RTP data packet.
//      *
//      * @return The time stamp
//      */
//     public long getTimeStamp() {
// 	return timeStamp;
//     }
// 
//     /**
//      * Sets the time stamp
//      *
//      * @param timeStamp The time stamp to set
//      */
//     public void setTimeStamp(long timeStamp) {
// 	this.timeStamp = timeStamp;
//     }
// 
//     /**
//      * Gets the SSRC. <br>
//      * <br>
//      * The SSRC field identifies the synchronization source. This
//      * identifier is chosen randomly, with the intent that no two
//      * synchronization sources within the same RTP session will have
//      * the same SSRC identifier.
//      *
//      * @return The SSRC field
//      */
//     public long getSsrc() {
// 	return ssrc;
//     }
// 
//     /**
//      * Sets the SSRC.
//      *
//      * @param ssrc The SSRC to set
//      */
//     public void setSsrc(long ssrc) {
// 	this.ssrc = ssrc;
//     }
// 
//     /**
//      * Gets the payload, that is the actual payload contained in an RTP Packet.
//      *
//      * @return The payload data
//      */
//     public byte[] getPayloadData() {
// 	return data;
//     }
// 
//     /**
//      * Sets the payload data
//      *
//      * @param payloadData The payload data to set
//      */
//     public void setPayloadData(byte[] payloadData) {
// 	this.data = payloadData;
//     }
// 
//     /**
//      * Sets the marker bit for this packet.
//      *
//      * @param marker true = marker bit set
//      */
//     public void setMarker(boolean marker) {
// 	if(marker) {
// 	    markerByte=0x1;
// 	    return;
// 	}
// 	markerByte=0;
//     }
// 
//     /**
//      * Gets the marker bit for this packet.
//      *
//      * @return 1 if marker is set, 0 otherwise.
//      */
//     public byte getMarker() {
// 	return markerByte;
//     }
// 
// }


import se.omnitor.protocol.rtp.packets.RTPPacket;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.MulticastSocket;
import java.net.SocketException;
import java.util.Random;
import java.io.IOException;

                if (validateRTPPacketHeader(packet.getData())) {
                    long ssrc = 0;
                    int timeStamp = 0;
                    short seqNo = 0;
                    byte pt = 0;

                    pt = (byte) ((buf[1] & 0xff) & 0x7f);
                    seqNo = (short) ((buf[2] << 8) | (buf[3] & 0xff));
                    timeStamp = (((buf[4] & 0xff) << 24) |
                                 ((buf[5] & 0xff) << 16) |
                                 ((buf[6] & 0xff) << 8) |
                                 (buf[7] & 0xff));

                    ssrc = (((buf[8] & 0xff) << 24) |
                            ((buf[9] & 0xff) << 16) |
                            ((buf[10] & 0xff) << 8) |
                            (buf[11] & 0xff));

                    rtpSession.outprintln("RTP (");
                    rtpSession.outprintln("ssrc=0x" +
                                          Long.toHexString(ssrc) +
                                          "\tts=" + timeStamp +
                                          "\tseq=" + seqNo +
                                          "\tpt=" + pt);
                    rtpSession.outprintln(")");

                    // Create a RTPPacket and post it with Session.
                    // If there are any interested actionListeners, they will
                    // get it.
// Path: src/se/omnitor/protocol/rtp/packets/RTPPacket.java
// public class RTPPacket {
// 
//     private long csrcCount;
//     private long sequenceNumber;
//     private long timeStamp;
//     private long ssrc;
//     private byte[] data;
//     private byte markerByte;
// 
//     /**
//      * Gets the CSRC count. <br>
//      * <br>
//      * The CSRC count contains the number of CSRC identifiers that
//      * follow the fixed header.
//      *
//      * @return The CSRC count
//      */
//     public long getCsrcCount() {
// 	return csrcCount;
//     }
// 
//     /**
//      * Sets the CSRC count.
//      *
//      * @param csrcCount The CSRC count to set
//      */
//     public void setCsrcCount(long csrcCount) {
// 	this.csrcCount = csrcCount;
//     }
// 
//     /**
//      * Gets the sequence number. <br>
//      * <br>
//      * The sequence number increments by one for each RTP data packet
//      * sent, and may be used by the receiver to detect packet loss and
//      * to restore packet sequence. The initial value of the sequence
//      * number is random (unpredictable) to make known-plaintext attacks
//      * on encryption more difficult, even if the source itself does not
//      * encrypt, because the packets may flow through a translator that
//      * does.
//      *
//      * @return The sequence number
//      */
//     public long getSequenceNumber() {
// 	return sequenceNumber;
//     }
// 
//     /**
//      * Sets the sequence number
//      *
//      * @param seqNo The sequencenumber
//      */
//     public void setSequenceNumber(long seqNo) {
// 	this.sequenceNumber = seqNo;
//     }
// 
//     /**
//      * Gets the time stamp. <br>
//      * <br>
//      * The timestamp reflects the sampling instant of the first octet
//      * in the RTP data packet.
//      *
//      * @return The time stamp
//      */
//     public long getTimeStamp() {
// 	return timeStamp;
//     }
// 
//     /**
//      * Sets the time stamp
//      *
//      * @param timeStamp The time stamp to set
//      */
//     public void setTimeStamp(long timeStamp) {
// 	this.timeStamp = timeStamp;
//     }
// 
//     /**
//      * Gets the SSRC. <br>
//      * <br>
//      * The SSRC field identifies the synchronization source. This
//      * identifier is chosen randomly, with the intent that no two
//      * synchronization sources within the same RTP session will have
//      * the same SSRC identifier.
//      *
//      * @return The SSRC field
//      */
//     public long getSsrc() {
// 	return ssrc;
//     }
// 
//     /**
//      * Sets the SSRC.
//      *
//      * @param ssrc The SSRC to set
//      */
//     public void setSsrc(long ssrc) {
// 	this.ssrc = ssrc;
//     }
// 
//     /**
//      * Gets the payload, that is the actual payload contained in an RTP Packet.
//      *
//      * @return The payload data
//      */
//     public byte[] getPayloadData() {
// 	return data;
//     }
// 
//     /**
//      * Sets the payload data
//      *
//      * @param payloadData The payload data to set
//      */
//     public void setPayloadData(byte[] payloadData) {
// 	this.data = payloadData;
//     }
// 
//     /**
//      * Sets the marker bit for this packet.
//      *
//      * @param marker true = marker bit set
//      */
//     public void setMarker(boolean marker) {
// 	if(marker) {
// 	    markerByte=0x1;
// 	    return;
// 	}
// 	markerByte=0;
//     }
// 
//     /**
//      * Gets the marker bit for this packet.
//      *
//      * @return 1 if marker is set, 0 otherwise.
//      */
//     public byte getMarker() {
// 	return markerByte;
//     }
// 
// }


// Path: src/se/omnitor/protocol/rtp/RTPThreadHandler.java
import se.omnitor.protocol.rtp.packets.RTPPacket;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.MulticastSocket;
import java.net.SocketException;
import java.util.Random;
import java.io.IOException;


                if (validateRTPPacketHeader(packet.getData())) {
                    long ssrc = 0;
                    int timeStamp = 0;
                    short seqNo = 0;
                    byte pt = 0;

                    pt = (byte) ((buf[1] & 0xff) & 0x7f);
                    seqNo = (short) ((buf[2] << 8) | (buf[3] & 0xff));
                    timeStamp = (((buf[4] & 0xff) << 24) |
                                 ((buf[5] & 0xff) << 16) |
                                 ((buf[6] & 0xff) << 8) |
                                 (buf[7] & 0xff));

                    ssrc = (((buf[8] & 0xff) << 24) |
                            ((buf[9] & 0xff) << 16) |
                            ((buf[10] & 0xff) << 8) |
                            (buf[11] & 0xff));

                    rtpSession.outprintln("RTP (");
                    rtpSession.outprintln("ssrc=0x" +
                                          Long.toHexString(ssrc) +
                                          "\tts=" + timeStamp +
                                          "\tseq=" + seqNo +
                                          "\tpt=" + pt);
                    rtpSession.outprintln(")");

                    // Create a RTPPacket and post it with Session.
                    // If there are any interested actionListeners, they will
                    // get it.
                    RTPPacket rtppkt = new RTPPacket();