Author: derek Date: Wed Aug 1 18:00:24 2007 New Revision: 383 Modified: sofaswitch/trunk/voip/udpsound.cxx Log: reporting thing. Modified: sofaswitch/trunk/voip/udpsound.cxx ============================================================================== --- sofaswitch/trunk/voip/udpsound.cxx (original) +++ sofaswitch/trunk/voip/udpsound.cxx Wed Aug 1 18:00:24 2007 @@ -82,7 +82,7 @@ return FALSE; } - PTRACE(3, "Sound\t open for a direction of " << dir << " and for " << GetSSLabel(isSource)); + PTRACE(3, "MEDIASound\t open for a direction of " << dir << " and for " << GetSSLabel(isSource)); os_handle = 65535; //This is way bigger than it will ever go. //However, it will pass all the pwlib tests of > 0 @@ -101,28 +101,29 @@ BOOL UdpSoundChannel::Write(const void * buffer, PINDEX amount) { - PTRACE(6, "Write " << amount << " bytes to the socket"); + PTRACE(6, "MEDIA\tWrite " << amount << " bytes to the socket"); if (!IsOpen()) { - PTRACE(3, "Write failed as this sound channel is closed"); + PTRACE(3, "MEDIA\tWrite failed as this sound channel is closed"); return FALSE; } BOOL res = audioSocket.Write(buffer, amount); if (res) { - PTRACE(5, "Write succeeded"); + PTRACE(5, "MEDIA\tWrite succeeded"); } else { WORD dPort; PIPSocket::Address destination; audioSocket.GetSendAddress(destination, dPort); - PTRACE(5, "Write destination is " << destination << " : " << dPort); - PTRACE(5, "That write failed " << audioSocket.GetErrorText()); + PTRACE(5, "MEDIA\tWrite destination is " << destination << " : " << dPort); + PTRACE(5, "MEDIA\tThat write failed " << audioSocket.GetErrorText()); } delay.Delay(amount / 16); lastWriteCount = amount; - + + PTRACE(5, "MEDIA\tWrite to socket return " << audioSocket.IsOpen()); return audioSocket.IsOpen(); } @@ -130,21 +131,21 @@ BOOL UdpSoundChannel::Read(void * buffer, PINDEX amount) { if (!IsOpen()) { - PTRACE(3, "Read failed as this sound channel is closed"); + PTRACE(3, "MEDIA\tRead failed as this sound channel is closed"); return FALSE; } BOOL readOk = TRUE; - PTRACE(5, "Now do a read of " << amount << " bytes for " << GetSSLabel(isSource)); - PTRACE(5, "The read queue has a buffered bytes size of " << readQueue.GetLength()); + PTRACE(5, "MEDIA\tNow do a read of " << amount << " bytes for " << GetSSLabel(isSource)); + PTRACE(5, "MEDIA\tThe read queue has a buffered bytes size of " << readQueue.GetLength()); while (amount > readQueue.GetLength()) { PTRACE(5, "The internal buffer has insufficient bytes, as " << readQueue.GetLength() << " is less than " << amount); - PTRACE(5, "Grab some extra bytes from the socket"); + PTRACE(5, "MEDIA\tGrab some extra bytes from the socket"); readOk = audioSocket.Read(readBuffer.GetPointer(), 480); if (!readOk) { - PTRACE(1, "The read of a packet from a socket failed for " << GetSSLabel(isSource)); + PTRACE(1, "MEDIA\tThe read of a packet from a socket failed for " << GetSSLabel(isSource)); return FALSE; } PTRACE(5, "The socket provided us with " << audioSocket.GetLastReadCount() << " bytes");