Changeset 5831
- Timestamp:
- Jul 23, 2018 6:35:57 AM (6 years ago)
- Location:
- pjproject/trunk/pjmedia
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia-codec/opus.h
r5734 r5831 140 140 * 141 141 * @param cfg Opus codec configuration. 142 * @param param The new default Opus codec parameter. 142 * @param param On input, the default Opus codec parameter to be set. 143 * On output, the current default Opus codec parameter 144 * after setting. This may be different from the input 145 * because some settings can be rejected, or overwritten 146 * by the Opus codec configuration above. 143 147 * 144 148 * @return PJ_SUCCESS on success. -
pjproject/trunk/pjmedia/src/pjmedia-codec/opus.c
r5799 r5831 300 300 } 301 301 302 static void remove_fmtp(pjmedia_codec_fmtp *fmtp, pj_str_t *name) 303 { 304 int i, j; 305 for (i = 0; i < fmtp->cnt; i++) { 306 if (pj_stricmp(&fmtp->param[i].name, name) == 0) { 307 fmtp->cnt--; 308 for (j = i; j < fmtp->cnt; j++) { 309 fmtp->param[i].name = fmtp->param[i+1].name; 310 fmtp->param[i].val = fmtp->param[i+1].val; 311 } 312 } 313 } 314 } 315 302 316 static pj_status_t generate_fmtp(pjmedia_codec_param *attr) 303 317 { … … 317 331 if (idx >= 0) 318 332 attr->setting.dec_fmtp.param[idx].val = pj_str(clockrate_str); 333 } else { 334 remove_fmtp(&attr->setting.dec_fmtp, &STR_MAX_PLAYBACK); 335 remove_fmtp(&attr->setting.dec_fmtp, &STR_MAX_CAPTURE); 319 336 } 320 337 … … 327 344 attr->setting.dec_fmtp.param[idx].val = pj_str(bitrate_str); 328 345 } 346 } else { 347 remove_fmtp(&attr->setting.dec_fmtp, &STR_MAX_BIT_RATE); 329 348 } 330 349 … … 337 356 if (idx >= 0) 338 357 attr->setting.dec_fmtp.param[idx].val = pj_str("1"); 358 } else { 359 remove_fmtp(&attr->setting.dec_fmtp, &STR_STEREO); 360 remove_fmtp(&attr->setting.dec_fmtp, &STR_SPROP_STEREO); 339 361 } 340 362 … … 343 365 if (idx >= 0) 344 366 attr->setting.dec_fmtp.param[idx].val = pj_str("1"); 367 } else { 368 remove_fmtp(&attr->setting.dec_fmtp, &STR_CBR); 345 369 } 346 370 … … 349 373 if (idx >= 0) 350 374 attr->setting.dec_fmtp.param[idx].val = pj_str("1"); 375 } else { 376 remove_fmtp(&attr->setting.dec_fmtp, &STR_INBAND_FEC); 351 377 } 352 378 … … 355 381 if (idx >= 0) 356 382 attr->setting.dec_fmtp.param[idx].val = pj_str("1"); 383 } else { 384 remove_fmtp(&attr->setting.dec_fmtp, &STR_DTX); 357 385 } 358 386 … … 390 418 return PJ_EINVAL; 391 419 } 392 393 status = pjmedia_codec_mgr_get_default_param(codec_mgr, info[0], param);394 if (status != PJ_SUCCESS)395 return status;396 420 397 421 param->info.clock_rate = opus_cfg.sample_rate = cfg->sample_rate;
Note: See TracChangeset
for help on using the changeset viewer.