diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index af1cfb919..1694c7e4f 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -405,7 +405,7 @@ static void start_remote_ring(LinphoneCore *lc, LinphoneCall *call) { if (call->audiostream) audio_stream_unprepare_sound(call->audiostream); if( lc->sound_conf.remote_ring ){ - lc->ringstream=ring_start(lc->sound_conf.remote_ring,2000,ringcard); + lc->ringstream=ring_start(lc->sound_conf.remote_ring,2000,ringcard,lc->factory); } } } diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 02ea2c21b..0e48a2c4c 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -4788,6 +4788,9 @@ int linphone_core_preview_ring(LinphoneCore *lc, const char *ring,LinphoneCoreCb return err; } +MSFactory *linphone_core_get_factory(void *lc){ + return ((LinphoneCore*)lc)->factory; +} /** * Sets the path to a wav file used for ringing back. * @@ -5231,6 +5234,7 @@ static void toggle_video_preview(LinphoneCore *lc, bool_t val){ video_preview_set_native_window_id(lc->previewstream,lc->preview_window_id); video_preview_set_fps(lc->previewstream,linphone_core_get_preferred_framerate(lc)); video_preview_start(lc->previewstream,lc->video_conf.device); + lc->previewstream->ms.factory = lc->factory; } }else{ if (lc->previewstream!=NULL){ @@ -5917,7 +5921,7 @@ static MSFilter *get_audio_resource(LinphoneCore *lc, LinphoneAudioResourceType if (ringcard == NULL) return NULL; - ringstream=lc->ringstream=ring_start(NULL,0,ringcard); + ringstream=lc->ringstream=ring_start(NULL,0,ringcard, lc->factory); ms_filter_call_method(lc->ringstream->gendtmf,MS_DTMF_GEN_SET_DEFAULT_AMPLITUDE,&); lc->dmfs_playing_start_time = ms_get_cur_time_ms()/1000; }else{ @@ -6081,9 +6085,9 @@ void linphone_core_set_mtu(LinphoneCore *lc, int mtu){ ms_error("MTU too small !"); mtu=500; } - ms_set_mtu(mtu); - ms_message("MTU is supposed to be %i, rtp payload max size will be %i",mtu, ms_get_payload_max_size()); - }else ms_set_mtu(0);//use mediastreamer2 default value + ms_factory_set_mtu(lc->factory, mtu); + ms_message("MTU is supposed to be %i, rtp payload max size will be %i",mtu, ms_factory_get_payload_max_size(lc->factory)); + }else ms_factory_set_mtu(lc->factory, 0);//use mediastreamer2 default value } void linphone_core_set_waiting_callback(LinphoneCore *lc, LinphoneCoreWaitingCallback cb, void *user_context){ diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 0fb78538e..36da70623 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -3241,6 +3241,7 @@ LINPHONE_PUBLIC void linphone_core_set_ring_during_incoming_early_media(Linphone LINPHONE_PUBLIC bool_t linphone_core_get_ring_during_incoming_early_media(const LinphoneCore *lc); LINPHONE_PUBLIC int linphone_core_preview_ring(LinphoneCore *lc, const char *ring,LinphoneCoreCbFunc func,void * userdata); +LINPHONE_PUBLIC MSFactory* linphone_core_get_factory(void* lc); LINPHONE_PUBLIC int linphone_core_play_local(LinphoneCore *lc, const char *audiofile); LINPHONE_PUBLIC void linphone_core_enable_echo_cancellation(LinphoneCore *lc, bool_t val); LINPHONE_PUBLIC bool_t linphone_core_echo_cancellation_enabled(LinphoneCore *lc); diff --git a/coreapi/ringtoneplayer.c b/coreapi/ringtoneplayer.c index 1955da18d..fe63c451e 100644 --- a/coreapi/ringtoneplayer.c +++ b/coreapi/ringtoneplayer.c @@ -85,7 +85,7 @@ int linphone_ringtoneplayer_start_with_cb(LinphoneRingtonePlayer* rp, MSSndCard* ms_message("Starting local ringtone..."); rp->end_of_ringtone = end_of_ringtone; rp->end_of_ringtone_ud = user_data; - rp->ringstream=ring_start_with_cb(ringtone,loop_pause_ms,card,notify_end_of_ringtone,rp); + rp->ringstream=ring_start_with_cb(ringtone,loop_pause_ms,card,notify_end_of_ringtone,rp,linphone_core_get_factory(user_data)); return rp->ringstream != NULL ? 0 : 1; } return 3; diff --git a/mediastreamer2 b/mediastreamer2 index 8fc4323f8..68ec6e611 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 8fc4323f8166b7432bdbf409fdeb426e08cdff32 +Subproject commit 68ec6e6113d0bdada57fdfac462e0dd8ebc6a53e