Changeset 4197 for pjproject/trunk
- Timestamp:
- Jul 5, 2012 7:26:29 AM (12 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/config.h
r4130 r4197 372 372 373 373 /** 374 * Max packet size to support.374 * Max packet size for transmitting direction. 375 375 */ 376 376 #ifndef PJMEDIA_MAX_MTU 377 377 # define PJMEDIA_MAX_MTU 1500 378 #endif 379 380 381 /** 382 * Max packet size for receiving direction. 383 */ 384 #ifndef PJMEDIA_MAX_MRU 385 # define PJMEDIA_MAX_MRU 2000 378 386 #endif 379 387 -
pjproject/trunk/pjmedia/src/pjmedia/transport_srtp.c
r3999 r4197 35 35 #define THIS_FILE "transport_srtp.c" 36 36 37 /* Maximum size of packet */ 38 #define MAX_RTP_BUFFER_LEN 1500 39 #define MAX_RTCP_BUFFER_LEN 1500 37 /* Maximum size of outgoing packet */ 38 #define MAX_RTP_BUFFER_LEN PJMEDIA_MAX_MTU 39 #define MAX_RTCP_BUFFER_LEN PJMEDIA_MAX_MTU 40 41 /* Maximum SRTP crypto key length */ 40 42 #define MAX_KEY_LEN 32 41 43 … … 778 780 return pjmedia_transport_send_rtp(srtp->member_tp, pkt, size); 779 781 780 if (size > sizeof(srtp->rtp_tx_buffer) )782 if (size > sizeof(srtp->rtp_tx_buffer) - 10) 781 783 return PJ_ETOOBIG; 782 784 … … 792 794 793 795 if (err == err_status_ok) { 794 status = pjmedia_transport_send_rtp(srtp->member_tp, srtp->rtp_tx_buffer, len); 796 status = pjmedia_transport_send_rtp(srtp->member_tp, 797 srtp->rtp_tx_buffer, len); 795 798 } else { 796 799 status = PJMEDIA_ERRNO_FROM_LIBSRTP(err); … … 823 826 } 824 827 825 if (size > sizeof(srtp->rtcp_tx_buffer) )828 if (size > sizeof(srtp->rtcp_tx_buffer) - 10) 826 829 return PJ_ETOOBIG; 827 830 -
pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c
r3841 r4197 30 30 31 31 /* Maximum size of incoming RTP packet */ 32 #define RTP_LEN PJMEDIA_MAX_M TU32 #define RTP_LEN PJMEDIA_MAX_MRU 33 33 34 34 /* Maximum size of incoming RTCP packet */ … … 43 43 typedef struct pending_write 44 44 { 45 char buffer[ RTP_LEN];45 char buffer[PJMEDIA_MAX_MTU]; 46 46 pj_ioqueue_op_key_t op_key; 47 47 } pending_write; … … 753 753 754 754 /* Check that the size is supported */ 755 PJ_ASSERT_RETURN(size <= RTP_LEN, PJ_ETOOBIG);755 PJ_ASSERT_RETURN(size <= PJMEDIA_MAX_MTU, PJ_ETOOBIG); 756 756 757 757 /* Simulate packet lost on TX direction */ -
pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c
r4123 r4197 69 69 #endif 70 70 71 /* Due to network MTU limitation, a picture bitstream may be splitted into 72 * several chunks for RTP delivery. The chunk number may vary depend on the 73 * picture resolution and MTU. This constant specifies the minimum chunk 74 * number to be allocated to store a picture bitstream in decoding direction. 75 */ 76 #define MIN_CHUNKS_PER_FRM 30 77 71 78 /* Video stream keep-alive feature is currently disabled. */ 72 79 #if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA != 0 … … 1358 1365 pjmedia_video_format_detail *vfd_enc, *vfd_dec; 1359 1366 char *p; 1360 unsigned dec_mtu;1361 1367 pj_status_t status; 1362 1368 … … 1411 1417 info->codec_param->enc_mtu = PJMEDIA_MAX_MTU; 1412 1418 1413 /* MTU estimation for decoding direction */ 1414 dec_mtu = PJMEDIA_MAX_MTU; 1415 1419 /* Packet size estimation for decoding direction */ 1416 1420 vfd_enc = pjmedia_format_get_video_format_detail( 1417 1421 &info->codec_param->enc_fmt, PJ_TRUE); … … 1529 1533 /* Init jitter buffer parameters: */ 1530 1534 frm_ptime = 1000 * vfd_enc->fps.denum / vfd_enc->fps.num; 1531 chunks_per_frm = stream->frame_size / dec_mtu; 1532 if (chunks_per_frm == 0) chunks_per_frm = 1; 1535 chunks_per_frm = stream->frame_size / PJMEDIA_MAX_MRU; 1536 if (chunks_per_frm < MIN_CHUNKS_PER_FRM) 1537 chunks_per_frm = MIN_CHUNKS_PER_FRM; 1533 1538 1534 1539 /* JB max count, default 500ms */ … … 1565 1570 /* Create jitter buffer */ 1566 1571 status = pjmedia_jbuf_create(pool, &stream->dec->port.info.name, 1567 dec_mtu + PJMEDIA_STREAM_RESV_PAYLOAD_LEN,1572 PJMEDIA_MAX_MRU, 1568 1573 1000 * vfd_enc->fps.denum / vfd_enc->fps.num, 1569 1574 jb_max, &stream->jb); -
pjproject/trunk/pjnath/include/pjnath/stun_sock.h
r3553 r4197 219 219 { 220 220 /** 221 * Packet buffer size. Default value is PJ_STUN_SOCK_PKT_LEN. 221 * Packet buffer size. 222 * 223 * Default value is PJ_STUN_SOCK_PKT_LEN. 222 224 */ 223 225 unsigned max_pkt_size; -
pjproject/trunk/pjnath/include/pjnath/turn_sock.h
r3553 r4197 109 109 typedef struct pj_turn_sock_cfg 110 110 { 111 /** 112 * Packet buffer size. 113 * 114 * Default value is PJ_TURN_MAX_PKT_LEN. 115 */ 116 unsigned max_pkt_size; 117 111 118 /** 112 119 * QoS traffic type to be set on this transport. When application wants -
pjproject/trunk/pjnath/src/pjnath/turn_sock.c
r3841 r4197 98 98 { 99 99 pj_bzero(cfg, sizeof(*cfg)); 100 cfg->max_pkt_size = PJ_TURN_MAX_PKT_LEN; 100 101 cfg->qos_type = PJ_QOS_TYPE_BEST_EFFORT; 101 102 cfg->qos_ignore_error = PJ_TRUE; … … 475 476 /* Kick start pending read operation */ 476 477 status = pj_activesock_start_read(asock, turn_sock->pool, 477 PJ_TURN_MAX_PKT_LEN, 0);478 turn_sock->setting.max_pkt_size, 0); 478 479 479 480 /* Init send_key */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r4196 r4197 720 720 sizeof(cfg->qos_params)); 721 721 } 722 723 /* Configure packet size for STUN and TURN sockets */ 724 ice_cfg.stun.cfg.max_pkt_size = PJMEDIA_MAX_MRU; 725 ice_cfg.turn.cfg.max_pkt_size = PJMEDIA_MAX_MRU; 722 726 723 727 pj_bzero(&ice_cb, sizeof(pjmedia_ice_cb));
Note: See TracChangeset
for help on using the changeset viewer.