Ignore:
Timestamp:
Feb 18, 2009 2:28:49 PM (15 years ago)
Author:
nanang
Message:
  • Added APS-direct sound device management into pjsua-lib (and removed it from apps).
  • Fixed bug in conf_switch.c to always update ts_rx (even if port is not transmitting).
  • Minor updates: 'fmt_id' to 'id', added transmitter_Cnt in conf port info, explicit mapping in Symbian audio APS impl from pjmedia_format_id to Symbian APS fourcc.
File:
1 edited

Legend:

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

    r2457 r2460  
    588588    dst_port = conf->ports[sink_slot]; 
    589589 
    590     /* Source and sink format must match. */ 
    591     if (src_port->info->format.fmt_id != dst_port->info->format.fmt_id) { 
     590    /* Format must match. */ 
     591    if (src_port->info->format.id != dst_port->info->format.id || 
     592        src_port->info->format.bitrate != dst_port->info->format.bitrate)  
     593    { 
    592594        pj_mutex_unlock(conf->mutex); 
    593595        return PJMEDIA_ENOTCOMPATIBLE; 
     596    } 
     597 
     598    /* Clock rate must match. */ 
     599    if (src_port->info->clock_rate != dst_port->info->clock_rate) { 
     600        pj_mutex_unlock(conf->mutex); 
     601        return PJMEDIA_ENCCLOCKRATE; 
     602    } 
     603 
     604    /* Channel count must match. */ 
     605    if (src_port->info->channel_count != dst_port->info->channel_count) { 
     606        pj_mutex_unlock(conf->mutex); 
     607        return PJMEDIA_ENCCLOCKRATE; 
    594608    } 
    595609 
     
    866880    info->listener_cnt = conf_port->listener_cnt; 
    867881    info->listener_slots = conf_port->listener_slots; 
     882    info->transmitter_cnt = conf_port->transmitter_cnt; 
    868883    info->clock_rate = conf_port->info->clock_rate; 
    869884    info->channel_count = conf_port->info->channel_count; 
     
    952967 
    953968    /* Level adjustment is applicable only for ports that work with raw PCM. */ 
    954     PJ_ASSERT_RETURN(conf_port->info->format.fmt_id == PJMEDIA_FORMAT_L16, 
     969    PJ_ASSERT_RETURN(conf_port->info->format.id == PJMEDIA_FORMAT_L16, 
    955970                     PJ_EIGNORED); 
    956971 
     
    9861001 
    9871002    /* Level adjustment is applicable only for ports that work with raw PCM. */ 
    988     PJ_ASSERT_RETURN(conf_port->info->format.fmt_id == PJMEDIA_FORMAT_L16, 
     1003    PJ_ASSERT_RETURN(conf_port->info->format.id == PJMEDIA_FORMAT_L16, 
    9891004                     PJ_EIGNORED); 
    9901005 
     
    10501065        f_start = (pj_int16_t*)frm_src->buf; 
    10511066        f_end   = f_start + (frm_src->size >> 1); 
     1067 
    10521068        while (f_start < f_end) { 
    10531069            unsigned nsamples_to_copy, nsamples_req; 
     
    11111127        /* Check port format. */ 
    11121128        if (cport_dst->port && 
    1113             cport_dst->port->info.format.fmt_id == PJMEDIA_FORMAT_L16) 
     1129            cport_dst->port->info.format.id == PJMEDIA_FORMAT_L16) 
    11141130        { 
    11151131            /* When there is already some samples in listener's TX buffer,  
     
    12101226        { 
    12111227            cport->rx_level = 0; 
     1228            pj_add_timestamp32(&cport->ts_rx,  
     1229                               conf->master_port->info.samples_per_frame); 
    12121230            continue; 
    12131231        } 
     
    12261244             
    12271245            f->buf = &conf->buf[sizeof(pjmedia_frame)]; 
    1228             f->size = BUFFER_SIZE - sizeof(pjmedia_frame); 
     1246            f->size = cport->info->samples_per_frame<<1; 
    12291247 
    12301248            /* Get frame from port. */ 
Note: See TracChangeset for help on using the changeset viewer.