Changeset 4197 for pjproject/trunk/pjmedia/src/pjmedia/vid_stream.c
- Timestamp:
- Jul 5, 2012 7:26:29 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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);
Note: See TracChangeset
for help on using the changeset viewer.