Examples of RtpPacket


Examples of org.bigbluebutton.voiceconf.red5.media.net.RtpPacket

   
    public void receiveRtpPackets() {   
        int packetReceivedCounter = 0;
        int internalBufferLength = payloadLength + RTP_HEADER_SIZE;
        byte[] internalBuffer = new byte[internalBufferLength];
        RtpPacket rtpPacket = new RtpPacket(internalBuffer, internalBufferLength);;
       
        while (receivePackets) {
          try {            
            rtpSocket.receive(rtpPacket);           
            packetReceivedCounter++; 
            if (shouldDropDelayedPacket(rtpPacket)) {
              continue;
            }
            if (rtpPacket.isRtcpPacket()) {
              /**
               * Asterisk (1.6.2.5) send RTCP packets. We just ignore them (for now).
               * It could be for KeepAlive (http://tools.ietf.org/html/draft-ietf-avt-app-rtp-keepalive-09)
               */
              if (log.isDebugEnabled())
                log.debug("RTCP packet [" + rtpPacket.getRtcpPayloadType() + ", length=" + rtpPacket.getPayloadLength() + "] seqNum[rtpSeqNum=" + rtpPacket.getSeqNum() + ",lastSeqNum=" + lastSequenceNumber
                  + "][rtpTS=" + rtpPacket.getTimestamp() + ",lastTS=" + lastPacketTimestamp + "][port=" + rtpSocket.getDatagramSocket().getLocalPort() + "]");               
            } else {
                if (shouldHandlePacket(rtpPacket)) {                               
                  lastSequenceNumber = rtpPacket.getSeqNum();
                  lastPacketTimestamp = rtpPacket.getTimestamp();
                  processRtpPacket(internalBuffer, RTP_HEADER_SIZE, rtpPacket.getPayloadLength());
                } else {
                  if (log.isDebugEnabled())
                    log.debug("Corrupt packet [" + rtpPacket.getRtcpPayloadType() + "," + rtpPacket.getPayloadType() + ", length=" + rtpPacket.getPayloadLength() + "] seqNum[rtpSeqNum=" + rtpPacket.getSeqNum() + ",lastSeqNum=" + lastSequenceNumber
                      + "][rtpTS=" + rtpPacket.getTimestamp() + ",lastTS=" + lastPacketTimestamp + "][port=" + rtpSocket.getDatagramSocket().getLocalPort() + "]");                            

                  if (lastPacketDropped) successivePacketDroppedCount++;
                  else lastPacketDropped = true;                
                }
              }
View Full Code Here

Examples of org.bigbluebutton.voiceconf.red5.media.net.RtpPacket

    }
   
    public void sendAudio(byte[] audioData, int codecId, long timestamp) {
      byte[] transcodedAudioDataBuffer = new byte[audioData.length + RTP_HEADER_SIZE];
      System.arraycopy(audioData, 0, transcodedAudioDataBuffer, RTP_HEADER_SIZE, audioData.length);
      RtpPacket rtpPacket = new RtpPacket(transcodedAudioDataBuffer, transcodedAudioDataBuffer.length);
      if (!marked) {
        rtpPacket.setMarker(true);
        marked = true;
        startTimestamp = System.currentTimeMillis();
      }
      rtpPacket.setPadding(false);
      rtpPacket.setExtension(false);
        rtpPacket.setPayloadType(codecId);
      rtpPacket.setSeqNum(sequenceNum++);  
      rtpPacket.setTimestamp(timestamp);
        rtpPacket.setPayloadLength(audioData.length);
        try {
      rtpSocketSend(rtpPacket);
    } catch (StreamException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.