Changeset 3956
- Timestamp:
- Feb 21, 2012 8:31:26 AM (13 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/vid_codec.h
r3901 r3956 620 620 PJ_DECL(pj_status_t) 621 621 pjmedia_vid_codec_mgr_set_default_param(pjmedia_vid_codec_mgr *mgr, 622 pj_pool_t *pool,623 622 const pjmedia_vid_codec_info *info, 624 623 const pjmedia_vid_codec_param *param); -
pjproject/trunk/pjmedia/src/pjmedia/vid_codec.c
r3901 r3956 34 34 35 35 36 /* Definition of default codecs parameters */ 37 typedef struct pjmedia_vid_codec_default_param 38 { 39 pj_pool_t *pool; 40 pjmedia_vid_codec_param *param; 41 } pjmedia_vid_codec_default_param; 42 43 36 44 /* 37 45 * Codec manager maintains array of these structs for each supported … … 44 52 pjmedia_codec_priority prio; /**< Priority. */ 45 53 pjmedia_vid_codec_factory *factory; /**< The factory. */ 46 pjmedia_vid_codec_ param*def_param; /**< Default codecs54 pjmedia_vid_codec_default_param *def_param; /**< Default codecs 47 55 parameters. */ 48 56 } pjmedia_vid_codec_desc; … … 52 60 struct pjmedia_vid_codec_mgr 53 61 { 62 /** Pool factory instance. */ 63 pj_pool_factory *pf; 64 54 65 /** Codec manager mutex. */ 55 66 pj_mutex_t *mutex; … … 117 128 118 129 mgr = PJ_POOL_ZALLOC_T(pool, pjmedia_vid_codec_mgr); 130 mgr->pf = pool->factory; 119 131 pj_list_init (&mgr->factory_list); 120 132 mgr->codec_cnt = 0; … … 612 624 /* If we found the codec and its default param is set, return it */ 613 625 if (codec_desc && codec_desc->def_param) { 614 pj_memcpy(param, codec_desc->def_param ,626 pj_memcpy(param, codec_desc->def_param->param, 615 627 sizeof(pjmedia_vid_codec_param)); 616 628 … … 652 664 PJ_DEF(pj_status_t) pjmedia_vid_codec_mgr_set_default_param( 653 665 pjmedia_vid_codec_mgr *mgr, 654 pj_pool_t *pool,655 666 const pjmedia_vid_codec_info *info, 656 667 const pjmedia_vid_codec_param *param ) … … 659 670 pjmedia_codec_id codec_id; 660 671 pjmedia_vid_codec_desc *codec_desc = NULL; 661 pjmedia_vid_codec_param *p; 672 pj_pool_t *pool, *old_pool = NULL; 673 pjmedia_vid_codec_default_param *p; 662 674 663 675 PJ_ASSERT_RETURN(info, PJ_EINVAL); … … 687 699 /* If codec param is previously set */ 688 700 if (codec_desc->def_param) { 701 pj_assert(codec_desc->def_param->pool); 702 old_pool = codec_desc->def_param->pool; 689 703 codec_desc->def_param = NULL; 690 704 } … … 695 709 if (NULL == param) { 696 710 pj_mutex_unlock(mgr->mutex); 711 if (old_pool) 712 pj_pool_release(old_pool); 697 713 return PJ_SUCCESS; 698 714 } 699 715 716 /* Create new default codec param instance */ 717 pool = pj_pool_create(mgr->pf, (char*)codec_id, 256, 256, NULL); 718 codec_desc->def_param = PJ_POOL_ZALLOC_T(pool, 719 pjmedia_vid_codec_default_param); 720 p = codec_desc->def_param; 721 p->pool = pool; 722 700 723 /* Update codec default param */ 701 p = pjmedia_vid_codec_param_clone(pool, param);724 p->param = pjmedia_vid_codec_param_clone(pool, param); 702 725 if (!p) 703 726 return PJ_EINVAL; -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c
r3940 r3956 333 333 } 334 334 335 status = pjmedia_vid_codec_mgr_set_default_param(NULL, pjsua_var.pool, 336 info[0], param); 335 status = pjmedia_vid_codec_mgr_set_default_param(NULL, info[0], param); 337 336 return status; 338 337 }
Note: See TracChangeset
for help on using the changeset viewer.