summaryrefslogtreecommitdiff
path: root/pjnath
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2012-07-05 07:26:29 +0000
committerNanang Izzuddin <nanang@teluu.com>2012-07-05 07:26:29 +0000
commit1d8e02448bda3f1bca867c8dc8e0d8feca4c74e1 (patch)
tree804c67c7a0e05d61b742da0f88d060ada3102563 /pjnath
parente914af2a02fbace89608ca2a72ea990ec8fbb1f5 (diff)
Fix #1547:
- Added PJMEDIA_MAX_MRU to specify maximum packet size in receiving direction. - Added max_pkt_size into pj_turn_sock_cfg, default is PJ_TURN_MAX_PKT_LEN. - Fixed hardcoded MTU settings in media transport SRTP. - Added MIN_CHUNKS_PER_FRM constant in video stream. Notes: - PJMEDIA_MAX_MTU & PJMEDIA_MAX_MRU to specify max packet size for TX and RX dir. - For ICE media transport, TURN session limits outgoing packet size to PJ_TURN_MAX_PKT_LEN (the size of internal buffer for inserting TURN overheads). git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4197 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjnath')
-rw-r--r--pjnath/include/pjnath/stun_sock.h4
-rw-r--r--pjnath/include/pjnath/turn_sock.h7
-rw-r--r--pjnath/src/pjnath/turn_sock.c3
3 files changed, 12 insertions, 2 deletions
diff --git a/pjnath/include/pjnath/stun_sock.h b/pjnath/include/pjnath/stun_sock.h
index 08b0c711..db7d1d04 100644
--- a/pjnath/include/pjnath/stun_sock.h
+++ b/pjnath/include/pjnath/stun_sock.h
@@ -218,7 +218,9 @@ typedef struct pj_stun_sock_info
typedef struct pj_stun_sock_cfg
{
/**
- * Packet buffer size. Default value is PJ_STUN_SOCK_PKT_LEN.
+ * Packet buffer size.
+ *
+ * Default value is PJ_STUN_SOCK_PKT_LEN.
*/
unsigned max_pkt_size;
diff --git a/pjnath/include/pjnath/turn_sock.h b/pjnath/include/pjnath/turn_sock.h
index 6057f39e..c1250856 100644
--- a/pjnath/include/pjnath/turn_sock.h
+++ b/pjnath/include/pjnath/turn_sock.h
@@ -109,6 +109,13 @@ typedef struct pj_turn_sock_cb
typedef struct pj_turn_sock_cfg
{
/**
+ * Packet buffer size.
+ *
+ * Default value is PJ_TURN_MAX_PKT_LEN.
+ */
+ unsigned max_pkt_size;
+
+ /**
* QoS traffic type to be set on this transport. When application wants
* to apply QoS tagging to the transport, it's preferable to set this
* field rather than \a qos_param fields since this is more portable.
diff --git a/pjnath/src/pjnath/turn_sock.c b/pjnath/src/pjnath/turn_sock.c
index e841af2c..131c433d 100644
--- a/pjnath/src/pjnath/turn_sock.c
+++ b/pjnath/src/pjnath/turn_sock.c
@@ -97,6 +97,7 @@ static void timer_cb(pj_timer_heap_t *th, pj_timer_entry *e);
PJ_DEF(void) pj_turn_sock_cfg_default(pj_turn_sock_cfg *cfg)
{
pj_bzero(cfg, sizeof(*cfg));
+ cfg->max_pkt_size = PJ_TURN_MAX_PKT_LEN;
cfg->qos_type = PJ_QOS_TYPE_BEST_EFFORT;
cfg->qos_ignore_error = PJ_TRUE;
}
@@ -474,7 +475,7 @@ static pj_bool_t on_connect_complete(pj_activesock_t *asock,
/* Kick start pending read operation */
status = pj_activesock_start_read(asock, turn_sock->pool,
- PJ_TURN_MAX_PKT_LEN, 0);
+ turn_sock->setting.max_pkt_size, 0);
/* Init send_key */
pj_ioqueue_op_key_init(&turn_sock->send_key, sizeof(turn_sock->send_key));