From 1e195e86b944c7ee5822146195c0767360cad78c Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 25 Nov 2010 13:53:08 +0100 Subject: [PATCH 1/3] add setRing java binding --- coreapi/callbacks.c | 2 +- coreapi/linphonecore.c | 2 +- coreapi/linphonecore_jni.cc | 20 +++++++++++++++++++ .../org/linphone/core/LinphoneCore.java | 14 ++++++++++++- 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/coreapi/callbacks.c b/coreapi/callbacks.c index d4f5193f3..b0108aee4 100644 --- a/coreapi/callbacks.c +++ b/coreapi/callbacks.c @@ -124,7 +124,7 @@ static void call_received(SalOp *h){ lc->ringstream=NULL; lc->dmfs_playing_start_time=0; } - if(lc->ringstream==NULL){ + if(lc->ringstream==NULL && lc->sound_conf.local_ring){ MSSndCard *ringcard=lc->sound_conf.lsd_card ?lc->sound_conf.lsd_card : lc->sound_conf.ring_sndcard; ms_message("Starting local ring..."); lc->ringstream=ring_start(lc->sound_conf.local_ring,2000,ringcard); diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index d06f3cf3b..4df01e63b 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2830,7 +2830,7 @@ void linphone_core_set_sound_source(LinphoneCore *lc, char source) /** * Sets the path to a wav file used for ringing. * - * The file must be a wav 16bit linear. + * @param path The file must be a wav 16bit linear. Local ring is disabled if null * * @ingroup media_parameters **/ diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 50444077c..552129acc 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -580,6 +580,26 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isVideoEnabled(JNIEn ,jlong lc) { return linphone_core_video_enabled((LinphoneCore*)lc); } +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setRing(JNIEnv* env + ,jobject thiz + ,jlong lc + ,jstring jpath) { + const char* path = jpath?env->GetStringUTFChars(jpath, NULL):NULL; + linphone_core_set_ring((LinphoneCore*)lc,path); + if (path) env->ReleaseStringUTFChars(jpath, path); +} +extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getRing(JNIEnv* env + ,jobject thiz + ,jlong lc + ) { + const char* path = linphone_core_get_ring((LinphoneCore*)lc); + if (path) { + return env->NewStringUTF(path); + } else { + return NULL; + } +} + //ProxyConfig diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 0c8c0afeb..fae83ffac 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -115,7 +115,7 @@ public interface LinphoneCore { } } /** - * Describes proxy registration states. + * Describes firewall policy. * */ static public class FirewallPolicy { @@ -454,4 +454,16 @@ public interface LinphoneCore { * @return previously set firewall policy. */ public FirewallPolicy getFirewallPolicy(); + /** + * Sets the path to a wav file used for ringing. + * + * @param path The file must be a wav 16bit linear. Local ring is disabled if null + */ + public void setRing(String path); + /** + * gets the path to a wav file used for ringing. + * + * @param null if not set + */ + public String getRing(); } From b862148419eb175c986154bbbcdb7b75cf1f1edf Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 25 Nov 2010 17:40:13 +0100 Subject: [PATCH 2/3] restore App name and icon on preview video window --- gtk/main.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/gtk/main.c b/gtk/main.c index 584db85e7..f88f9cfcd 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -512,6 +512,7 @@ static gboolean linphone_gtk_iterate(LinphoneCore *lc){ static gboolean first_time=TRUE; unsigned long id; static unsigned long previd=0; + static unsigned long preview_previd=0; static gboolean in_iterate=FALSE; /*avoid reentrancy*/ @@ -534,6 +535,25 @@ static gboolean linphone_gtk_iterate(LinphoneCore *lc){ w=gdk_window_foreign_new(id); #else w=gdk_window_foreign_new((HANDLE)id); +#endif + if (w) { + set_video_window_decorations(w); + g_object_unref(G_OBJECT(w)); + } + else ms_error("gdk_window_foreign_new() failed"); + if (video_needs_update) video_needs_update=FALSE; + } + } + id=linphone_core_get_native_preview_window_id (lc); + if (id!=preview_previd ){ + GdkWindow *w; + preview_previd=id; + if (id!=0){ + ms_message("Updating window decorations for preview"); +#ifndef WIN32 + w=gdk_window_foreign_new(id); +#else + w=gdk_window_foreign_new((HANDLE)id); #endif if (w) { set_video_window_decorations(w); From f9cff9304f2e249243706d0ce946765fc8989a82 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 26 Nov 2010 11:13:59 +0100 Subject: [PATCH 3/3] update ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index b1a4c2b64..28a6e7f22 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit b1a4c2b6470a6de62a8e58d4f2874eda091a8db3 +Subproject commit 28a6e7f22fbdd93a01676fc9cc47a2605c846d75