Ignore:
Timestamp:
Feb 18, 2009 1:55:03 PM (15 years ago)
Author:
bennylp
Message:

Added WMME device in audiodev

File:
1 edited

Legend:

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

    r2458 r2459  
    2121#include <pj/errno.h> 
    2222 
    23  
     23/* 
     24 * The Device ID seen by application and driver is different.  
     25 * 
     26 * At application level, device ID is a 32bit value. The high 16bit contains 
     27 * the factory ID, and the low 16bit contains the device index in the  
     28 * specified factory. The device ID may also be -1 to denote default device. 
     29 * 
     30 * At driver level, device ID is a 16bit unsigned integer index. 
     31 */ 
    2432#define MAKE_DEV_ID(f_id, index)   (((f_id & 0xFFFF) << 16) & (index & 0xFFFF)) 
    2533#define GET_INDEX(dev_id)          ((dev_id) & 0xFFFF) 
    2634#define GET_FID(dev_id)            ((dev_id) >> 16) 
    27  
    28  
    29 /* extern */ 
     35#define DEFAULT_DEV_ID              0 
     36 
     37 
     38/* extern functions to create factories */ 
    3039pjmedia_aud_dev_factory* pjmedia_pa_factory(pj_pool_factory *pf); 
     40pjmedia_aud_dev_factory* pjmedia_wmme_factory(pj_pool_factory *pf); 
     41 
    3142 
    3243/* Array of factories */ 
     
    3849} factories[] =  
    3950{ 
     51    /* WMME */ 
     52    { 
     53        &pjmedia_wmme_factory 
     54    }, 
     55    /* PortAudio: */ 
    4056    { 
    4157        &pjmedia_pa_factory 
    42     } 
     58    }, 
    4359}; 
    4460static unsigned factory_cnt; 
     
    130146    int f_id, index; 
    131147 
     148    if (id == PJMEDIA_AUD_DEV_DEFAULT_ID) 
     149        id = DEFAULT_DEV_ID; 
     150 
    132151    f_id = GET_FID(id); 
    133152    index = GET_INDEX(id); 
     
    151170    int f_id, index; 
    152171    pj_status_t status; 
     172 
     173    if (id == PJMEDIA_AUD_DEV_DEFAULT_ID) 
     174        id = DEFAULT_DEV_ID; 
    153175 
    154176    f_id = GET_FID(id); 
     
    190212 
    191213    /* Set default device */ 
    192     if (param.rec_id == PJMEDIA_AUD_DEV_DEFAULT_ID) param.rec_id = 0; 
    193     if (param.play_id == PJMEDIA_AUD_DEV_DEFAULT_ID) param.play_id = 0; 
     214    if (param.rec_id == PJMEDIA_AUD_DEV_DEFAULT_ID)  
     215        param.rec_id = DEFAULT_DEV_ID; 
     216    if (param.play_id == PJMEDIA_AUD_DEV_DEFAULT_ID)  
     217        param.play_id = DEFAULT_DEV_ID; 
    194218     
    195219    if (param.dir & PJMEDIA_DIR_CAPTURE) 
Note: See TracChangeset for help on using the changeset viewer.