Index: /pjproject/trunk/pjmedia/src/pjmedia-audiodev/symb_vas_dev.cpp
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia-audiodev/symb_vas_dev.cpp	(revision 3074)
+++ /pjproject/trunk/pjmedia/src/pjmedia-audiodev/symb_vas_dev.cpp	(revision 3075)
@@ -492,8 +492,4 @@
 	break;
 	
-    case EAMR_NB:
-	enc_fmt_if->SetBitRate(setting_.mode);
-	break;
-	
     default:
 	break;
Index: /pjproject/trunk/pjmedia/src/pjmedia-codec/ipp_codecs.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia-codec/ipp_codecs.c	(revision 3074)
+++ /pjproject/trunk/pjmedia/src/pjmedia-codec/ipp_codecs.c	(revision 3075)
@@ -1196,7 +1196,4 @@
 		  s->enc_mode,
 		  codec_data->info->params.modes.bitrate));
-
-	/* Return back bitrate info to application */
-	attr->info.avg_bps = codec_data->info->params.modes.bitrate;
     }
 #endif
Index: /pjproject/trunk/pjmedia/src/pjmedia-codec/passthrough.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia-codec/passthrough.c	(revision 3074)
+++ /pjproject/trunk/pjmedia/src/pjmedia-codec/passthrough.c	(revision 3075)
@@ -25,5 +25,4 @@
 #include <pj/assert.h>
 #include <pj/log.h>
-#include <pj/math.h>
 #include <pj/pool.h>
 #include <pj/string.h>
@@ -682,8 +681,5 @@
 	amr_settings_t *s;
 	pj_uint8_t octet_align = 0;
-	pj_int8_t enc_mode;
-
-	enc_mode = pjmedia_codec_amr_get_mode(attr->info.avg_bps);
-	pj_assert(enc_mode >= 0 && enc_mode <= 8);
+	const pj_str_t STR_FMTP_OCTET_ALIGN = {"octet-align", 11};
 
 	/* Fetch octet-align setting. It should be fine to fetch only 
@@ -692,6 +688,4 @@
 	 */
 	for (i = 0; i < attr->setting.dec_fmtp.cnt; ++i) {
-	    const pj_str_t STR_FMTP_OCTET_ALIGN = {"octet-align", 11};
-
 	    if (pj_stricmp(&attr->setting.dec_fmtp.param[i].name, 
 			   &STR_FMTP_OCTET_ALIGN) == 0)
@@ -703,54 +697,8 @@
 	}
 
-	for (i = 0; i < attr->setting.enc_fmtp.cnt; ++i) {
-	    /* mode-set, encoding mode is chosen based on local default mode 
-	     * setting:
-	     * - if local default mode is included in the mode-set, use it
-	     * - otherwise, find the closest mode to local default mode;
-	     *   if there are two closest modes, prefer to use the higher
-	     *   one, e.g: local default mode is 4, the mode-set param
-	     *   contains '2,3,5,6', then 5 will be chosen.
-	     */
-	    const pj_str_t STR_FMTP_MODE_SET = {"mode-set", 8};
-	    
-	    if (pj_stricmp(&attr->setting.enc_fmtp.param[i].name, 
-			   &STR_FMTP_MODE_SET) == 0)
-	    {
-		const char *p;
-		pj_size_t l;
-		pj_int8_t diff = 99;
-		
-		p = pj_strbuf(&attr->setting.enc_fmtp.param[i].val);
-		l = pj_strlen(&attr->setting.enc_fmtp.param[i].val);
-
-		while (l--) {
-		    if ((desc->pt==PJMEDIA_RTP_PT_AMR && *p>='0' && *p<='7') ||
-		        (desc->pt==PJMEDIA_RTP_PT_AMRWB && *p>='0' && *p<='8'))
-		    {
-			pj_int8_t tmp = (pj_int8_t)(*p - '0' - enc_mode);
-
-			if (PJ_ABS(diff) > PJ_ABS(tmp) || 
-			    (PJ_ABS(diff) == PJ_ABS(tmp) && tmp > diff))
-			{
-			    diff = tmp;
-			    if (diff == 0) break;
-			}
-		    }
-		    ++p;
-		}
-
-		if (diff == 99)
-		    return PJMEDIA_CODEC_EFAILED;
-
-		enc_mode = (pj_int8_t)(enc_mode + diff);
-
-		break;
-	    }
-	}
-
 	s = PJ_POOL_ZALLOC_T(pool, amr_settings_t);
 	codec_data->codec_setting = s;
 
