Changeset 4079


Ignore:
Timestamp:
Apr 24, 2012 10:26:07 AM (7 years ago)
Author:
ming
Message:

Fixed #1494: Use EC options to determine whether to use device/software EC

Location:
pjproject/branches/1.x/pjmedia
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/1.x/pjmedia/include/pjmedia/echo.h

    r3567 r4079  
    9696     * without using WSOLA to expand and shrink audio samples. 
    9797     */ 
    98     PJMEDIA_ECHO_USE_SIMPLE_FIFO = 32 
    99  
     98    PJMEDIA_ECHO_USE_SIMPLE_FIFO = 32, 
     99 
     100    /** 
     101     * If PJMEDIA_ECHO_USE_SW_ECHO flag is specified, software echo canceller 
     102     * will be used instead of device EC. 
     103     */ 
     104    PJMEDIA_ECHO_USE_SW_ECHO = 64 
    100105 
    101106} pjmedia_echo_flag; 
  • pjproject/branches/1.x/pjmedia/src/pjmedia-audiodev/coreaudio_dev.c

    r3674 r4079  
    19651965        strm->param.ec_enabled = *(pj_bool_t*)pval; 
    19661966 
     1967        PJ_LOG(4, (THIS_FILE, "Using %s audio unit",  
     1968                              (desc.componentSubType == 
     1969                               kAudioUnitSubType_RemoteIO? "RemoteIO": 
     1970                               "VoiceProcessingIO"))); 
     1971         
    19671972        return PJ_SUCCESS; 
    19681973    } 
  • pjproject/branches/1.x/pjmedia/src/pjmedia/sound_port.c

    r4065 r4079  
    226226    if (param_copy.flags & PJMEDIA_AUD_DEV_CAP_EC) { 
    227227        /* EC is wanted */ 
    228         if (snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC) { 
     228        if ((snd_port->prm_ec_options & PJMEDIA_ECHO_USE_SW_ECHO) == 0 && 
     229            snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC) 
     230        { 
    229231            /* Device supports EC */ 
    230232            /* Nothing to do */ 
    231233        } else { 
    232             /* Device doesn't support EC, remove EC settings from 
     234            /* Application wants to use software EC or device 
     235             * doesn't support EC, remove EC settings from 
    233236             * device parameters 
    234237             */ 
     
    262265                                  snd_port->samples_per_frame); 
    263266 
    264     /* Create software EC if parameter specifies EC but device  
    265      * doesn't support EC. Only do this if the format is PCM! 
     267    /* Create software EC if parameter specifies EC and 
     268     * (app specifically requests software EC or device 
     269     * doesn't support EC). Only do this if the format is PCM! 
    266270     */ 
    267271    if ((snd_port->aud_param.flags & PJMEDIA_AUD_DEV_CAP_EC) && 
    268         (snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC)==0 && 
     272        ((snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC)==0 || 
     273         (snd_port->prm_ec_options & PJMEDIA_ECHO_USE_SW_ECHO) != 0) && 
    269274        param_copy.ext_fmt.id == PJMEDIA_FORMAT_PCM) 
    270275    { 
     
    506511 
    507512    /* Determine whether we use device or software EC */ 
    508     if (snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC) { 
     513    if ((snd_port->prm_ec_options & PJMEDIA_ECHO_USE_SW_ECHO) == 0 && 
     514        snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC) 
     515    { 
    509516        /* We use device EC */ 
    510517        pj_bool_t ec_enabled; 
Note: See TracChangeset for help on using the changeset viewer.