Changeset 3969 for pjproject/branches/1.x/pjmedia/src/pjmedia/stream.c
- Timestamp:
- Mar 8, 2012 8:34:30 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/1.x/pjmedia/src/pjmedia/stream.c
r3960 r3969 145 145 pj_bool_t initial_rr; /**< Initial RTCP RR sent */ 146 146 pj_bool_t rtcp_sdes_bye_disabled;/**< Send RTCP SDES/BYE?*/ 147 void *out_rtcp_pkt; /**< Outgoing RTCP packet. */ 148 unsigned out_rtcp_pkt_size; 149 /**< Outgoing RTCP packet size. */ 147 150 148 151 /* RFC 2833 DTMF transmission queue: */ … … 927 930 928 931 if (with_sdes || with_bye || with_xr) { 929 pkt = (pj_uint8_t*) stream-> enc->out_pkt;932 pkt = (pj_uint8_t*) stream->out_rtcp_pkt; 930 933 pj_memcpy(pkt, sr_rr_pkt, len); 931 max_len = stream-> enc->out_pkt_size;934 max_len = stream->out_rtcp_pkt_size; 932 935 } else { 933 936 pkt = sr_rr_pkt; … … 1890 1893 pjmedia_channel *channel; 1891 1894 pj_status_t status; 1892 unsigned min_out_pkt_size;1893 1895 1894 1896 /* Allocate memory for channel descriptor */ … … 1914 1916 if (channel->out_pkt_size > PJMEDIA_MAX_MTU) 1915 1917 channel->out_pkt_size = PJMEDIA_MAX_MTU; 1916 1917 /* It should big enough to hold (minimally) RTCP SR with an SDES. */1918 min_out_pkt_size = sizeof(pjmedia_rtcp_sr_pkt) +1919 sizeof(pjmedia_rtcp_common) +1920 (4 + stream->cname.slen) +1921 32;1922 1923 if (channel->out_pkt_size < min_out_pkt_size)1924 channel->out_pkt_size = min_out_pkt_size;1925 1918 1926 1919 channel->out_pkt = pj_pool_alloc(pool, channel->out_pkt_size); … … 2261 2254 } 2262 2255 } 2256 2257 /* Allocate outgoing RTCP buffer, should be enough to hold SR/RR, SDES, 2258 * BYE, and XR. 2259 */ 2260 stream->out_rtcp_pkt_size = sizeof(pjmedia_rtcp_sr_pkt) + 2261 sizeof(pjmedia_rtcp_common) + 2262 (4 + stream->cname.slen) + 2263 32; 2264 #if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0) 2265 if (info->rtcp_xr_enabled) { 2266 stream->out_rtcp_pkt_size += sizeof(pjmedia_rtcp_xr_pkt); 2267 } 2268 #endif 2269 2270 if (stream->out_rtcp_pkt_size > PJMEDIA_MAX_MTU) 2271 stream->out_rtcp_pkt_size = PJMEDIA_MAX_MTU; 2272 2273 stream->out_rtcp_pkt = pj_pool_alloc(pool, stream->out_rtcp_pkt_size); 2263 2274 2264 2275 /* Only attach transport when stream is ready. */
Note: See TracChangeset
for help on using the changeset viewer.