summaryrefslogtreecommitdiff
path: root/pjmedia/src/pjmedia-audiodev/audiodev.c
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2011-03-11 06:57:24 +0000
committerLiong Sauw Ming <ming@teluu.com>2011-03-11 06:57:24 +0000
commitc44da2d6d7f8a991cd8143f97acda117a4e0a422 (patch)
treee57adad451551e486fdbb8f4de0b2240978d091d /pjmedia/src/pjmedia-audiodev/audiodev.c
parenta71c9ccfea1d7d9e7999037a8ee13820eb0e16e2 (diff)
Fixed #1204: Support for refreshing audio device list.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3438 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/src/pjmedia-audiodev/audiodev.c')
-rw-r--r--pjmedia/src/pjmedia-audiodev/audiodev.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/pjmedia/src/pjmedia-audiodev/audiodev.c b/pjmedia/src/pjmedia-audiodev/audiodev.c
index 2a5a8e67..b9d960fe 100644
--- a/pjmedia/src/pjmedia-audiodev/audiodev.c
+++ b/pjmedia/src/pjmedia-audiodev/audiodev.c
@@ -491,6 +491,25 @@ PJ_DEF(pj_status_t) pjmedia_aud_subsys_shutdown(void)
return PJ_SUCCESS;
}
+/* API: Refresh the list of sound devices installed in the system. */
+PJ_DEF(pj_status_t) pjmedia_aud_dev_refresh(void)
+{
+ unsigned i;
+
+ for (i=0; i<aud_subsys.drv_cnt; ++i) {
+ struct driver *drv = &aud_subsys.drv[i];
+
+ if (drv->f && drv->f->op->refresh) {
+ pj_status_t status = drv->f->op->refresh(drv->f);
+ if (status != PJ_SUCCESS) {
+ PJ_PERROR(4, (THIS_FILE, status, "Unable to refresh device "
+ "list for %s", drv->name));
+ }
+ }
+ }
+ return PJ_SUCCESS;
+}
+
/* API: Get the number of sound devices installed in the system. */
PJ_DEF(unsigned) pjmedia_aud_dev_count(void)
{