Changeset 276 for pjproject/trunk/pjmedia/src/pjmedia/session.c
- Timestamp:
- Mar 3, 2006 10:43:08 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/session.c
r225 r276 61 61 */ 62 62 static pj_status_t create_stream_info_from_sdp(pj_pool_t *pool, 63 pjmedia_endpt *endpt, 63 64 pjmedia_stream_info *si, 64 65 const pjmedia_sdp_conn *local_conn, … … 69 70 const pjmedia_sdp_attr *attr; 70 71 pjmedia_sdp_rtpmap *rtpmap; 71 unsigned i ;72 unsigned i, pt; 72 73 pj_status_t status; 73 74 … … 144 145 return PJMEDIA_EINVALIDPT; 145 146 146 /* Find rtpmap for the first codec. 147 * For this version of PJMEDIA, we do not support static payload 148 * type without rtpmap. 147 /* Get the payload number. */ 148 pt = pj_strtoul(&local_m->desc.fmt[0]); 149 150 /* Get codec info. 151 * For static payload types, get the info from codec manager. 152 * For dynamic payload types, MUST get the rtpmap. 149 153 */ 150 attr = pjmedia_sdp_media_find_attr(local_m, &ID_RTPMAP, 151 &local_m->desc.fmt[0]); 152 if (attr == NULL) 153 return PJMEDIA_EMISSINGRTPMAP; 154 155 status = pjmedia_sdp_attr_to_rtpmap(pool, attr, &rtpmap); 156 if (status != PJ_SUCCESS) 157 return status; 158 159 /* Build codec format info: */ 160 161 si->fmt.type = si->type; 162 si->fmt.pt = pj_strtoul(&local_m->desc.fmt[0]); 163 pj_strdup(pool, &si->fmt.encoding_name, &rtpmap->enc_name); 164 si->fmt.sample_rate = rtpmap->clock_rate; 154 if (pt < 96) { 155 156 pjmedia_codec_mgr *mgr; 157 158 mgr = pjmedia_endpt_get_codec_mgr(endpt); 159 160 status = pjmedia_codec_mgr_get_codec_info( mgr, pt, &si->fmt); 161 if (status != PJ_SUCCESS) 162 return status; 163 164 } else { 165 166 attr = pjmedia_sdp_media_find_attr(local_m, &ID_RTPMAP, 167 &local_m->desc.fmt[0]); 168 if (attr == NULL) 169 return PJMEDIA_EMISSINGRTPMAP; 170 171 status = pjmedia_sdp_attr_to_rtpmap(pool, attr, &rtpmap); 172 if (status != PJ_SUCCESS) 173 return status; 174 175 /* Build codec format info: */ 176 177 si->fmt.type = si->type; 178 si->fmt.pt = pj_strtoul(&local_m->desc.fmt[0]); 179 pj_strdup(pool, &si->fmt.encoding_name, &rtpmap->enc_name); 180 si->fmt.sample_rate = rtpmap->clock_rate; 181 } 165 182 166 183 /* Get local DTMF payload type */ … … 255 272 rem_conn = rem_m->conn ? rem_m->conn : rem_sdp->conn; 256 273 257 status = create_stream_info_from_sdp(session->pool, si,274 status = create_stream_info_from_sdp(session->pool, endpt, si, 258 275 local_conn, rem_conn, 259 276 local_m, rem_m);
Note: See TracChangeset
for help on using the changeset viewer.