diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index 5fda3e638..b67f7f812 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -286,6 +286,7 @@ static void call_accepted(SalOp *op){ ms_free(tmp); ms_free(msg); } + linphone_core_update_streams (lc,call,md); linphone_call_set_state(call,LinphoneCallPaused,"Call paused"); }else if (sal_media_description_has_dir(md,SalStreamRecvOnly)){ /*we are put on hold when the call is initially accepted */ @@ -296,6 +297,7 @@ static void call_accepted(SalOp *op){ ms_free(tmp); ms_free(msg); } + linphone_core_update_streams (lc,call,md); linphone_call_set_state(call,LinphoneCallPaused,"Call paused"); }else{ if (lc->vtable.display_status){ @@ -306,9 +308,9 @@ static void call_accepted(SalOp *op){ a reinvite made by us. We must notify the application this reinvite was accepted*/ linphone_call_set_state(call, LinphoneCallUpdated, "Call updated"); } - linphone_call_set_state(call,LinphoneCallStreamsRunning,"Connected (streams running)"); + linphone_core_update_streams (lc,call,md); + linphone_call_set_state(call, LinphoneCallStreamsRunning, "Streams running"); } - linphone_core_update_streams (lc,call,md); }else{ /*send a bye*/ ms_error("Incompatible SDP offer received in 200Ok, need to abort the call"); diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 11b46c89e..e85fc8492 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -367,7 +367,7 @@ void linphone_call_unref(LinphoneCall *obj){ * Returns current parameters associated to the call. **/ const LinphoneCallParams * linphone_call_get_current_params(const LinphoneCall *call){ - return &call->params; + return &call->current_params; } /** @@ -785,6 +785,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut ms_fatal("start_media_stream() called without prior init !"); return; } + call->current_params = call->params; /* adjust rtp jitter compensation. It must be at least the latency of the sound card */ int jitt_comp=MAX(lc->sound_conf.latency,lc->rtp_conf.audio_jitt_comp); @@ -862,6 +863,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut video_preview_stop(lc->previewstream); lc->previewstream=NULL; } + call->current_params.has_video=FALSE; if (stream && stream->dir!=SalStreamInactive) { const char *addr=stream->addr[0]!='\0' ? stream->addr : call->resultdesc->addr; call->video_profile=make_profile(lc,call->resultdesc,stream,&used_pt); @@ -870,7 +872,7 @@ void linphone_call_start_media_streams(LinphoneCall *call, bool_t all_inputs_mut MSWebCam *cam=lc->video_conf.device; bool_t is_inactive=FALSE; - call->params.has_video=TRUE; + call->current_params.has_video=TRUE; video_stream_set_sent_video_size(call->videostream,linphone_core_get_preferred_video_size(lc)); video_stream_enable_self_view(call->videostream,lc->video_conf.selfview); diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 55e95a7fe..7c5ee9071 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2182,9 +2182,8 @@ bool_t linphone_core_inc_invite_pending(LinphoneCore*lc){ * * @return 0 if successful, -1 otherwise. **/ -int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, LinphoneCallParams *params){ +int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params){ int err; - if (call->localdesc) sal_media_description_unref(call->localdesc); call->params=*params; diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 219b13a7e..84e9ee3df 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -618,7 +618,7 @@ int linphone_core_pause_all_calls(LinphoneCore *lc); int linphone_core_resume_call(LinphoneCore *lc, LinphoneCall *call); -int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, LinphoneCallParams *params); +int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params); LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCore *lc); diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 91021d8e1..50787d7e2 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1022,15 +1022,15 @@ extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_enableVideo(JNIEnv extern "C" jboolean Java_org_linphone_core_LinphoneCallParamsImpl_getVideoEnabled(JNIEnv *env, jobject thiz, jlong lcp){ return linphone_call_params_video_enabled((LinphoneCallParams*)lcp); } -extern "C" jlong Java_org_linphone_core_LinphoneCallParamsImpl_copy(JNIEnv *env, jobject thiz, jlong lcp){ - return (jlong) linphone_call_params_copy((LinphoneCallParams*)lcp); +extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_destroy(JNIEnv *env, jobject thiz, jlong lc){ + return linphone_call_params_destroy((LinphoneCallParams*)lc); } extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_createDefaultCallParams(JNIEnv *env, jobject thiz, jlong lc){ return (jlong) linphone_core_create_default_call_parameters((LinphoneCore*)lc); } -extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_getCurrentParams(JNIEnv *env, jobject thiz, jlong lc){ - return (jlong) linphone_call_get_current_params((LinphoneCall*)lc); +extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_getCurrentParamsCopy(JNIEnv *env, jobject thiz, jlong lc){ + return (jlong) linphone_call_params_copy(linphone_call_get_current_params((LinphoneCall*)lc)); } extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_enableCamera(JNIEnv *env, jobject thiz, jlong lc, jboolean b){ @@ -1046,7 +1046,7 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_updateAddressWithParams( } extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_updateCall(JNIEnv *env, jobject thiz, jlong lc, jlong call, jlong params){ - return (jint) linphone_core_update_call((LinphoneCore *)lc, (LinphoneCall *)call, (LinphoneCallParams *)params); + return (jint) linphone_core_update_call((LinphoneCore *)lc, (LinphoneCall *)call, (const LinphoneCallParams *)params); } diff --git a/coreapi/private.h b/coreapi/private.h index 1203fe0fa..3a5e3483c 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -88,6 +88,7 @@ struct _LinphoneCall struct _VideoStream *videostream; char *refer_to; LinphoneCallParams params; + LinphoneCallParams current_params; int up_bw; /*upload bandwidth setting at the time the call is started. Used to detect if it changes during a call */ bool_t refer_pending; bool_t media_pending; diff --git a/java/common/org/linphone/core/LinphoneCall.java b/java/common/org/linphone/core/LinphoneCall.java index fca8aad57..79c73a572 100644 --- a/java/common/org/linphone/core/LinphoneCall.java +++ b/java/common/org/linphone/core/LinphoneCall.java @@ -150,10 +150,7 @@ public interface LinphoneCall { **/ public LinphoneCallLog getCallLog(); - /** - * @return parameters for this call; read only, call copy() to get a read/write version. - */ - public LinphoneCallParams getCurrentParamsReadOnly(); + public LinphoneCallParams getCurrentParamsCopy(); public void enableCamera(boolean enabled); diff --git a/java/common/org/linphone/core/LinphoneCallParams.java b/java/common/org/linphone/core/LinphoneCallParams.java index 30362a73b..53274e9f6 100644 --- a/java/common/org/linphone/core/LinphoneCallParams.java +++ b/java/common/org/linphone/core/LinphoneCallParams.java @@ -28,5 +28,4 @@ package org.linphone.core; public interface LinphoneCallParams { void setVideoEnabled(boolean b); boolean getVideoEnabled(); - LinphoneCallParams copy(); }