Author: derek Date: Thu Apr 3 19:49:43 2008 New Revision: 402 Modified: sofaswitch/trunk/voip/udpconnection.cxx sofaswitch/trunk/voip/udpsound.cxx Log: Tidy it up so works with the trunk version of opal. Modified: sofaswitch/trunk/voip/udpconnection.cxx ============================================================================== --- sofaswitch/trunk/voip/udpconnection.cxx (original) +++ sofaswitch/trunk/voip/udpconnection.cxx Thu Apr 3 19:49:43 2008 @@ -153,7 +153,7 @@ void OpalUdpSsConnection::OnEstablished() { OpalConnection::OnEstablished(); - PTRACE(3, "Opal UDP SS Connection is now established. "); + PTRACE(3, "Media\tOpal UDP SS Connection is now established. "); } @@ -171,7 +171,7 @@ formats += OpalPCM16; // Sound card can only do 16 bit PCM #if OPAL_VIDEO - AddVideoMediaFormats(formats); + //AddVideoMediaFormats(formats); sound card don't do video. #endif return formats; } @@ -182,8 +182,11 @@ unsigned sessionID, bool isSource) { - if (sessionID != OpalMediaFormat::DefaultAudioSessionID) + PTRACE(3, "Sofa\tCreateMediaStream " << mediaFormat); + if (sessionID != OpalMediaFormat::DefaultAudioSessionID) { + PTRACE(3, "Sofa\tCreateMediaStream " << mediaFormat << " default one"); return OpalConnection::CreateMediaStream(mediaFormat, sessionID, isSource); + } PSoundChannel * soundChannel = CreateSoundChannel(isSource); if (soundChannel == NULL) Modified: sofaswitch/trunk/voip/udpsound.cxx ============================================================================== --- sofaswitch/trunk/voip/udpsound.cxx (original) +++ sofaswitch/trunk/voip/udpsound.cxx Thu Apr 3 19:49:43 2008 @@ -59,7 +59,7 @@ audioSocket(_myOpalCall.GetAudioSocket()), isSource(_isSource) { IncUdpSoundChannel(); - PTRACE(6, "ZZZ\tCreate UdpSoundSocket for " << GetSSLabel(isSource)); + PTRACE(6, "UDPSoundChanel\tCreate UdpSoundSocket for " << GetSSLabel(isSource)); os_handle = -2; } @@ -107,11 +107,19 @@ audioSocket.GetSendAddress(destination, dPort); - PTRACE(6, "MEDIA\tWrite " << amount << " bytes to the socket " << destination << ":" << dPort); + PTRACE(4, "MEDIA\tWrite " << amount << " bytes to the socket " << destination << ":" << dPort); } if (!IsOpen()) { PTRACE(3, "MEDIA\tWrite failed as this sound channel is closed"); + PTRACE(3, "MEDIA\tWrite failed as this sound channel is closed"); + PTRACE(3, "MEDIA\tWrite failed as this sound channel is closed"); + PTRACE(3, "MEDIA\tWrite failed as this sound channel is closed"); + PTRACE(3, "MEDIA\tWrite failed as this sound channel is closed"); + PTRACE(3, "MEDIA\tWrite failed as this sound channel is closed"); + PTRACE(3, "MEDIA\tWrite failed as this sound channel is closed"); + PTRACE(3, "MEDIA\tWrite failed as this sound channel is closed"); + PTRACE(3, "MEDIA\tWrite failed as this sound channel is closed"); return false; } @@ -123,13 +131,17 @@ audioSocket.GetSendAddress(destination, dPort); PTRACE(5, "MEDIA\tWrite destination is " << destination << " : " << dPort); PTRACE(5, "MEDIA\tThat write failed " << audioSocket.GetErrorText()); + PTRACE(5, "MEDIA\tThat write failed " << audioSocket.GetErrorText()); + PTRACE(5, "MEDIA\tThat write failed " << audioSocket.GetErrorText()); + PTRACE(5, "MEDIA\tThat write failed " << audioSocket.GetErrorText()); + PTRACE(5, "MEDIA\tThat write failed " << audioSocket.GetErrorText()); + PTRACE(5, "MEDIA\tThat write failed " << audioSocket.GetErrorText()); } delay.Delay(amount / 16); lastWriteCount = amount; - PTRACE(7, "MEDIA\tWrite to socket return " << audioSocket.IsOpen()); return audioSocket.IsOpen(); } @@ -142,8 +154,8 @@ } bool readOk = true; - PTRACE(7, "MEDIA\tNow do a read of " << amount << " bytes for " << GetSSLabel(isSource)); - PTRACE(7, "MEDIA\tThe read queue has a buffered bytes size of " << readQueue.GetLength()); + PTRACE(4, "MEDIA\tNow do a read of " << amount << " bytes for " << GetSSLabel(isSource)); + PTRACE(4, "MEDIA\tThe read queue has a buffered bytes size of " << readQueue.GetLength()); while (amount > readQueue.GetLength()) { @@ -157,7 +169,7 @@ << audioSocket.GetLastReadCount() << " bytes"); readOk = readQueue.Write(readBuffer.GetPointer(), audioSocket.GetLastReadCount()); - PTRACE(7, "The readqueue now has a size of " + PTRACE(4, "The readqueue now has a size of " << readQueue.GetLength() << " bytes"); if (!readOk) { PTRACE(3, "Failed to write incoming packet to the memory queue"); @@ -167,7 +179,7 @@ readOk = readQueue.Read(buffer, amount); lastReadCount = readQueue.GetLastReadCount(); - PTRACE(7, "Requested " << amount << " return after getting the next packet, so supply " << lastReadCount); + PTRACE(4, "Requested " << amount << " return after getting the next packet, so supply " << lastReadCount); return readOk; }