Ignore:
Timestamp:
Jul 5, 2012 7:26:29 AM (12 years ago)
Author:
nanang
Message:

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).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c

    r4123 r4197  
    6969#endif 
    7070 
     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 
    7178/* Video stream keep-alive feature is currently disabled. */ 
    7279#if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA != 0 
     
    13581365    pjmedia_video_format_detail *vfd_enc, *vfd_dec; 
    13591366    char *p; 
    1360     unsigned dec_mtu; 
    13611367    pj_status_t status; 
    13621368 
     
    14111417        info->codec_param->enc_mtu = PJMEDIA_MAX_MTU; 
    14121418 
    1413     /* MTU estimation for decoding direction */ 
    1414     dec_mtu = PJMEDIA_MAX_MTU; 
    1415  
     1419    /* Packet size estimation for decoding direction */ 
    14161420    vfd_enc = pjmedia_format_get_video_format_detail( 
    14171421                                        &info->codec_param->enc_fmt, PJ_TRUE); 
     
    15291533    /* Init jitter buffer parameters: */ 
    15301534    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; 
    15331538 
    15341539    /* JB max count, default 500ms */ 
     
    15651570    /* Create jitter buffer */ 
    15661571    status = pjmedia_jbuf_create(pool, &stream->dec->port.info.name, 
    1567                                  dec_mtu + PJMEDIA_STREAM_RESV_PAYLOAD_LEN, 
     1572                                 PJMEDIA_MAX_MRU, 
    15681573                                 1000 * vfd_enc->fps.denum / vfd_enc->fps.num, 
    15691574                                 jb_max, &stream->jb); 
Note: See TracChangeset for help on using the changeset viewer.