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
Location:
pjproject/branches/projects/aps-direct/pjmedia/src
Files:
2 edited

Legend:

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

    r2471 r2474  
    584584 
    585585    /* Done setting up play device. */ 
    586     PJ_LOG(5, (THIS_FILE,  
     586    PJ_LOG(4, (THIS_FILE,  
    587587               " WaveAPI Sound player \"%s\" initialized (" 
    588588               "format=%s, clock_rate=%d, " 
     
    664664 
    665665    /* Done setting up play device. */ 
    666     PJ_LOG(5,(THIS_FILE,  
     666    PJ_LOG(4,(THIS_FILE,  
    667667        " WaveAPI Sound recorder \"%s\" initialized " 
    668668        "(format=%s, clock_rate=%d, " 
     
    789789 
    790790                /* Get frame from application. */ 
    791                 PJ_LOG(5,(THIS_FILE, "xxx %u play_cb", play_cnt++)); 
     791                //PJ_LOG(5,(THIS_FILE, "xxx %u play_cb", play_cnt++)); 
    792792                status = (*strm->play_cb)(strm->user_data, frame); 
    793793 
     
    934934 
    935935                /* Call callback */ 
    936                 PJ_LOG(5,(THIS_FILE, "xxx %u rec_cb", rec_cnt++)); 
     936                //PJ_LOG(5,(THIS_FILE, "xxx %u rec_cb", rec_cnt++)); 
    937937                status = (*strm->rec_cb)(strm->user_data, frame); 
    938938                if (status != PJ_SUCCESS) 
     
    11981198            return CONVERT_MM_ERROR(mr); 
    11991199        } 
    1200         PJ_LOG(5,(THIS_FILE, "WMME playback stream started")); 
     1200        PJ_LOG(4,(THIS_FILE, "WMME playback stream started")); 
    12011201    } 
    12021202 
     
    12071207            return CONVERT_MM_ERROR(mr); 
    12081208        } 
    1209         PJ_LOG(5,(THIS_FILE, "WMME capture stream started")); 
     1209        PJ_LOG(4,(THIS_FILE, "WMME capture stream started")); 
    12101210    } 
    12111211 
     
    12271227            return CONVERT_MM_ERROR(mr); 
    12281228        } 
    1229         PJ_LOG(5,(THIS_FILE, "Stopped WMME playback stream")); 
     1229        PJ_LOG(4,(THIS_FILE, "Stopped WMME playback stream")); 
    12301230    } 
    12311231 
     
    12361236            return CONVERT_MM_ERROR(mr); 
    12371237        } 
    1238         PJ_LOG(5,(THIS_FILE, "Stopped WMME capture stream")); 
     1238        PJ_LOG(4,(THIS_FILE, "Stopped WMME capture stream")); 
    12391239    } 
    12401240 
  • 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.