Changeset 4577 for pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c
- Timestamp:
- Aug 1, 2013 4:18:15 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c
r4554 r4577 34 34 pjmedia_sdp_neg_state state; /**< Negotiator state. */ 35 35 pj_bool_t prefer_remote_codec_order; 36 pj_bool_t answer_with_multiple_codecs; 36 37 pj_bool_t has_remote_answer; 37 38 pj_bool_t answer_was_remote; … … 115 116 neg->state = PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER; 116 117 neg->prefer_remote_codec_order = PJMEDIA_SDP_NEG_PREFER_REMOTE_CODEC_ORDER; 118 neg->answer_with_multiple_codecs = PJMEDIA_SDP_NEG_ANSWER_MULTIPLE_CODECS; 117 119 neg->initial_sdp = pjmedia_sdp_session_clone(pool, local); 118 120 neg->neg_local_sdp = pjmedia_sdp_session_clone(pool, local); … … 179 181 PJ_ASSERT_RETURN(neg, PJ_EINVAL); 180 182 neg->prefer_remote_codec_order = prefer_remote; 183 return PJ_SUCCESS; 184 } 185 186 187 /* 188 * Set multiple codec answering. 189 */ 190 PJ_DEF(pj_status_t) pjmedia_sdp_neg_set_answer_multiple_codecs( 191 pjmedia_sdp_neg *neg, 192 pj_bool_t answer_multiple) 193 { 194 PJ_ASSERT_RETURN(neg, PJ_EINVAL); 195 neg->answer_with_multiple_codecs = answer_multiple; 181 196 return PJ_SUCCESS; 182 197 } … … 1011 1026 static pj_status_t match_offer(pj_pool_t *pool, 1012 1027 pj_bool_t prefer_remote_codec_order, 1028 pj_bool_t answer_with_multiple_codecs, 1013 1029 const pjmedia_sdp_media *offer, 1014 1030 const pjmedia_sdp_media *preanswer, … … 1076 1092 master_has_codec = 1; 1077 1093 1078 /* We just need to select one codec .1094 /* We just need to select one codec if not allowing multiple. 1079 1095 * Continue if we have selected matching codec for previous 1080 1096 * payload. 1081 1097 */ 1082 if ( found_matching_codec)1098 if (!answer_with_multiple_codecs && found_matching_codec) 1083 1099 continue; 1084 1100 … … 1120 1136 } else { 1121 1137 master_has_codec = 1; 1122 if ( found_matching_codec)1138 if (!answer_with_multiple_codecs && found_matching_codec) 1123 1139 continue; 1124 1140 is_codec = 1; … … 1278 1294 static pj_status_t create_answer( pj_pool_t *pool, 1279 1295 pj_bool_t prefer_remote_codec_order, 1296 pj_bool_t answer_with_multiple_codecs, 1280 1297 const pjmedia_sdp_session *initial, 1281 1298 const pjmedia_sdp_session *offer, … … 1327 1344 1328 1345 /* See if it has matching codec. */ 1329 status2 = match_offer(pool, prefer_remote_codec_order, 1346 status2 = match_offer(pool, prefer_remote_codec_order, 1347 answer_with_multiple_codecs, 1330 1348 om, im, initial, &am); 1331 1349 if (status2 == PJ_SUCCESS) { … … 1425 1443 pjmedia_sdp_session *answer = NULL; 1426 1444 1427 status = create_answer(pool, neg->prefer_remote_codec_order, 1445 status = create_answer(pool, neg->prefer_remote_codec_order, 1446 neg->answer_with_multiple_codecs, 1428 1447 neg->neg_local_sdp, neg->neg_remote_sdp, 1429 1448 &answer);
Note: See TracChangeset
for help on using the changeset viewer.