Changeset 1456 for pjproject/trunk
- Timestamp:
- Sep 28, 2007 1:12:15 PM (17 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/config.h
r1393 r1456 74 74 75 75 /** 76 * Specify whether we prefer to use DirectSound on Windows. 77 * 78 * Say yes! 79 */ 80 #ifndef PJMEDIA_PREFER_DIRECT_SOUND 81 # define PJMEDIA_PREFER_DIRECT_SOUND 1 82 #endif 83 84 85 /** 76 86 * Specify number of sound buffers. Larger number is better for sound 77 87 * stability and to accomodate sound devices that are unable to send frames -
pjproject/trunk/pjmedia/src/pjmedia/pasound.c
r1266 r1456 266 266 int i, count; 267 267 268 /* Special for Windows - try to use the DirectSound implementation 269 * first since it provides better latency. 270 */ 271 #if PJMEDIA_PREFER_DIRECT_SOUND 272 if (Pa_HostApiTypeIdToHostApiIndex(paDirectSound) >= 0) { 273 const PaHostApiInfo *pHI; 274 int index = Pa_HostApiTypeIdToHostApiIndex(paDirectSound); 275 pHI = Pa_GetHostApiInfo(index); 276 if (pHI) { 277 const PaDeviceInfo *paDevInfo = NULL; 278 paDevInfo = Pa_GetDeviceInfo(pHI->defaultInputDevice); 279 if (paDevInfo && paDevInfo->maxInputChannels >= channel_count) 280 return pHI->defaultInputDevice; 281 } 282 } 283 #endif 284 268 285 /* Enumerate the host api's for the default devices, and return 269 286 * the device with suitable channels. … … 305 322 int i, count; 306 323 324 /* Special for Windows - try to use the DirectSound implementation 325 * first since it provides better latency. 326 */ 327 #if PJMEDIA_PREFER_DIRECT_SOUND 328 if (Pa_HostApiTypeIdToHostApiIndex(paDirectSound) >= 0) { 329 const PaHostApiInfo *pHI; 330 int index = Pa_HostApiTypeIdToHostApiIndex(paDirectSound); 331 pHI = Pa_GetHostApiInfo(index); 332 if (pHI) { 333 const PaDeviceInfo *paDevInfo = NULL; 334 paDevInfo = Pa_GetDeviceInfo(pHI->defaultOutputDevice); 335 if (paDevInfo && paDevInfo->maxOutputChannels >= channel_count) 336 return pHI->defaultOutputDevice; 337 } 338 } 339 #endif 340 307 341 /* Enumerate the host api's for the default devices, and return 308 342 * the device with suitable channels. … … 335 369 return i; 336 370 } 337 371 338 372 return -1; 339 373 }
Note: See TracChangeset
for help on using the changeset viewer.