Changeset 3362 for pjproject/trunk
- Timestamp:
- Nov 3, 2010 7:33:07 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/ilbc.c
r3175 r3362 32 32 #include <pj/os.h> 33 33 34 #if defPJMEDIA_ILBC_CODEC_USE_COREAUDIO34 #if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 35 35 #include <AudioToolbox/AudioToolbox.h> 36 36 #define iLBC_Enc_Inst_t AudioConverterRef … … 152 152 float dec_block[BLOCKL_MAX]; 153 153 154 #if defPJMEDIA_ILBC_CODEC_USE_COREAUDIO154 #if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 155 155 unsigned enc_total_packets; 156 156 char *enc_buffer; … … 372 372 ilbc_codec = (struct ilbc_codec*) codec; 373 373 374 #if defPJMEDIA_ILBC_CODEC_USE_COREAUDIO374 #if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 375 375 if (ilbc_codec->enc) { 376 376 AudioConverterDispose(ilbc_codec->enc); … … 411 411 enc_fmtp_mode = DEFAULT_MODE; 412 412 413 #if defPJMEDIA_ILBC_CODEC_USE_COREAUDIO413 #if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 414 414 AudioStreamBasicDescription srcFormat, dstFormat; 415 415 UInt32 size; … … 480 480 481 481 /* Create encoder */ 482 #if defPJMEDIA_ILBC_CODEC_USE_COREAUDIO482 #if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 483 483 dstFormat.mFramesPerPacket = CLOCK_RATE * enc_fmtp_mode / 1000; 484 484 dstFormat.mBytesPerPacket = (enc_fmtp_mode == 20? 38 : 50); … … 499 499 500 500 /* Create decoder */ 501 #if defPJMEDIA_ILBC_CODEC_USE_COREAUDIO501 #if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 502 502 if (AudioConverterNew(&dstFormat, &srcFormat, &ilbc_codec->dec) != noErr) 503 503 return PJMEDIA_CODEC_EFAILED; … … 595 595 } 596 596 597 #if defPJMEDIA_ILBC_CODEC_USE_COREAUDIO597 #if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 598 598 static OSStatus encodeDataProc ( 599 599 AudioConverterRef inAudioConverter, … … 669 669 pj_int16_t *pcm_in; 670 670 unsigned nsamples; 671 #if defPJMEDIA_ILBC_CODEC_USE_COREAUDIO671 #if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 672 672 UInt32 npackets; 673 673 OSStatus err; … … 714 714 /* Encode */ 715 715 output->size = 0; 716 #if defPJMEDIA_ILBC_CODEC_USE_COREAUDIO716 #if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 717 717 npackets = nsamples / ilbc_codec->enc_samples_per_frame; 718 718 … … 765 765 { 766 766 struct ilbc_codec *ilbc_codec = (struct ilbc_codec*)codec; 767 #if defPJMEDIA_ILBC_CODEC_USE_COREAUDIO767 #if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 768 768 UInt32 npackets; 769 769 OSStatus err; … … 783 783 784 784 /* Decode to temporary buffer */ 785 #if defPJMEDIA_ILBC_CODEC_USE_COREAUDIO785 #if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 786 786 npackets = input->size / ilbc_codec->dec_frame_size * 787 787 ilbc_codec->dec_samples_per_frame; … … 828 828 { 829 829 struct ilbc_codec *ilbc_codec = (struct ilbc_codec*)codec; 830 #if defPJMEDIA_ILBC_CODEC_USE_COREAUDIO830 #if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 831 831 UInt32 npackets; 832 832 OSStatus err; … … 843 843 844 844 /* Decode to temporary buffer */ 845 #if defPJMEDIA_ILBC_CODEC_USE_COREAUDIO845 #if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 846 846 npackets = 1; 847 847
Note: See TracChangeset
for help on using the changeset viewer.