summaryrefslogtreecommitdiff
path: root/pjmedia/include
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-06-12 10:13:31 +0000
committerBenny Prijono <bennylp@teluu.com>2006-06-12 10:13:31 +0000
commit070c6a1f21fb75982716948e1390dd449088ef60 (patch)
tree55933c79b70f2bf56d7f547cb9facb7d66f0033d /pjmedia/include
parent66f91465de3c70018b6c31f14da273cdce518eb8 (diff)
Added mutex protection and option not to delete upstream/downstream port in master_port.c
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@498 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/include')
-rw-r--r--pjmedia/include/pjmedia/master_port.h57
1 files changed, 53 insertions, 4 deletions
diff --git a/pjmedia/include/pjmedia/master_port.h b/pjmedia/include/pjmedia/master_port.h
index 44b7db78..06af20b3 100644
--- a/pjmedia/include/pjmedia/master_port.h
+++ b/pjmedia/include/pjmedia/master_port.h
@@ -52,7 +52,7 @@ typedef struct pjmedia_master_port pjmedia_master_port;
* @param pool Pool to allocate master port from.
* @param u_port Upstream port.
* @param d_port Downstream port.
- * @param options Options flags.
+ * @param options Options flags, bitmask from #pjmedia_master_port_flag.
* @param p_m Pointer to receive the master port instance.
*
* @return PJ_SUCCESS on success.
@@ -64,7 +64,6 @@ PJ_DECL(pj_status_t) pjmedia_master_port_create(pj_pool_t *pool,
pjmedia_master_port **p_m);
-
/**
* Start the media flow.
*
@@ -75,7 +74,6 @@ PJ_DECL(pj_status_t) pjmedia_master_port_create(pj_pool_t *pool,
PJ_DECL(pj_status_t) pjmedia_master_port_start(pjmedia_master_port *m);
-
/**
* Stop the media flow.
*
@@ -87,14 +85,65 @@ PJ_DECL(pj_status_t) pjmedia_master_port_stop(pjmedia_master_port *m);
/**
+ * Change the upstream port. Note that application is responsible to destroy
+ * current upstream port (the one that is going to be replaced with the
+ * new port).
+ *
+ * @param m The master port.
+ * @param port Port to be used for upstream port.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_master_port_set_uport(pjmedia_master_port *m,
+ pjmedia_port *port);
+
+
+/**
+ * Get the upstream port.
+ *
+ * @param m The master port.
+ *
+ * @return The upstream port.
+ */
+PJ_DECL(pjmedia_port*) pjmedia_master_port_get_uport(pjmedia_master_port*m);
+
+
+/**
+ * Change the downstream port. Note that application is responsible to destroy
+ * current downstream port (the one that is going to be replaced with the
+ * new port).
+ *
+ * @param m The master port.
+ * @param port Port to be used for downstream port.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_master_port_set_dport(pjmedia_master_port *m,
+ pjmedia_port *port);
+
+
+/**
+ * Get the downstream port.
+ *
+ * @param m The master port.
+ *
+ * @return The downstream port.
+ */
+PJ_DECL(pjmedia_port*) pjmedia_master_port_get_dport(pjmedia_master_port*m);
+
+
+/**
* Destroy the master port, and optionally destroy the upstream and
* downstream ports.
*
* @param m The master port.
+ * @param destroy_ports If non-zero, the function will destroy both
+ * upstream and downstream ports too.
*
* @return PJ_SUCCESS on success.
*/
-PJ_DECL(pj_status_t) pjmedia_master_port_destroy(pjmedia_master_port *m);
+PJ_DECL(pj_status_t) pjmedia_master_port_destroy(pjmedia_master_port *m,
+ pj_bool_t destroy_ports);