Changeset 9
- Timestamp:
- 08/11/07 20:54:34
(1 year ago)
- Author:
- sip
- Message:
PCMU support
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r7 |
r9 |
|
| 28 | 28 | ############################################ |
|---|
| 29 | 29 | G711DIR=g711 |
|---|
| 30 | | G711OBJ=g711codec.o g711.o |
|---|
| | 30 | G711OBJ=g711.o pcmucodec.o pcmacodec.o |
|---|
| 31 | 31 | |
|---|
| 32 | 32 | H263DIR=h263 |
|---|
| r2 |
r9 |
|
| 50 | 50 | return new GSMCodec(); |
|---|
| 51 | 51 | case PCMA: |
|---|
| 52 | | return new G711Codec(); |
|---|
| | 52 | return new PCMACodec(); |
|---|
| | 53 | case PCMU: |
|---|
| | 54 | return new PCMUCodec(); |
|---|
| 53 | 55 | default: |
|---|
| 54 | 56 | Log("Codec de audio erroneo [%d]\n",codec); |
|---|
| … | … | |
| 65 | 67 | { |
|---|
| 66 | 68 | //Compromabos que soportamos el modo |
|---|
| 67 | | if (!(codec==PCMA || codec==GSM)) |
|---|
| | 69 | if (!(codec==PCMA || codec==GSM || codec==PCMU)) |
|---|
| 68 | 70 | return 0; |
|---|
| 69 | 71 | |
|---|
| … | … | |
| 87 | 89 | case GSM: |
|---|
| 88 | 90 | case PCMA: |
|---|
| | 91 | case PCMU: |
|---|
| 89 | 92 | return 1; |
|---|
| 90 | 93 | } |
|---|
| r2 |
r9 |
|
| | 1 | #ifndef _G711CODEC_H_ |
|---|
| | 2 | #define _G711CODEC_H_ |
|---|
| | 3 | |
|---|
| 1 | 4 | #include "codecs.h" |
|---|
| 2 | 5 | |
|---|
| 3 | | class G711Codec : public AudioCodec |
|---|
| | 6 | class PCMACodec : public AudioCodec |
|---|
| 4 | 7 | { |
|---|
| 5 | 8 | public: |
|---|
| 6 | | G711Codec(); |
|---|
| 7 | | virtual ~G711Codec(); |
|---|
| | 9 | PCMACodec(); |
|---|
| | 10 | virtual ~PCMACodec(); |
|---|
| 8 | 11 | virtual int Encode(WORD *in,int inLen,BYTE* out,int outLen); |
|---|
| 9 | 12 | virtual int Decode(BYTE *in,int inLen,WORD* out,int outLen); |
|---|
| 10 | 13 | |
|---|
| 11 | 14 | }; |
|---|
| | 15 | |
|---|
| | 16 | class PCMUCodec : public AudioCodec |
|---|
| | 17 | { |
|---|
| | 18 | public: |
|---|
| | 19 | PCMUCodec(); |
|---|
| | 20 | virtual ~PCMUCodec(); |
|---|
| | 21 | virtual int Encode(WORD *in,int inLen,BYTE* out,int outLen); |
|---|
| | 22 | virtual int Decode(BYTE *in,int inLen,WORD* out,int outLen); |
|---|
| | 23 | |
|---|
| | 24 | }; |
|---|
| | 25 | |
|---|
| | 26 | #endif |
|---|
Download in other formats:
|
|