Ignore:
Timestamp:
Feb 23, 2009 10:21:33 AM (15 years ago)
Author:
bennylp
Message:
  • Disable EC in sound port when codec is used in sound device
  • Added log verbosity in wmme_dev.c
  • Tested aps-direct with WMME
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia/sound_port.c

    r2469 r2474  
    253253 
    254254    /* Create software EC if parameter specifies EC but device  
    255      * doesn't support EC 
     255     * doesn't support EC. Only do this if the format is PCM! 
    256256     */ 
    257257    if ((snd_port->aud_param.flags & PJMEDIA_AUD_DEV_CAP_EC) && 
    258         (snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC)==0) 
     258        (snd_port->aud_caps & PJMEDIA_AUD_DEV_CAP_EC)==0 && 
     259        param_copy.ext_fmt.id == PJMEDIA_FORMAT_PCM) 
    259260    { 
    260261        if ((snd_port->aud_param.flags & PJMEDIA_AUD_DEV_CAP_EC_TAIL)==0) { 
     
    532533    } else { 
    533534        /* We use software EC */ 
    534         /* Sound port must have 16bits per sample */ 
    535         PJ_ASSERT_RETURN(snd_port->bits_per_sample == 16, 
    536                          PJ_EINVALIDOP); 
    537535 
    538536        /* Check if there is change in parameters */ 
     
    543541        } 
    544542 
     543        status = pjmedia_aud_stream_get_param(snd_port->aud_stream, &prm); 
     544        if (status != PJ_SUCCESS) 
     545            return status; 
     546 
     547        /* Audio stream must be in PCM format */ 
     548        PJ_ASSERT_RETURN(prm.ext_fmt.id == PJMEDIA_FORMAT_PCM, 
     549                         PJ_EINVALIDOP); 
     550 
    545551        /* Destroy AEC */ 
    546552        if (snd_port->ec_state) { 
     
    549555        } 
    550556 
    551         snd_port->ec_options = options; 
    552         snd_port->ec_tail_len = tail_ms; 
    553  
    554557        if (tail_ms != 0) { 
    555558            unsigned delay_ms; 
    556  
    557             status = pjmedia_aud_stream_get_param(snd_port->aud_stream, &prm); 
    558             if (status != PJ_SUCCESS) 
    559                 prm.input_latency_ms = prm.output_latency_ms = 0; 
    560559 
    561560            //No need to add input latency in the latency calculation, 
     
    578577            status = PJ_SUCCESS; 
    579578        } 
     579 
     580        snd_port->ec_options = options; 
     581        snd_port->ec_tail_len = tail_ms; 
    580582    } 
    581583 
Note: See TracChangeset for help on using the changeset viewer.