summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-02-01 19:25:50 +0000
committerBenny Prijono <bennylp@teluu.com>2007-02-01 19:25:50 +0000
commit3838854d1becf6befefe1efb9112f5db5e0c6740 (patch)
tree3b9aaba9a0905f23457e0545c047d43701ede476
parent7de461f8212c9fc77ae3580fd1a2f40ba5ec0ffb (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
-rw-r--r--pjsip-apps/src/py_pjsua/py_pjsua.c4
-rw-r--r--pjsip/include/pjsua-lib/pjsua.h2
-rw-r--r--pjsip/src/pjsua-lib/pjsua_media.c19
3 files changed, 22 insertions, 3 deletions
diff --git a/pjsip-apps/src/py_pjsua/py_pjsua.c b/pjsip-apps/src/py_pjsua/py_pjsua.c
index fda96583..9c14a316 100644
--- a/pjsip-apps/src/py_pjsua/py_pjsua.c
+++ b/pjsip-apps/src/py_pjsua/py_pjsua.c
@@ -8228,10 +8228,10 @@ static PyMethodDef py_pjsua_methods[] =
"enum_snd_devs", py_pjsua_enum_snd_devs, METH_VARARGS,
pjsua_enum_snd_devs_doc
},
- /*{
+ {
"get_snd_dev", py_pjsua_get_snd_dev, METH_VARARGS,
pjsua_get_snd_dev_doc
- },*/
+ },
{
"set_snd_dev", py_pjsua_set_snd_dev, METH_VARARGS,
pjsua_set_snd_dev_doc
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)