-	s->enc_mode = enc_mode;
+	s->enc_mode = pjmedia_codec_amr_get_mode(desc->def_bitrate);
 	if (s->enc_mode < 0)
 	    return PJMEDIA_CODEC_EINMODE;
@@ -768,9 +716,4 @@
 					      doesn't do sensitivity bits 
 					      reordering */
-
-	/* Return back bitrate info to application */
-	attr->info.avg_bps = s->enc_setting.amr_nb?
-				pjmedia_codec_amrnb_bitrates[s->enc_mode]:
-				pjmedia_codec_amrwb_bitrates[s->enc_mode];
     }
 #endif
Index: /pjproject/trunk/pjmedia/src/pjmedia/codec.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/codec.c	(revision 3074)
+++ /pjproject/trunk/pjmedia/src/pjmedia/codec.c	(revision 3075)
@@ -23,4 +23,5 @@
 #include <pj/assert.h>
 #include <pj/log.h>
+#include <pj/pool.h>
 #include <pj/string.h>
 
@@ -28,11 +29,4 @@
 
 
-
-/* Definition of default codecs parameters */
-struct pjmedia_codec_default_param
-{
-    pj_pool_t		*pool;
-    pjmedia_codec_param	*param;
-};
 
 
@@ -44,53 +38,10 @@
  * Initialize codec manager.
  */
-PJ_DEF(pj_status_t) pjmedia_codec_mgr_init (pjmedia_codec_mgr *mgr,
-					    pj_pool_factory *pf)
-{
-    pj_status_t status;
-
-    PJ_ASSERT_RETURN(mgr && pf, PJ_EINVAL);
-
-    /* Init codec manager */
-    pj_bzero(mgr, sizeof(pjmedia_codec_mgr));
-    mgr->pf = pf;
+PJ_DEF(pj_status_t) pjmedia_codec_mgr_init (pjmedia_codec_mgr *mgr)
+{
+    PJ_ASSERT_RETURN(mgr, PJ_EINVAL);
+
     pj_list_init (&mgr->factory_list);
     mgr->codec_cnt = 0;
-
-    /* Create pool */
-    mgr->pool = pj_pool_create(mgr->pf, "codec-mgr", 256, 256, NULL);
-
-    /* Create mutex */
-    status = pj_mutex_create_recursive(mgr->pool, "codec-mgr", &mgr->mutex);
-    if (status != PJ_SUCCESS)
-	return status;
-
-    return PJ_SUCCESS;
-}
-
-/*
- * Initialize codec manager.
- */
-PJ_DEF(pj_status_t) pjmedia_codec_mgr_destroy (pjmedia_codec_mgr *mgr)
-{
-    unsigned i;
-
-    PJ_ASSERT_RETURN(mgr, PJ_EINVAL);
-
-    /* Cleanup all pools of all codec default params */
-    for (i=0; i<mgr->codec_cnt; ++i) {
-	if (mgr->codec_desc[i].param) {
-	    pj_assert(mgr->codec_desc[i].param->pool);
-	    pj_pool_release(mgr->codec_desc[i].param->pool);
-	}
-    }
-
-    /* Destroy mutex */
-    pj_mutex_destroy(mgr->mutex);
-
-    /* Release pool */
-    pj_pool_release(mgr->pool);
-
-    /* Just for safety, set codec manager states to zero */
-    pj_bzero(mgr, sizeof(pjmedia_codec_mgr));
 
     return PJ_SUCCESS;
@@ -115,12 +66,9 @@
     if (status != PJ_SUCCESS)
 	return status;
-
-    pj_mutex_lock(mgr->mutex);
+    
 
     /* Check codec count */
-    if (count + mgr->codec_cnt > PJ_ARRAY_SIZE(mgr->codec_desc)) {
-	pj_mutex_unlock(mgr->mutex);
+    if (count + mgr->codec_cnt > PJ_ARRAY_SIZE(mgr->codec_desc))
 	return PJ_ETOOMANY;
-    }
 
 
@@ -145,5 +93,4 @@
     pj_list_push_back(&mgr->factory_list, factory);
 
-    pj_mutex_unlock(mgr->mutex);
 
     return PJ_SUCCESS;
@@ -161,11 +108,7 @@
     PJ_ASSERT_RETURN(mgr && factory, PJ_EINVAL);
 
-    pj_mutex_lock(mgr->mutex);
-
     /* Factory must be registered. */
-    if (pj_list_find_node(&mgr->factory_list, factory) != factory) {
-	pj_mutex_unlock(mgr->mutex);
-	return PJ_ENOTFOUND;
-    }
+    PJ_ASSERT_RETURN(pj_list_find_node(&mgr->factory_list, factory)==factory,
+		     PJ_ENOTFOUND);
 
     /* Erase factory from the factory list */
@@ -179,11 +122,5 @@
 
 	if (mgr->codec_desc[i].factory == factory) {
-	    /* Release pool of codec default param */
-	    if (mgr->codec_desc[i].param) {
-		pj_assert(mgr->codec_desc[i].param->pool);
-		pj_pool_release(mgr->codec_desc[i].param->pool);
-	    }
-
-	    /* Remove the codec from array of codec descriptions */
+
 	    pj_array_erase(mgr->codec_desc, sizeof(mgr->codec_desc[0]), 
 			   mgr->codec_cnt, i);
@@ -195,5 +132,4 @@
     }
 
-    pj_mutex_unlock(mgr->mutex);
 
     return PJ_SUCCESS;
@@ -212,6 +148,4 @@
 
     PJ_ASSERT_RETURN(mgr && count && codecs, PJ_EINVAL);
-
-    pj_mutex_lock(mgr->mutex);
 
     if (*count > mgr->codec_cnt)
@@ -229,6 +163,4 @@
     }
 
-    pj_mutex_unlock(mgr->mutex);
-
     return PJ_SUCCESS;
 }
