- Timestamp:
- Apr 5, 2012 8:41:20 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c
r4012 r4028 228 228 */ 229 229 230 static pj_status_t find_codecs_with_rtp_packing( 231 const pj_str_t *codec_id, 232 unsigned *count, 233 const pjmedia_vid_codec_info *p_info[]) 234 { 235 const pjmedia_vid_codec_info *info[32]; 236 unsigned i, j, count_ = PJ_ARRAY_SIZE(info); 237 pj_status_t status; 238 239 status = pjmedia_vid_codec_mgr_find_codecs_by_id(NULL, codec_id, 240 &count_, info, NULL); 241 if (status != PJ_SUCCESS) 242 return status; 243 244 for (i = 0, j = 0; i < count_ && j<*count; ++i) { 245 if ((info[i]->packings & PJMEDIA_VID_PACKING_PACKETS) == 0) 246 continue; 247 p_info[j++] = info[i]; 248 } 249 *count = j; 250 return PJ_SUCCESS; 251 } 252 230 253 /* 231 254 * Enum all supported video codecs in the system. … … 292 315 pjmedia_vid_codec_param *param) 293 316 { 294 const pj_str_t all = { NULL, 0 }; 295 const pjmedia_vid_codec_info *info; 296 unsigned count = 1; 317 const pjmedia_vid_codec_info *info[2]; 318 unsigned count = 2; 297 319 pj_status_t status; 298 320 299 if (codec_id->slen==1 && *codec_id->ptr=='*') 300 codec_id = &all; 301 302 status = pjmedia_vid_codec_mgr_find_codecs_by_id(NULL, codec_id, 303 &count, &info, NULL); 321 status = find_codecs_with_rtp_packing(codec_id, &count, info); 304 322 if (status != PJ_SUCCESS) 305 323 return status; … … 308 326 return (count > 1? PJ_ETOOMANY : PJ_ENOTFOUND); 309 327 310 status = pjmedia_vid_codec_mgr_get_default_param(NULL, info , param);328 status = pjmedia_vid_codec_mgr_get_default_param(NULL, info[0], param); 311 329 return status; 312 330 } … … 324 342 pj_status_t status; 325 343 326 status = pjmedia_vid_codec_mgr_find_codecs_by_id(NULL, codec_id, 327 &count, info, NULL); 344 status = find_codecs_with_rtp_packing(codec_id, &count, info); 328 345 if (status != PJ_SUCCESS) 329 346 return status; 330 347 331 /* Codec ID should be specific */ 332 if (count > 1) { 333 pj_assert(!"Codec ID is not specific"); 334 return PJ_ETOOMANY; 335 } 348 if (count != 1) 349 return (count > 1? PJ_ETOOMANY : PJ_ENOTFOUND); 336 350 337 351 status = pjmedia_vid_codec_mgr_set_default_param(NULL, info[0], param);
Note: See TracChangeset
for help on using the changeset viewer.