- Timestamp:
- Feb 18, 2009 1:55:03 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia-audiodev/audiodev.c
r2458 r2459 21 21 #include <pj/errno.h> 22 22 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 */ 24 32 #define MAKE_DEV_ID(f_id, index) (((f_id & 0xFFFF) << 16) & (index & 0xFFFF)) 25 33 #define GET_INDEX(dev_id) ((dev_id) & 0xFFFF) 26 34 #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 */ 30 39 pjmedia_aud_dev_factory* pjmedia_pa_factory(pj_pool_factory *pf); 40 pjmedia_aud_dev_factory* pjmedia_wmme_factory(pj_pool_factory *pf); 41 31 42 32 43 /* Array of factories */ … … 38 49 } factories[] = 39 50 { 51 /* WMME */ 52 { 53 &pjmedia_wmme_factory 54 }, 55 /* PortAudio: */ 40 56 { 41 57 &pjmedia_pa_factory 42 } 58 }, 43 59 }; 44 60 static unsigned factory_cnt; … … 130 146 int f_id, index; 131 147 148 if (id == PJMEDIA_AUD_DEV_DEFAULT_ID) 149 id = DEFAULT_DEV_ID; 150 132 151 f_id = GET_FID(id); 133 152 index = GET_INDEX(id); … … 151 170 int f_id, index; 152 171 pj_status_t status; 172 173 if (id == PJMEDIA_AUD_DEV_DEFAULT_ID) 174 id = DEFAULT_DEV_ID; 153 175 154 176 f_id = GET_FID(id); … … 190 212 191 213 /* 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; 194 218 195 219 if (param.dir & PJMEDIA_DIR_CAPTURE)
Note: See TracChangeset
for help on using the changeset viewer.