@@ -246,16 +178,10 @@
     PJ_ASSERT_RETURN(mgr && p_info && pt>=0 && pt < 96, PJ_EINVAL);
 
-    pj_mutex_lock(mgr->mutex);
-
     for (i=0; i<mgr->codec_cnt; ++i) {
 	if (mgr->codec_desc[i].info.pt == pt) {
 	    *p_info = &mgr->codec_desc[i].info;
-
-	    pj_mutex_unlock(mgr->mutex);
 	    return PJ_SUCCESS;
 	}
     }
-
-    pj_mutex_unlock(mgr->mutex);
 
     return PJMEDIA_CODEC_EUNSUP;
@@ -305,6 +231,4 @@
     PJ_ASSERT_RETURN(mgr && codec_id && count && *count, PJ_EINVAL);
 
-    pj_mutex_lock(mgr->mutex);
-
     for (i=0; i<mgr->codec_cnt; ++i) {
 
@@ -326,6 +250,4 @@
 
     }
-
-    pj_mutex_unlock(mgr->mutex);
 
     *count = found;
@@ -391,6 +313,4 @@
 
     PJ_ASSERT_RETURN(mgr && codec_id, PJ_EINVAL);
-
-    pj_mutex_lock(mgr->mutex);
 
     /* Update the priorities of affected codecs */
@@ -406,13 +326,10 @@
     }
 
-    if (!found) {
-	pj_mutex_unlock(mgr->mutex);
+    if (!found)
 	return PJ_ENOTFOUND;
-    }
 
     /* Re-sort codecs */
     sort_codecs(mgr);
-
-    pj_mutex_unlock(mgr->mutex);
+ 
 
     return PJ_SUCCESS;
@@ -434,6 +351,4 @@
     *p_codec = NULL;
 
