Ignore:
Timestamp:
Feb 5, 2009 10:59:14 AM (15 years ago)
Author:
nanang
Message:
  • Added new API for sound & sound port to create/open sound device with extended setting, to allow opening sound device with non-PCM format and other settings.
  • Updated symbian_ua/ua.cpp to be able to reopen sound device when audio stream session is using non-PCM data/passthrough codec.
  • Updated stream.c to allow it works with non-PCM data.
  • Added PCMU/A frames processing into non-PCM play/record callbacks in symbian_audio_aps.cpp.
  • Added passthrough codec init/deinitialization in pjsua-lib.
  • Added a new pjmedia_frame_ext helper function, pjmedia_frame_ext_pop_subframes, to pop-out/remove some subframes.
  • Other minor updates/fixes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/aps-direct/pjmedia/include/pjmedia/port.h

    r2437 r2438  
    360360         
    361361/** 
     362 * Pop out first n subframes from #pjmedia_frame_ext. 
     363 * 
     364 * @param frm               The #pjmedia_frame_ext. 
     365 * @param n                 Number of first subframes to be popped out. 
     366 * 
     367 * @return                  PJ_SUCCESS, or PJ_ENOTFOUND if frame is empty. 
     368 */ 
     369PJ_INLINE(pj_status_t)  
     370          pjmedia_frame_ext_pop_subframes(pjmedia_frame_ext *frm, unsigned n) 
     371{ 
     372    pjmedia_frame_ext_subframe *sf; 
     373    pj_uint8_t *move_src; 
     374    unsigned move_len; 
     375 
     376    if (frm->subframe_cnt <= n) { 
     377        frm->subframe_cnt = 0; 
     378        frm->samples_cnt = 0; 
     379        return PJ_SUCCESS; 
     380    } 
     381 
     382    move_src = (pj_uint8_t*)pjmedia_frame_ext_get_subframe(frm, n); 
     383    sf = pjmedia_frame_ext_get_subframe(frm, frm->subframe_cnt-1); 
     384    move_len = (pj_uint8_t*)sf - move_src + sf->bitlen/8; 
     385    if (sf->bitlen % 8 != 0) 
     386        ++move_len; 
     387    pj_memmove((pj_uint8_t*)frm+sizeof(pjmedia_frame_ext),  
     388               move_src, move_len); 
     389             
     390    frm->samples_cnt = (pj_uint16_t) 
     391                   (frm->samples_cnt - n*frm->samples_cnt/frm->subframe_cnt); 
     392    frm->subframe_cnt = (pj_uint16_t) (frm->subframe_cnt - n); 
     393 
     394    return PJ_SUCCESS; 
     395} 
     396         
     397/** 
    362398 * Port interface. 
    363399 */ 
Note: See TracChangeset for help on using the changeset viewer.