summaryrefslogtreecommitdiff
path: root/pjsip/src/pjsua-lib
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-12-26 03:05:17 +0000
committerBenny Prijono <bennylp@teluu.com>2006-12-26 03:05:17 +0000
commitbbfa7dfea405d9c1de743aee269e30449839dde2 (patch)
treee5cc9b7ea3dacbeadf1757b46b8d91b314c90e81 /pjsip/src/pjsua-lib
parent66ba60640c9016496736679a5f5d4f76ca9c92b4 (diff)
(Ticket #52) Added functions to retrieve media port of player and recorder in PJSUA-API
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@865 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsua-lib')
-rw-r--r--pjsip/src/pjsua-lib/pjsua_media.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_media.c b/pjsip/src/pjsua-lib/pjsua_media.c
index 07af5fbb..46d99a2b 100644
--- a/pjsip/src/pjsua-lib/pjsua_media.c
+++ b/pjsip/src/pjsua-lib/pjsua_media.c
@@ -784,6 +784,20 @@ PJ_DEF(pjsua_conf_port_id) pjsua_player_get_conf_port(pjsua_player_id id)
return pjsua_var.player[id].slot;
}
+/*
+ * Get the media port for the player.
+ */
+PJ_DEF(pj_status_t) pjsua_player_get_port( pjsua_recorder_id id,
+ pjmedia_port **p_port)
+{
+ PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.player), PJ_EINVAL);
+ PJ_ASSERT_RETURN(pjsua_var.player[id].port != NULL, PJ_EINVAL);
+ PJ_ASSERT_RETURN(p_port != NULL, PJ_EINVAL);
+
+ *p_port = pjsua_var.player[id].port;
+
+ return PJ_SUCCESS;
+}
/*
* Set playback position.
@@ -952,6 +966,19 @@ PJ_DEF(pjsua_conf_port_id) pjsua_recorder_get_conf_port(pjsua_recorder_id id)
return pjsua_var.recorder[id].slot;
}
+/*
+ * Get the media port for the recorder.
+ */
+PJ_DEF(pj_status_t) pjsua_recorder_get_port( pjsua_recorder_id id,
+ pjmedia_port **p_port)
+{
+ PJ_ASSERT_RETURN(id>=0 && id<PJ_ARRAY_SIZE(pjsua_var.recorder), PJ_EINVAL);
+ PJ_ASSERT_RETURN(pjsua_var.recorder[id].port != NULL, PJ_EINVAL);
+ PJ_ASSERT_RETURN(p_port != NULL, PJ_EINVAL);
+
+ *p_port = pjsua_var.recorder[id].port;
+ return PJ_SUCCESS;
+}
/*
* Destroy recorder (this will complete recording).