summaryrefslogtreecommitdiff
path: root/pjsip
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
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')
-rw-r--r--pjsip/include/pjsua-lib/pjsua.h23
-rw-r--r--pjsip/src/pjsua-lib/pjsua_media.c27
2 files changed, 50 insertions, 0 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index 87481b1d..22cdee61 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -2709,6 +2709,17 @@ PJ_DECL(pjsua_conf_port_id) pjsua_player_get_conf_port(pjsua_player_id id);
/**
+ * Get the media port for the player.
+ *
+ * @param id The player ID.
+ * @param p_port The media port associated with the player.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjsua_player_get_port(pjsua_recorder_id id,
+ pjmedia_port **p_port);
+
+/**
* Set playback position.
*
* @param id The file player ID.
@@ -2780,6 +2791,18 @@ PJ_DECL(pjsua_conf_port_id) pjsua_recorder_get_conf_port(pjsua_recorder_id id);
/**
+ * Get the media port for the recorder.
+ *
+ * @param id The recorder ID.
+ * @param p_port The media port associated with the recorder.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjsua_recorder_get_port(pjsua_recorder_id id,
+ pjmedia_port **p_port);
+
+
+/**
* Destroy recorder (this will complete recording).
*
* @param id The recorder ID.
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).