Changeset 411 for pjproject/trunk/pjmedia/src/pjmedia/endpoint.c
- Timestamp:
- Apr 27, 2006 10:36:40 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/endpoint.c
r350 r411 330 330 for (i=0; i<endpt->codec_mgr.codec_cnt; ++i) { 331 331 332 pjmedia_codec_info *codec_info = &endpt->codec_mgr.codecs[i];332 pjmedia_codec_info *codec_info; 333 333 pjmedia_sdp_rtpmap rtpmap; 334 char tmp_param[3]; 334 335 pjmedia_sdp_attr *attr; 335 pj_str_t *fmt = &m->desc.fmt[m->desc.fmt_count++]; 336 pj_str_t *fmt; 337 338 if (endpt->codec_mgr.codec_desc[i].prio == PJMEDIA_CODEC_PRIO_DISABLED) 339 break; 340 341 codec_info = &endpt->codec_mgr.codec_desc[i].info; 342 fmt = &m->desc.fmt[m->desc.fmt_count++]; 336 343 337 344 fmt->ptr = pj_pool_alloc(pool, 8); … … 339 346 340 347 rtpmap.pt = *fmt; 341 rtpmap.clock_rate = codec_info-> sample_rate;348 rtpmap.clock_rate = codec_info->clock_rate; 342 349 rtpmap.enc_name = codec_info->encoding_name; 343 rtpmap.param.slen = 0; 350 351 /* For audio codecs, rtpmap parameters denotes the number 352 * of channels, which can be omited if the value is 1. 353 */ 354 if (codec_info->type == PJMEDIA_TYPE_AUDIO && 355 codec_info->channel_cnt > 1) 356 { 357 /* Can only support one digit channel count */ 358 pj_assert(codec_info->channel_cnt < 10); 359 360 tmp_param[0] = '/'; 361 tmp_param[1] = (char)('0' + codec_info->channel_cnt); 362 363 rtpmap.param.ptr = tmp_param; 364 rtpmap.param.slen = 2; 365 366 } else { 367 rtpmap.param.slen = 0; 368 } 344 369 345 370 pjmedia_sdp_rtpmap_to_attr(pool, &rtpmap, &attr); … … 389 414 count = PJ_ARRAY_SIZE(codec_info); 390 415 if (pjmedia_codec_mgr_enum_codecs(&endpt->codec_mgr, 391 &count, codec_info ) != PJ_SUCCESS)416 &count, codec_info, NULL) != PJ_SUCCESS) 392 417 { 393 418 PJ_LOG(3,(THIS_FILE, " -error: failed to enum codecs")); … … 417 442 418 443 PJ_LOG(3,(THIS_FILE, 419 " %s codec #%2d: pt=%d (%.*s @%dKHz , %d bps, ptime=%d ms, vad=%d, cng=%d)",444 " %s codec #%2d: pt=%d (%.*s @%dKHz/%d, %d bps, ptime=%d ms, vad=%d, cng=%d)", 420 445 type, i, codec_info[i].pt, 421 446 (int)codec_info[i].encoding_name.slen, 422 447 codec_info[i].encoding_name.ptr, 423 codec_info[i].sample_rate/1000, 448 codec_info[i].clock_rate/1000, 449 codec_info[i].channel_cnt, 424 450 param.avg_bps, param.ptime, 425 param.vad _enabled,426 param.cng _enabled));451 param.vad, 452 param.cng)); 427 453 } 428 454 #endif
Note: See TracChangeset
for help on using the changeset viewer.