diff options
Diffstat (limited to 'orkaudio/audiocaptureplugins')
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/Rtp.cpp | 248 | ||||
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/Rtp.h | 36 | ||||
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/RtpSession.cpp | 3 | ||||
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/RtpSession.h | 5 | ||||
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/VoIp.dsp | 8 | ||||
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/g711.c | 285 | ||||
-rw-r--r-- | orkaudio/audiocaptureplugins/voip/g711.h | 21 |
7 files changed, 7 insertions, 599 deletions
diff --git a/orkaudio/audiocaptureplugins/voip/Rtp.cpp b/orkaudio/audiocaptureplugins/voip/Rtp.cpp index 49d0815..76971d4 100644 --- a/orkaudio/audiocaptureplugins/voip/Rtp.cpp +++ b/orkaudio/audiocaptureplugins/voip/Rtp.cpp @@ -13,18 +13,8 @@ #define _WINSOCKAPI_ // prevents the inclusion of winsock.h -#include "Utils.h" +#include "ace/OS_NS_arpa_inet.h" #include "Rtp.h" -#include "AudioCapturePlugin.h" -#include "AudioCapturePluginCommon.h" -#include "PacketHeaderDefs.h" -#include "assert.h" - -extern "C" -{ -#include "g711.h" -} -extern AudioChunkCallBackFunction g_audioChunkCallBack; void RtpPacketInfo::ToString(CStdString& string) @@ -36,239 +26,3 @@ void RtpPacketInfo::ToString(CStdString& string) string.Format("%s,%d %s,%d seq:%u ts:%u len:%d type:%x", sourceIp, m_sourcePort, destIp, m_destPort, m_seqNum, m_timestamp, m_payloadSize, m_payloadType); } -//============================================================================== - -RtpRingBuffer::RtpRingBuffer() -{ - m_writePtr = m_buffer; - m_readPtr = m_buffer; - m_bufferEnd = m_buffer + NUM_SAMPLES_CIRCULAR_BUFFER; - m_writeTimestamp = 0; - m_readTimestamp = 0; - m_log = Logger::getLogger("rtpringbuffer"); - m_shippedSamples = 0; -} - - -void RtpRingBuffer::AddRtpPacket(RtpPacketInfoRef& rtpInfo) -{ - unsigned int rtpEndTimestamp = rtpInfo->m_timestamp + rtpInfo->m_payloadSize; - - if(m_writeTimestamp == 0) - { - // First RTP packet of the session - LOG4CXX_DEBUG(m_log, m_capturePort + " first packet"); - m_writeTimestamp = rtpInfo->m_timestamp; - m_readTimestamp = m_writeTimestamp; - StoreRtpPacket(rtpInfo); - } - else if (rtpInfo->m_timestamp >= m_readTimestamp) // drop packets that are older than last shipment - { - if( (int)(rtpEndTimestamp - m_writeTimestamp) <= (int)FreeSpace()) - { - // RTP packet fits into current buffer - StoreRtpPacket(rtpInfo); - - if(UsedSpace() > NUM_SAMPLES_TRIGGER) - { - // We have enough stuff, make a shipment - CreateShipment(0); - } - } - else - { - // RTP packet does not fit into current buffer - // work out how much silence we need to add to the current buffer when shipping - size_t silenceSize = rtpInfo->m_timestamp - m_writeTimestamp; - CreateShipment(silenceSize); - - // reset buffer - m_writePtr = m_buffer; - m_readPtr = m_buffer; - m_writeTimestamp = rtpInfo->m_timestamp; - m_readTimestamp = m_writeTimestamp; - - // Store new packet - StoreRtpPacket(rtpInfo); - } - } - else - { - LOG4CXX_DEBUG(m_log, m_capturePort + " packet too old, dropped"); - } - CStdString debug; - debug.Format("free:%u used:%u wr:%x rd:%x wrts:%u rdts:%d", FreeSpace(), UsedSpace(), m_writePtr, m_readPtr, m_writeTimestamp, m_readTimestamp); - LOG4CXX_DEBUG(m_log, debug); -} - -// Writes to the internal buffer without any size verification -void RtpRingBuffer::StoreRtpPacket(RtpPacketInfoRef& rtpInfo) -{ - CStdString debug; - - // 1. Silence from write pointer until end of RTP packet - unsigned int endRtpTimestamp = rtpInfo->m_timestamp + rtpInfo->m_payloadSize; - if (endRtpTimestamp > m_writeTimestamp) - { - for(int i=0; i<(endRtpTimestamp - m_writeTimestamp); i++) - { - *m_writePtr = 0; - m_writePtr++; - if(m_writePtr >= m_bufferEnd) - { - m_writePtr = m_buffer; - } - } - int silenceSize = endRtpTimestamp - m_writeTimestamp; - m_writeTimestamp = endRtpTimestamp; - debug.Format("Zeroed %d samples, wr:%x wrts:%u", silenceSize, m_writePtr, m_writeTimestamp); - LOG4CXX_DEBUG(m_log, debug); - } - - // 2. Mix in the latest samples from this RTP packet - unsigned int timestampDelta = m_writeTimestamp - rtpInfo->m_timestamp; - ASSERT(timestampDelta>=0); - short* tempWritePtr = CicularPointerSubtractOffset(m_writePtr, timestampDelta); - unsigned char* payload = rtpInfo->m_payload; - - for(int i=0; i<rtpInfo->m_payloadSize ; i++) - { - if(rtpInfo->m_payloadType == RTP_PT_PCMA) - { - *tempWritePtr += (short)alaw2linear(payload[i]); - } - else if(rtpInfo->m_payloadType == RTP_PT_PCMU) - { - *tempWritePtr += (short)ulaw2linear(payload[i]); - } - tempWritePtr++; - if(tempWritePtr >= m_bufferEnd) - { - tempWritePtr = m_buffer; - } - } - debug.Format("Copied %d samples, tmpwr:%x", rtpInfo->m_payloadSize, tempWritePtr); - LOG4CXX_DEBUG(m_log, debug); -} - -short* RtpRingBuffer::CircularPointerAddOffset(short *ptr, size_t offset) -{ - if((ptr + offset) >= m_bufferEnd) - { - return m_buffer + offset - (m_bufferEnd-ptr); - } - else - { - return ptr + offset; - } -} - -short* RtpRingBuffer::CicularPointerSubtractOffset(short *ptr, size_t offset) -{ - if((ptr-offset) < m_buffer) - { - return m_bufferEnd - offset + (ptr-m_buffer); - } - else - { - return ptr - offset; - } -} - -void RtpRingBuffer::CreateShipment(size_t silenceSize) -{ - // 1. ship from readPtr until stop pointer or until end of buffer if wrapped - bool bufferWrapped = false; - short* stopPtr = NULL; - short* wrappedStopPtr = NULL; - if (silenceSize) - { - // There is additional silence to ship, do not take holdoff into account - stopPtr = m_writePtr; - } - else - { - stopPtr = CicularPointerSubtractOffset(m_writePtr, NUM_SAMPLES_SHIPMENT_HOLDOFF); - } - - if (stopPtr < m_readPtr) - { - wrappedStopPtr = stopPtr; - stopPtr = m_bufferEnd; - bufferWrapped = true; - } - size_t shortSize = stopPtr-m_readPtr; - size_t byteSize = shortSize*2; - AudioChunkRef chunk(new AudioChunk()); - AudioChunkDetails details; - details.m_encoding = PcmAudio; - chunk->SetBuffer((void*)m_readPtr, byteSize, details); - g_audioChunkCallBack(chunk, m_capturePort); - m_shippedSamples += shortSize; - m_readPtr = CircularPointerAddOffset(m_readPtr ,shortSize); - m_readTimestamp += shortSize; - - CStdString debug; - debug.Format("Ship %d samples, rd:%x rdts:%u", shortSize, m_readPtr, m_readTimestamp); - LOG4CXX_DEBUG(m_log, debug); - - - // 2. ship from beginning of buffer until stop ptr - if(bufferWrapped) - { - shortSize = wrappedStopPtr - m_buffer; - byteSize = shortSize*2; - chunk.reset(new AudioChunk()); - AudioChunkDetails details; - details.m_encoding = PcmAudio; - chunk->SetBuffer((void*)m_buffer, byteSize, details); - g_audioChunkCallBack(chunk, m_capturePort); - m_shippedSamples += shortSize; - m_readPtr = CircularPointerAddOffset(m_readPtr ,shortSize); - m_readTimestamp += shortSize; - debug.Format("Ship wrapped %d samples, rd:%x rdts:%u", shortSize, m_readPtr, m_readTimestamp); - LOG4CXX_DEBUG(m_log, debug); - } - - // 3. ship silence - if (silenceSize) - { - byteSize = silenceSize*2; - char* silenceBuffer = (char*)calloc(byteSize, 1); - if (silenceBuffer) - { - AudioChunkRef chunk(new AudioChunk()); - AudioChunkDetails details; - details.m_encoding = PcmAudio; - chunk->SetBuffer((void*)silenceBuffer, byteSize, details); - g_audioChunkCallBack(chunk, m_capturePort); - m_shippedSamples += silenceSize; - m_readPtr = CircularPointerAddOffset(m_readPtr ,silenceSize); - m_readTimestamp += silenceSize; - } - debug.Format("Ship %d silence samples, rd:%x rdts:%u", silenceSize, m_readPtr, m_readTimestamp); - LOG4CXX_DEBUG(m_log, debug); - } -} - - -unsigned int RtpRingBuffer::UsedSpace() -{ - if(m_writePtr >= m_readPtr) - { - return m_writePtr - m_readPtr; - } - return NUM_SAMPLES_CIRCULAR_BUFFER + m_writePtr - m_readPtr; -} - - -unsigned int RtpRingBuffer::FreeSpace() -{ - return NUM_SAMPLES_CIRCULAR_BUFFER - UsedSpace(); -} - -void RtpRingBuffer::SetCapturePort(CStdString& port) -{ - m_capturePort = port; -} - diff --git a/orkaudio/audiocaptureplugins/voip/Rtp.h b/orkaudio/audiocaptureplugins/voip/Rtp.h index a846c5f..53b4d00 100644 --- a/orkaudio/audiocaptureplugins/voip/Rtp.h +++ b/orkaudio/audiocaptureplugins/voip/Rtp.h @@ -14,14 +14,8 @@ #ifndef __RTP_H__ #define __RTP_H__ -#include "AudioCapture.h" #include "boost/shared_ptr.hpp" #include "StdString.h" -#include "LogManager.h" - -#define NUM_SAMPLES_CIRCULAR_BUFFER 8000 -#define NUM_SAMPLES_TRIGGER 4000 // when we have this number of available samples make a shipment -#define NUM_SAMPLES_SHIPMENT_HOLDOFF 2000 // when shipping, ship everything but this number of samples // useful info we extract from an RTP packet @@ -46,35 +40,5 @@ public: typedef boost::shared_ptr<RtpPacketInfo> RtpPacketInfoRef; -// Ring buffer based on RTP timestamps -// Gathers both sides of the conversation and mixes them into single channel -// Robust to silence suppression -// Supports RTP buffers of arbitrary sizes in both directions. -class RtpRingBuffer -{ -public: - RtpRingBuffer(); - void AddRtpPacket(RtpPacketInfoRef&); - void SetCapturePort(CStdString& port); -private: - void StoreRtpPacket(RtpPacketInfoRef&); - void CreateShipment(size_t silenceSize); - unsigned int FreeSpace(); - unsigned int UsedSpace(); - short* GetHoldOffPtr(); - short* CircularPointerAddOffset(short *ptr, size_t offset); - short* CicularPointerSubtractOffset(short *ptr, size_t offset); - - short* m_writePtr; // pointer after newest RTP data we've received - short* m_readPtr; // where to read from next - unsigned int m_readTimestamp; // timestamp that the next shipment will have - unsigned int m_writeTimestamp; // timestamp that the next RTP buffer should have - short* m_bufferEnd; - short m_buffer[NUM_SAMPLES_CIRCULAR_BUFFER]; - CStdString m_capturePort; - LoggerPtr m_log; - unsigned int m_shippedSamples; -}; - #endif diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp index f7e3114..f05ec17 100644 --- a/orkaudio/audiocaptureplugins/voip/RtpSession.cpp +++ b/orkaudio/audiocaptureplugins/voip/RtpSession.cpp @@ -17,6 +17,7 @@ #define RTP_WITH_SIGNALLING_SESSION_TIMEOUT (5*60) #include "Utils.h" +#include "AudioCapture.h" #include "RtpSession.h" #include "AudioCapturePlugin.h" #include "AudioCapturePluginCommon.h" @@ -67,7 +68,7 @@ void RtpSession::Stop() void RtpSession::Start() { m_started = true; - m_rtpRingBuffer.SetCapturePort(m_capturePort); + //m_rtpRingBuffer.SetCapturePort(m_capturePort); CaptureEventRef startEvent(new CaptureEvent); startEvent->m_type = CaptureEvent::EtStart; startEvent->m_timestamp = time(NULL); diff --git a/orkaudio/audiocaptureplugins/voip/RtpSession.h b/orkaudio/audiocaptureplugins/voip/RtpSession.h index 1461f8e..194db61 100644 --- a/orkaudio/audiocaptureplugins/voip/RtpSession.h +++ b/orkaudio/audiocaptureplugins/voip/RtpSession.h @@ -14,12 +14,15 @@ #ifndef __RTPSESSION_H__ #define __RTPSESSION_H__ +#include <log4cxx/logger.h> #include "RtpSession.h" #include "Rtp.h" #include <map> #include "ace/Singleton.h" #include "PacketHeaderDefs.h" +using namespace log4cxx; + class SipInviteInfo { public: @@ -108,7 +111,7 @@ private: RtpPacketInfoRef m_lastRtpPacket; RtpPacketInfoRef m_lastRtpPacketSide1; RtpPacketInfoRef m_lastRtpPacketSide2; - RtpRingBuffer m_rtpRingBuffer; + //RtpRingBuffer m_rtpRingBuffer; struct in_addr m_invitorIp; int m_invitorTcpPort; struct in_addr m_inviteeIp; diff --git a/orkaudio/audiocaptureplugins/voip/VoIp.dsp b/orkaudio/audiocaptureplugins/voip/VoIp.dsp index 57ac7a3..a14363d 100644 --- a/orkaudio/audiocaptureplugins/voip/VoIp.dsp +++ b/orkaudio/audiocaptureplugins/voip/VoIp.dsp @@ -108,14 +108,6 @@ SOURCE=..\..\ConfigManager.h # End Source File # Begin Source File -SOURCE=.\g711.c -# End Source File -# Begin Source File - -SOURCE=.\g711.h -# End Source File -# Begin Source File - SOURCE=.\PacketHeaderDefs.cpp # End Source File # Begin Source File diff --git a/orkaudio/audiocaptureplugins/voip/g711.c b/orkaudio/audiocaptureplugins/voip/g711.c deleted file mode 100644 index 7317dbb..0000000 --- a/orkaudio/audiocaptureplugins/voip/g711.c +++ /dev/null @@ -1,285 +0,0 @@ -/* - * This source code is a product of Sun Microsystems, Inc. and is provided - * for unrestricted use. Users may copy or modify this source code without - * charge. - * - * SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING - * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR - * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. - * - * Sun source code is provided with no support and without any obligation on - * the part of Sun Microsystems, Inc. to assist in its use, correction, - * modification or enhancement. - * - * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE - * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE - * OR ANY PART THEREOF. - * - * In no event will Sun Microsystems, Inc. be liable for any lost revenue - * or profits or other special, indirect and consequential damages, even if - * Sun has been advised of the possibility of such damages. - * - * Sun Microsystems, Inc. - * 2550 Garcia Avenue - * Mountain View, California 94043 - */ - -#include "g711.h" - -/* - * g711.c - * - * u-law, A-law and linear PCM conversions. - */ -#define SIGN_BIT (0x80) /* Sign bit for a A-law byte. */ -#define QUANT_MASK (0xf) /* Quantization field mask. */ -#define NSEGS (8) /* Number of A-law segments. */ -#define SEG_SHIFT (4) /* Left shift for segment number. */ -#define SEG_MASK (0x70) /* Segment field mask. */ - -static short seg_end[8] = {0xFF, 0x1FF, 0x3FF, 0x7FF, - 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF}; - -/* copy from CCITT G.711 specifications */ -unsigned char _u2a[128] = { /* u- to A-law conversions */ - 1, 1, 2, 2, 3, 3, 4, 4, - 5, 5, 6, 6, 7, 7, 8, 8, - 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, - 25, 27, 29, 31, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, - 46, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, - 64, 65, 66, 67, 68, 69, 70, 71, - 72, 73, 74, 75, 76, 77, 78, 79, - 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, - 121, 122, 123, 124, 125, 126, 127, 128}; - -unsigned char _a2u[128] = { /* A- to u-law conversions */ - 1, 3, 5, 7, 9, 11, 13, 15, - 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, - 32, 32, 33, 33, 34, 34, 35, 35, - 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 48, 49, 49, - 50, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 64, 64, - 65, 66, 67, 68, 69, 70, 71, 72, - 73, 74, 75, 76, 77, 78, 79, 79, - 80, 81, 82, 83, 84, 85, 86, 87, - 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 102, 103, - 104, 105, 106, 107, 108, 109, 110, 111, - 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127}; - -static int -search( - int val, - short *table, - int size) -{ - int i; - - for (i = 0; i < size; i++) { - if (val <= *table++) - return (i); - } - return (size); -} - -/* - * linear2alaw() - Convert a 16-bit linear PCM value to 8-bit A-law - * - * linear2alaw() accepts an 16-bit integer and encodes it as A-law data. - * - * Linear Input Code Compressed Code - * ------------------------ --------------- - * 0000000wxyza 000wxyz - * 0000001wxyza 001wxyz - * 000001wxyzab 010wxyz - * 00001wxyzabc 011wxyz - * 0001wxyzabcd 100wxyz - * 001wxyzabcde 101wxyz - * 01wxyzabcdef 110wxyz - * 1wxyzabcdefg 111wxyz - * - * For further information see John C. Bellamy's Digital Telephony, 1982, - * John Wiley & Sons, pps 98-111 and 472-476. - */ -unsigned char -linear2alaw( - int pcm_val) /* 2's complement (16-bit range) */ -{ - int mask; - int seg; - unsigned char aval; - - if (pcm_val >= 0) { - mask = 0xD5; /* sign (7th) bit = 1 */ - } else { - mask = 0x55; /* sign bit = 0 */ - pcm_val = -pcm_val - 8; - } - - /* Convert the scaled magnitude to segment number. */ - seg = search(pcm_val, seg_end, 8); - - /* Combine the sign, segment, and quantization bits. */ - - if (seg >= 8) /* out of range, return maximum value. */ - return (0x7F ^ mask); - else { - aval = seg << SEG_SHIFT; - if (seg < 2) - aval |= (pcm_val >> 4) & QUANT_MASK; - else - aval |= (pcm_val >> (seg + 3)) & QUANT_MASK; - return (aval ^ mask); - } -} - -/* - * alaw2linear() - Convert an A-law value to 16-bit linear PCM - * - */ -int -alaw2linear( - unsigned char a_val) -{ - int t; - int seg; - - a_val ^= 0x55; - - t = (a_val & QUANT_MASK) << 4; - seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT; - switch (seg) { - case 0: - t += 8; - break; - case 1: - t += 0x108; - break; - default: - t += 0x108; - t <<= seg - 1; - } - return ((a_val & SIGN_BIT) ? t : -t); -} - -#define BIAS (0x84) /* Bias for linear code. */ - -/* - * linear2ulaw() - Convert a linear PCM value to u-law - * - * In order to simplify the encoding process, the original linear magnitude - * is biased by adding 33 which shifts the encoding range from (0 - 8158) to - * (33 - 8191). The result can be seen in the following encoding table: - * - * Biased Linear Input Code Compressed Code - * ------------------------ --------------- - * 00000001wxyza 000wxyz - * 0000001wxyzab 001wxyz - * 000001wxyzabc 010wxyz - * 00001wxyzabcd 011wxyz - * 0001wxyzabcde 100wxyz - * 001wxyzabcdef 101wxyz - * 01wxyzabcdefg 110wxyz - * 1wxyzabcdefgh 111wxyz - * - * Each biased linear code has a leading 1 which identifies the segment - * number. The value of the segment number is equal to 7 minus the number - * of leading 0's. The quantization interval is directly available as the - * four bits wxyz. * The trailing bits (a - h) are ignored. - * - * Ordinarily the complement of the resulting code word is used for - * transmission, and so the code word is complemented before it is returned. - * - * For further information see John C. Bellamy's Digital Telephony, 1982, - * John Wiley & Sons, pps 98-111 and 472-476. - */ -unsigned char -linear2ulaw( - int pcm_val) /* 2's complement (16-bit range) */ -{ - int mask; - int seg; - unsigned char uval; - - /* Get the sign and the magnitude of the value. */ - if (pcm_val < 0) { - pcm_val = BIAS - pcm_val; - mask = 0x7F; - } else { - pcm_val += BIAS; - mask = 0xFF; - } - - /* Convert the scaled magnitude to segment number. */ - seg = search(pcm_val, seg_end, 8); - - /* - * Combine the sign, segment, quantization bits; - * and complement the code word. - */ - if (seg >= 8) /* out of range, return maximum value. */ - return (0x7F ^ mask); - else { - uval = (seg << 4) | ((pcm_val >> (seg + 3)) & 0xF); - return (uval ^ mask); - } - -} - -/* - * ulaw2linear() - Convert a u-law value to 16-bit linear PCM - * - * First, a biased linear code is derived from the code word. An unbiased - * output can then be obtained by subtracting 33 from the biased code. - * - * Note that this function expects to be passed the complement of the - * original code word. This is in keeping with ISDN conventions. - */ -int -ulaw2linear( - unsigned char u_val) -{ - int t; - - /* Complement to obtain normal u-law value. */ - u_val = ~u_val; - - /* - * Extract and bias the quantization bits. Then - * shift up by the segment number and subtract out the bias. - */ - t = ((u_val & QUANT_MASK) << 3) + BIAS; - t <<= ((unsigned)u_val & SEG_MASK) >> SEG_SHIFT; - - return ((u_val & SIGN_BIT) ? (BIAS - t) : (t - BIAS)); -} - -/* A-law to u-law conversion */ -unsigned char -alaw2ulaw( - unsigned char aval) -{ - aval &= 0xff; - return ((aval & 0x80) ? (0xFF ^ _a2u[aval ^ 0xD5]) : - (0x7F ^ _a2u[aval ^ 0x55])); -} - -/* u-law to A-law conversion */ -unsigned char -ulaw2alaw( - unsigned char uval) -{ - uval &= 0xff; - return ((uval & 0x80) ? (0xD5 ^ (_u2a[0xFF ^ uval] - 1)) : - (0x55 ^ (_u2a[0x7F ^ uval] - 1))); -} diff --git a/orkaudio/audiocaptureplugins/voip/g711.h b/orkaudio/audiocaptureplugins/voip/g711.h deleted file mode 100644 index f15df4d..0000000 --- a/orkaudio/audiocaptureplugins/voip/g711.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Oreka -- A media capture and retrieval platform - * - * Copyright (C) 2005, orecx LLC - * - * http://www.orecx.com - * - * This program is free software, distributed under the terms of - * the GNU General Public License. - * Please refer to http://www.gnu.org/copyleft/gpl.html - * - */ - -#ifndef __G711_H__ -#define __G711_H__ - -int ulaw2linear(unsigned char u_val); -int alaw2linear(unsigned char a_val); - -#endif - |