Changeset 3945 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
- Timestamp:
- Jan 27, 2012 9:12:59 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r3938 r3945 1939 1939 pjmedia_sdp_neg_state sdp_neg_state = PJMEDIA_SDP_NEG_STATE_NULL; 1940 1940 unsigned mi; 1941 unsigned tot_bandw_tias = 0; 1941 1942 pj_status_t status; 1942 1943 … … 2012 2013 pjmedia_sdp_media *m = NULL; 2013 2014 pjmedia_transport_info tpinfo; 2015 unsigned i; 2014 2016 2015 2017 if (rem_sdp && mi >= rem_sdp->media_count) { … … 2109 2111 sdp->conn = pjmedia_sdp_conn_clone(pool, m->conn); 2110 2112 } 2113 2114 2115 /* Find media bandwidth info */ 2116 for (i = 0; i < m->bandw_count; ++i) { 2117 const pj_str_t STR_BANDW_MODIFIER_TIAS = { "TIAS", 4 }; 2118 if (!pj_stricmp(&m->bandw[i]->modifier, &STR_BANDW_MODIFIER_TIAS)) 2119 { 2120 tot_bandw_tias += m->bandw[i]->value; 2121 break; 2122 } 2123 } 2111 2124 } 2112 2125 … … 2133 2146 pjmedia_sdp_attr_add(&sdp->attr_count, sdp->attr, a); 2134 2147 2148 } 2149 2150 2151 /* Add bandwidth info in session level using bandwidth modifier "AS". */ 2152 if (tot_bandw_tias) { 2153 unsigned bandw; 2154 const pj_str_t STR_BANDW_MODIFIER_AS = { "AS", 2 }; 2155 pjmedia_sdp_bandw *b; 2156 2157 /* AS bandwidth = RTP bitrate + RTCP bitrate. 2158 * RTP bitrate = payload bitrate (total TIAS) + overheads (~16kbps). 2159 * RTCP bitrate = est. 5% of RTP bitrate. 2160 * Note that AS bandwidth is in kbps. 2161 */ 2162 bandw = tot_bandw_tias + 16000; 2163 bandw += bandw * 5 / 100; 2164 b = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_bandw); 2165 b->modifier = STR_BANDW_MODIFIER_AS; 2166 b->value = bandw / 1000; 2167 sdp->bandw[sdp->bandw_count++] = b; 2135 2168 } 2136 2169
Note: See TracChangeset
for help on using the changeset viewer.