Changeset 2486


Ignore:
Timestamp:
Mar 4, 2009 5:23:25 PM (10 years ago)
Author:
nanang
Message:

Fixed pjsua_set_snd_dev() to differentiate the way of opening sound device based on the used conf type.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/aps-direct/pjsip/src/pjsua-lib/pjsua_media.c

    r2480 r2486  
    23852385                                       int playback_dev) 
    23862386{ 
     2387#if PJMEDIA_CONF_USE_SWITCH_BOARD 
     2388 
     2389    pjmedia_aud_param param; 
     2390    pj_status_t status; 
     2391 
     2392    /* Create default parameters for the device */ 
     2393    status = pjmedia_aud_dev_default_param(capture_dev, &param); 
     2394    if (status != PJ_SUCCESS) { 
     2395        pjsua_perror(THIS_FILE, "Error retrieving default audio " 
     2396                                "device parameters", status); 
     2397        return status; 
     2398    } 
     2399    param.dir = PJMEDIA_DIR_CAPTURE_PLAYBACK; 
     2400    param.rec_id = capture_dev; 
     2401    param.play_id = playback_dev; 
     2402    param.channel_count = pjsua_var.media_cfg.channel_count; 
     2403    /* Latency settings */ 
     2404    param.flags |= (PJMEDIA_AUD_DEV_CAP_INPUT_LATENCY |  
     2405                    PJMEDIA_AUD_DEV_CAP_OUTPUT_LATENCY); 
     2406    param.input_latency_ms = pjsua_var.media_cfg.snd_rec_latency; 
     2407    param.output_latency_ms = pjsua_var.media_cfg.snd_play_latency; 
     2408    /* EC settings */ 
     2409    if (pjsua_var.media_cfg.ec_tail_len) { 
     2410        param.flags |= (PJMEDIA_AUD_DEV_CAP_EC | PJMEDIA_AUD_DEV_CAP_EC_TAIL); 
     2411        param.ec_enabled = PJ_TRUE; 
     2412        param.ec_tail_ms = pjsua_var.media_cfg.ec_tail_len; 
     2413    } else { 
     2414        param.flags &= ~(PJMEDIA_AUD_DEV_CAP_EC | PJMEDIA_AUD_DEV_CAP_EC_TAIL); 
     2415    } 
     2416 
     2417    return open_snd_dev_ext(&param); 
     2418 
     2419#else 
     2420 
    23872421    pjmedia_port *conf_port; 
    23882422    pjmedia_aud_dev_info play_info; 
     
    25482582 
    25492583    return PJ_SUCCESS; 
     2584 
     2585#endif /* PJMEDIA_CONF_USE_SWITCH_BOARD */ 
     2586 
    25502587} 
    25512588 
Note: See TracChangeset for help on using the changeset viewer.