-    pj_mutex_lock(mgr->mutex);
-
     factory = mgr->factory_list.next;
     while (factory != &mgr->factory_list) {
@@ -442,8 +357,6 @@
 
 	    status = (*factory->op->alloc_codec)(factory, info, p_codec);
-	    if (status == PJ_SUCCESS) {
-		pj_mutex_unlock(mgr->mutex);
+	    if (status == PJ_SUCCESS)
 		return PJ_SUCCESS;
-	    }
 
 	}
@@ -452,5 +365,4 @@
     }
 
-    pj_mutex_unlock(mgr->mutex);
 
     return PJMEDIA_CODEC_EUNSUP;
@@ -467,34 +379,7 @@
     pjmedia_codec_factory *factory;
     pj_status_t status;
-    pjmedia_codec_id codec_id;
-    struct pjmedia_codec_desc *codec_desc = NULL;
-    unsigned i;
 
     PJ_ASSERT_RETURN(mgr && info && param, PJ_EINVAL);
 
-    if (!pjmedia_codec_info_to_id(info, (char*)&codec_id, sizeof(codec_id)))
-	return PJ_EINVAL;
-
-    pj_mutex_lock(mgr->mutex);
-
-    /* First, lookup default param in codec desc */
-    for (i=0; i < mgr->codec_cnt; ++i) {
-	if (pj_ansi_stricmp(codec_id, mgr->codec_desc[i].id) == 0) {
-	    codec_desc = &mgr->codec_desc[i];
-	    break;
-	}
-    }
-
-    /* If we found the codec and its default param is set, return it */
-    if (codec_desc && codec_desc->param) {
-	pj_assert(codec_desc->param->param);
-	pj_memcpy(param, codec_desc->param->param, 
-		  sizeof(pjmedia_codec_param));
-
-	pj_mutex_unlock(mgr->mutex);
-	return PJ_SUCCESS;
-    }
-
-    /* Otherwise query the default param from codec factory */
     factory = mgr->factory_list.next;
     while (factory != &mgr->factory_list) {
@@ -508,5 +393,4 @@
 		    param->info.max_bps = param->info.avg_bps;
 
-		pj_mutex_unlock(mgr->mutex);
 		return PJ_SUCCESS;
 	    }
@@ -517,86 +401,6 @@
     }
 
-    pj_mutex_unlock(mgr->mutex);
-
 
     return PJMEDIA_CODEC_EUNSUP;
-}
-
-
-/*
- * Set default codec parameter.
- */
-PJ_DEF(pj_status_t) pjmedia_codec_mgr_set_default_param( 
-					    pjmedia_codec_mgr *mgr,
-					    const pjmedia_codec_info *info,
-					    const pjmedia_codec_param *param )
-{
-    unsigned i;
-    pjmedia_codec_id codec_id;
-    pj_pool_t *pool;
-    struct pjmedia_codec_desc *codec_desc = NULL;
-    pjmedia_codec_default_param *p;
-
-    PJ_ASSERT_RETURN(mgr && info, PJ_EINVAL);
-
-    if (!pjmedia_codec_info_to_id(info, (char*)&codec_id, sizeof(codec_id)))
-	return PJ_EINVAL;
-
-    pj_mutex_lock(mgr->mutex);
-
-    /* Lookup codec desc */
-    for (i=0; i < mgr->codec_cnt; ++i) {
-	if (pj_ansi_stricmp(codec_id, mgr->codec_desc[i].id) == 0) {
-	    codec_desc = &mgr->codec_desc[i];
-	    break;
-	}
-    }
-
-    /* Codec not found */
-    if (!codec_desc) {
-	pj_mutex_unlock(mgr->mutex);
-	return PJMEDIA_CODEC_EUNSUP;
-    }
-
-    /* If codec param is previously set, release codec param pool */
-    if (codec_desc->param) {
-	pj_assert(codec_desc->param->pool);
-	pj_pool_release(codec_desc->param->pool);
-	codec_desc->param = NULL;
-    }
-
-    /* When param is set to NULL, i.e: setting default codec param to library
-     * default setting, just return PJ_SUCCESS.
-     */
-    if (NULL == param) {
-	pj_mutex_unlock(mgr->mutex);
-	return PJ_SUCCESS;
-    }
-
-    /* Instantiate and initialize codec param */
-    pool = pj_pool_create(mgr->pf, (char*)codec_id, 256, 256, NULL);
-    codec_desc->param = PJ_POOL_ZALLOC_T(pool, pjmedia_codec_default_param);
-    p = codec_desc->param;
-    p->pool = pool;
-    p->param = PJ_POOL_ZALLOC_T(pool, pjmedia_codec_param);
-
-    /* Update codec param */
-    pj_memcpy(p->param, param, sizeof(pjmedia_codec_param));
-    for (i = 0; i < param->setting.dec_fmtp.cnt; ++i) {
-	pj_strdup(pool, &p->param->setting.dec_fmtp.param[i].name, 
-		  &param->setting.dec_fmtp.param[i].name);
-	pj_strdup(pool, &p->param->setting.dec_fmtp.param[i].val, 
-		  &param->setting.dec_fmtp.param[i].val);
-    }
-    for (i = 0; i < param->setting.dec_fmtp.cnt; ++i) {
-	pj_strdup(pool, &p->param->setting.dec_fmtp.param[i].name, 
-		  &param->setting.dec_fmtp.param[i].name);
-	pj_strdup(pool, &p->param->setting.dec_fmtp.param[i].val, 
-		  &param->setting.dec_fmtp.param[i].val);
-    }
-
-    pj_mutex_unlock(mgr->mutex);
-
-    return PJ_SUCCESS;
 }
 
