diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-02-01 19:25:50 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-02-01 19:25:50 +0000 |
commit | 3838854d1becf6befefe1efb9112f5db5e0c6740 (patch) | |
tree | 3b9aaba9a0905f23457e0545c047d43701ede476 /pjsip | |
parent | 7de461f8212c9fc77ae3580fd1a2f40ba5ec0ffb (diff) |
Implement the missing pjsua_get_snd_dev() function
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@925 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r-- | pjsip/include/pjsua-lib/pjsua.h | 2 | ||||
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_media.c | 19 |
2 files changed, 20 insertions, 1 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h index 36368bb1..fd5df192 100644 --- a/pjsip/include/pjsua-lib/pjsua.h +++ b/pjsip/include/pjsua-lib/pjsua.h @@ -4074,7 +4074,7 @@ PJ_DECL(pj_status_t) pjsua_enum_snd_devs(pjmedia_snd_dev_info info[], * @return PJ_SUCCESS on success, or the appropriate error code. * * \par Python: - * The function takes no argument and return a tuple: + * The function takes no argument and return an (integer,integer) tuple: * \code capture_dev, playback_dev = py_pjsua.get_snd_dev() * \endcode diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c index c78d5050..a32bd3eb 100644 --- a/pjsip/src/pjsua-lib/pjsua_media.c +++ b/pjsip/src/pjsua-lib/pjsua_media.c @@ -1242,6 +1242,25 @@ PJ_DEF(pj_status_t) pjsua_set_snd_dev( int capture_dev, /* + * Get currently active sound devices. If sound devices has not been created + * (for example when pjsua_start() is not called), it is possible that + * the function returns PJ_SUCCESS with -1 as device IDs. + */ +PJ_DEF(pj_status_t) pjsua_get_snd_dev(int *capture_dev, + int *playback_dev) +{ + if (capture_dev) { + *capture_dev = pjsua_var.cap_dev; + } + if (playback_dev) { + *playback_dev = pjsua_var.play_dev; + } + + return PJ_SUCCESS; +} + + +/* * Use null sound device. */ PJ_DEF(pj_status_t) pjsua_set_null_snd_dev(void) |