]> sjero.net Git - linphone/blobdiff - coreapi/linphonecore.c
Rename aac-eld modes to 22k and 44k
[linphone] / coreapi / linphonecore.c
index e1d88b292e04015c1c2b064336b1ffff5a7088c4..24515d33d69fc2ac8c0c6dc3b2a28c07031c18c2 100644 (file)
@@ -1211,19 +1211,18 @@ void linphone_core_set_state(LinphoneCore *lc, LinphoneGlobalState gstate, const
 }
 static void misc_config_read (LinphoneCore *lc) {
        LpConfig *config=lc->config;
-    lc->max_call_logs=lp_config_get_int(config,"misc","history_max_size",15);
-    lc->max_calls=lp_config_get_int(config,"misc","max_calls",NB_MAX_CALLS);
-       linphone_core_set_log_level((OrtpLogLevel)lp_config_get_int(config,"misc","log_level",0));
+       lc->max_call_logs=lp_config_get_int(config,"misc","history_max_size",15);
+       lc->max_calls=lp_config_get_int(config,"misc","max_calls",NB_MAX_CALLS);
 }
 
 
 
 
-static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vtable, const char *config_path,
-    const char *factory_config_path, void * userdata)
+static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vtable, LpConfig *config, void * userdata)
 {
        ms_message("Initializing LinphoneCore %s", linphone_core_get_version());
        memset (lc, 0, sizeof (LinphoneCore));
+       lc->config=config;
        lc->data=userdata;
        lc->ringstream_autorelease=TRUE;
 
@@ -1292,6 +1291,8 @@ static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vta
        linphone_core_assign_payload_type(lc,&payload_type_silk_wb,-1,NULL);
        linphone_core_assign_payload_type(lc,&payload_type_silk_swb,-1,NULL);
        linphone_core_assign_payload_type(lc,&payload_type_g729,18,"annexb=no");
+       linphone_core_assign_payload_type(lc,&payload_type_aaceld_22k,-1,"config=F8EE2000; constantDuration=512;  indexDeltaLength=3; indexLength=3; mode=AAC-hbr; profile-level-id=24; sizeLength=13; streamType=5");
+       linphone_core_assign_payload_type(lc,&payload_type_aaceld_44k,-1,"config=F8E82000; constantDuration=512;  indexDeltaLength=3; indexLength=3; mode=AAC-hbr; profile-level-id=24; sizeLength=13; streamType=5");
        linphone_core_handle_static_payloads(lc);
        
        ms_init();
@@ -1300,10 +1301,6 @@ static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vta
        lc->msevq=ms_event_queue_new();
        ms_set_global_event_queue(lc->msevq);
 
-       lc->config=lp_config_new(config_path);
-       if (factory_config_path)
-               lp_config_read_file(lc->config,factory_config_path);
-
        lc->sal=sal_init();
        sal_set_user_pointer(lc->sal,lc);
        sal_set_callbacks(lc->sal,&linphone_sal_callbacks);
@@ -1349,13 +1346,19 @@ static void linphone_core_init (LinphoneCore * lc, const LinphoneCoreVTable *vta
  *        It is OPTIONAL, use NULL if unneeded.
  * @param userdata an opaque user pointer that can be retrieved at any time (for example in
  *        callbacks) using linphone_core_get_user_data().
- *
+ * @see linphone_core_new_with_config
 **/
 LinphoneCore *linphone_core_new(const LinphoneCoreVTable *vtable,
                                                const char *config_path, const char *factory_config_path, void * userdata)
 {
-       LinphoneCore *core=ms_new(LinphoneCore,1);
-       linphone_core_init(core,vtable,config_path, factory_config_path, userdata);
+       LpConfig *config = lp_config_new_with_factory(config_path, factory_config_path);
+       return linphone_core_new_with_config(vtable, config, userdata);
+}
+
+LinphoneCore *linphone_core_new_with_config(const LinphoneCoreVTable *vtable, struct _LpConfig *config, void *userdata)
+{
+       LinphoneCore *core = ms_new(LinphoneCore, 1);
+       linphone_core_init(core, vtable, config, userdata);
        return core;
 }
 
@@ -2170,9 +2173,6 @@ void linphone_core_iterate(LinphoneCore *lc){
        }
 
        if (one_second_elapsed) {
-               if (ortp_get_log_level_mask() != lp_config_get_int(lc->config, "misc", "log_level", 0)) {
-                       lp_config_set_int(lc->config, "misc", "log_level", ortp_get_log_level_mask());
-               }
                if (lp_config_needs_commit(lc->config)) {
                        lp_config_sync(lc->config);
                }