Index: /pjproject/trunk/pjmedia/src/pjmedia/endpoint.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/endpoint.c	(revision 3074)
+++ /pjproject/trunk/pjmedia/src/pjmedia/endpoint.c	(revision 3075)
@@ -128,5 +128,5 @@
 
     /* Init codec manager. */
-    status = pjmedia_codec_mgr_init(&endpt->codec_mgr, endpt->pf);
+    status = pjmedia_codec_mgr_init(&endpt->codec_mgr);
     if (status != PJ_SUCCESS)
 	goto on_error;
@@ -173,5 +173,4 @@
 	pj_ioqueue_destroy(endpt->ioqueue);
 
-    pjmedia_codec_mgr_destroy(&endpt->codec_mgr);
     pjmedia_aud_subsys_shutdown();
     pj_pool_release(pool);
Index: /pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
===================================================================
--- /pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h	(revision 3074)
+++ /pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h	(revision 3075)
@@ -4484,6 +4484,5 @@
  *
  * @param codec_id	Codec ID.
- * @param param		Codec parameter to set. Set to NULL to reset
- *			codec parameter to library default settings.
+ * @param param		Codec parameter to set.
  *
  * @return		PJ_SUCCESS on success, or the appropriate error code.
Index: /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 3074)
+++ /pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 3075)
@@ -3055,29 +3055,10 @@
  * Set codec parameters.
  */
-PJ_DEF(pj_status_t) pjsua_codec_set_param( const pj_str_t *codec_id,
+PJ_DEF(pj_status_t) pjsua_codec_set_param( const pj_str_t *id,
 					   const pjmedia_codec_param *param)
 {
-    const pjmedia_codec_info *info[2];
-    pjmedia_codec_mgr *codec_mgr;
-    unsigned count = 2;
-    pj_status_t status;
-
-    codec_mgr = pjmedia_endpt_get_codec_mgr(pjsua_var.med_endpt);
-
-    status = pjmedia_codec_mgr_find_codecs_by_id(codec_mgr, codec_id,
-						 &count, info, NULL);
-    if (status != PJ_SUCCESS)
-	return status;
-
-    /* Codec ID should be specific, except for G.722.1 */
-    if (count > 1 && 
-	pj_strnicmp2(codec_id, "G7221/16", 8) != 0 &&
-	pj_strnicmp2(codec_id, "G7221/32", 8) != 0)
-    {
-	pj_assert(!"Codec ID is not specific");
-	return PJ_ETOOMANY;
-    }
-
-    status = pjmedia_codec_mgr_set_default_param(codec_mgr, info[0], param);
-    return status;
-}
+    PJ_UNUSED_ARG(id);
+    PJ_UNUSED_ARG(param);
+    PJ_TODO(set_codec_param);
+    return PJ_SUCCESS;
+}
