Changeset 5803 for pjproject/trunk/pjmedia/src/pjmedia/stream.c
- Timestamp:
- Jun 6, 2018 8:38:29 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/stream.c
r5799 r5803 87 87 unsigned out_pkt_size; /**< Size of output buffer. */ 88 88 void *out_pkt; /**< Output buffer. */ 89 unsigned out_pkt_len; /**< Length of data in buffer. */90 89 pjmedia_rtp_session rtp; /**< RTP session. */ 91 90 }; … … 531 530 for (samples_count=0; samples_count < samples_required;) { 532 531 char frame_type; 533 pj_size_t frame_size ;532 pj_size_t frame_size = channel->out_pkt_size; 534 533 pj_uint32_t bit_info; 535 534 … … 822 821 while (f->samples_cnt < samples_required) { 823 822 char frame_type; 824 pj_size_t frame_size ;823 pj_size_t frame_size = channel->out_pkt_size; 825 824 pj_uint32_t bit_info; 826 825 … … 2077 2076 2078 2077 if (param->type == PJMEDIA_TYPE_AUDIO) { 2079 channel->out_pkt_size = sizeof(pjmedia_rtp_hdr) + 2080 stream->codec_param.info.max_bps * 2081 PJMEDIA_MAX_FRAME_DURATION_MS / 2082 8 / 1000; 2078 unsigned max_rx_based_size; 2079 unsigned max_bps_based_size; 2080 2081 /* out_pkt buffer is used for sending and receiving, so lets calculate 2082 * its size based on both. For receiving, we have stream->frame_size, 2083 * which is used in configuring jitter buffer frame length. 2084 * For sending, it is based on codec max_bps info. 2085 */ 2086 max_rx_based_size = stream->frame_size; 2087 max_bps_based_size = stream->codec_param.info.max_bps * 2088 PJMEDIA_MAX_FRAME_DURATION_MS / 8 / 1000; 2089 channel->out_pkt_size = PJ_MAX(max_rx_based_size, max_bps_based_size); 2090 2091 /* Also include RTP header size (for sending) */ 2092 channel->out_pkt_size += sizeof(pjmedia_rtp_hdr); 2093 2083 2094 if (channel->out_pkt_size > PJMEDIA_MAX_MTU - 2084 2095 PJMEDIA_STREAM_RESV_PAYLOAD_LEN)
Note: See TracChangeset
for help on using the changeset viewer.