- merging in changes from branch

git-svn-id: http://bigbluebutton.googlecode.com/svn/trunk@2104 af16638f-c34d-0410-8cfa-b39d5352b314
This commit is contained in:
Richard Alam 2009-08-05 14:16:56 +00:00
parent b5cff6c228
commit da95e12fa8
2 changed files with 38 additions and 21 deletions

View File

@ -1,11 +1,11 @@
package org.red5.server.webapp.sip;
import org.red5.logging.Red5LoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class BufferUtils {
protected static Logger log = LoggerFactory.getLogger( RTPStreamSender.class );
protected static Logger log = Red5LoggerFactory.getLogger( RTPStreamSender.class, "sip" );
/**
@ -63,12 +63,12 @@ public class BufferUtils {
int origBufferIndex = startOrigBuffer;
int counter = 0;
println( "byteBufferIndexedCopy",
"destBuffer.length = " + destBuffer.length +
", startDestBuffer = " + startDestBuffer +
", origBuffer.length = " + origBuffer.length +
", startOrigBuffer = " + startOrigBuffer +
", copySize = " + copySize + "." );
// println( "byteBufferIndexedCopy",
/// "destBuffer.length = " + destBuffer.length +
// ", startDestBuffer = " + startDestBuffer +
// ", origBuffer.length = " + origBuffer.length +
// ", startOrigBuffer = " + startOrigBuffer +
// ", copySize = " + copySize + "." );
if ( destBuffer.length < ( startDestBuffer + copySize ) ) {
println( "byteBufferIndexedCopy", "size copy problem." );

View File

@ -218,6 +218,10 @@ public class RTPStreamReceiver extends Thread {
/** Runs it in a new Thread. */
public void run() {
int packetLength = 0;
int headerOffset = 0;
int payloadLength = 0;
if ( rtpSocket == null ) {
println( "run", "RTP socket is null." );
return;
@ -228,7 +232,6 @@ public class RTPStreamReceiver extends Thread {
tempBuffer = new float[ NELLYMOSER_DECODED_PACKET_SIZE ];
byte[] codedBuffer = new byte[ sipCodec.getIncomingEncodedFrameSize() ];
byte[] internalBuffer = new byte[
sipCodec.getIncomingEncodedFrameSize() + RTP_HEADER_SIZE ];
@ -240,13 +243,14 @@ public class RTPStreamReceiver extends Thread {
rtpSocket.getDatagramSocket().setSoTimeout( SO_TIMEOUT );
float[] decodingBuffer = new float[ sipCodec.getIncomingDecodedFrameSize() ];
int packetCount = 0;
println( "run",
"internalBuffer.length = " + internalBuffer.length
+ ", codedBuffer.length = " + codedBuffer.length
+ ", decodingBuffer.length = " + decodingBuffer.length + "." );
// println( "run",
// "internalBuffer.length = " + internalBuffer.length
// + ", codedBuffer.length = " + codedBuffer.length
// + ", decodingBuffer.length = " + decodingBuffer.length + "." );
while ( running ) {
@ -260,7 +264,14 @@ public class RTPStreamReceiver extends Thread {
int offset = rtpPacket.getHeaderLength();
int length = rtpPacket.getPayloadLength();
//println( "run",
packetLength = packetBuffer.length;
headerOffset = offset;
payloadLength = length;
float[] decodingBuffer = new float[ length ];
byte[] codedBuffer = new byte[ length ];
// println( "run",
// "pkt.length = " + packetBuffer.length
// + ", offset = " + offset
// + ", length = " + length + "." );
@ -270,7 +281,7 @@ public class RTPStreamReceiver extends Thread {
0,
packetBuffer,
offset,
sipCodec.getIncomingEncodedFrameSize() );
length );
int decodedBytes = sipCodec.codecToPcm( codedBuffer, decodingBuffer );
@ -295,6 +306,12 @@ public class RTPStreamReceiver extends Thread {
catch ( Exception e ) {
running = false;
println("run", sipCodec.getCodecName());
println( "run",
"pkt.length = " + packetLength
+ ", offset = " + headerOffset
+ ", length = " + payloadLength + "." );
println("Exception - ", e.toString());
e.printStackTrace();
}