Changeset 3362 for pjproject/trunk


Ignore:
Timestamp:
Nov 3, 2010 7:33:07 AM (14 years ago)
Author:
bennylp
Message:

Misc (re #1151): fixed the compile time switch to use iLBC codec on iPhone

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-codec/ilbc.c

    r3175 r3362  
    3232#include <pj/os.h> 
    3333 
    34 #ifdef PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
     34#if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
    3535    #include <AudioToolbox/AudioToolbox.h> 
    3636    #define iLBC_Enc_Inst_t AudioConverterRef 
     
    152152    float                dec_block[BLOCKL_MAX]; 
    153153 
    154 #ifdef PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
     154#if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
    155155    unsigned             enc_total_packets; 
    156156    char                 *enc_buffer; 
     
    372372    ilbc_codec = (struct ilbc_codec*) codec; 
    373373 
    374 #ifdef PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
     374#if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
    375375    if (ilbc_codec->enc) { 
    376376        AudioConverterDispose(ilbc_codec->enc); 
     
    411411                enc_fmtp_mode = DEFAULT_MODE; 
    412412 
    413 #ifdef PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
     413#if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
    414414    AudioStreamBasicDescription srcFormat, dstFormat; 
    415415    UInt32 size; 
     
    480480 
    481481    /* Create encoder */ 
    482 #ifdef PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
     482#if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
    483483    dstFormat.mFramesPerPacket  = CLOCK_RATE * enc_fmtp_mode / 1000; 
    484484    dstFormat.mBytesPerPacket   = (enc_fmtp_mode == 20? 38 : 50); 
     
    499499 
    500500    /* Create decoder */ 
    501 #ifdef PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
     501#if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
    502502    if (AudioConverterNew(&dstFormat, &srcFormat, &ilbc_codec->dec) != noErr) 
    503503        return PJMEDIA_CODEC_EFAILED; 
     
    595595} 
    596596 
    597 #ifdef PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
     597#if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
    598598static OSStatus encodeDataProc ( 
    599599    AudioConverterRef             inAudioConverter, 
     
    669669    pj_int16_t *pcm_in; 
    670670    unsigned nsamples; 
    671 #ifdef PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
     671#if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
    672672    UInt32 npackets; 
    673673    OSStatus err; 
     
    714714    /* Encode */ 
    715715    output->size = 0; 
    716 #ifdef PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
     716#if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
    717717    npackets = nsamples / ilbc_codec->enc_samples_per_frame; 
    718718 
     
    765765{ 
    766766    struct ilbc_codec *ilbc_codec = (struct ilbc_codec*)codec; 
    767 #ifdef PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
     767#if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
    768768    UInt32 npackets; 
    769769    OSStatus err; 
     
    783783 
    784784    /* Decode to temporary buffer */ 
    785 #ifdef PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
     785#if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
    786786    npackets = input->size / ilbc_codec->dec_frame_size * 
    787787               ilbc_codec->dec_samples_per_frame; 
     
    828828{ 
    829829    struct ilbc_codec *ilbc_codec = (struct ilbc_codec*)codec; 
    830 #ifdef PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
     830#if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
    831831    UInt32 npackets; 
    832832    OSStatus err; 
     
    843843 
    844844    /* Decode to temporary buffer */ 
    845 #ifdef PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
     845#if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO 
    846846    npackets = 1; 
    847847 
Note: See TracChangeset for help on using the changeset viewer.