Changeset 4577 for pjproject/trunk
- Timestamp:
- Aug 1, 2013 4:18:15 AM (11 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/config.h
r4538 r4577 669 669 #endif 670 670 671 /** 672 * This specifies the behavior of the SDP negotiator when responding to an 673 * offer, whether it should answer with multiple formats or not. 674 * 675 * Note that this behavior can be changed during run-time by calling 676 * pjmedia_sdp_neg_set_allow_multiple_codecs(). 677 * 678 * Default is 0 (to maintain backward compatibility) 679 */ 680 #ifndef PJMEDIA_SDP_NEG_ANSWER_MULTIPLE_CODECS 681 # define PJMEDIA_SDP_NEG_ANSWER_MULTIPLE_CODECS 0 682 #endif 683 671 684 672 685 /** -
pjproject/trunk/pjmedia/include/pjmedia/sdp_neg.h
r4562 r4577 417 417 pj_bool_t prefer_remote); 418 418 419 /** 420 * This specifies the behavior of the SDP negotiator when responding to an 421 * offer, whether it should answer with multiple formats or not. 422 * 423 * By default, the value in PJMEDIA_SDP_NEG_ANSWER_MULTIPLE_CODECS will 424 * be used. 425 * 426 * @param neg The SDP negotiator instance. 427 * @param answer_multiple 428 * If non-zero, the negotiator will respond with 429 * multiple formats. If zero only a single format 430 * will be returned. 431 */ 432 PJ_DECL(pj_status_t) 433 pjmedia_sdp_neg_set_answer_multiple_codecs(pjmedia_sdp_neg *neg, 434 pj_bool_t answer_multiple); 435 419 436 420 437 /** -
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.