diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 1455e69c1..d50177aae 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -4804,6 +4804,12 @@ const char** linphone_core_get_video_devices(const LinphoneCore *lc){ return lc->video_conf.cams; } +void linphone_core_set_default_sound_devices(LinphoneCore *lc){ + linphone_core_set_ringer_device(lc, NULL); + linphone_core_set_playback_device(lc, NULL); + linphone_core_set_capture_device(lc, NULL); +} + void linphone_core_reload_sound_devices(LinphoneCore *lc){ const char *ringer; const char *playback; diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 638ebf46e..90f6e62b9 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -3265,6 +3265,11 @@ LINPHONE_PUBLIC LinphoneNatPolicy * linphone_core_get_nat_policy(const LinphoneC /* returns a null terminated static array of string describing the sound devices */ LINPHONE_PUBLIC const char** linphone_core_get_sound_devices(LinphoneCore *lc); +/** + * Use this function when you want to set the default sound devices + **/ +LINPHONE_PUBLIC void linphone_core_set_default_sound_devices(LinphoneCore *lc); + /** * Update detection of sound devices. * diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 0e9373352..09eda0fb9 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -2457,6 +2457,13 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isKeepAliveEnabled(J return (jboolean)linphone_core_keep_alive_enabled((LinphoneCore*)lc); } + +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setDefaultSoundDevices(JNIEnv* env + ,jobject thiz + ,jlong lc) { + linphone_core_set_default_sound_devices((LinphoneCore*)lc); +} + extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_startEchoCalibration(JNIEnv* env ,jobject thiz ,jlong lc @@ -2467,7 +2474,6 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_startEchoCalibration(JNI linphone_core_v_table_set_user_data(vTable, ldata); return (jint)linphone_core_start_echo_calibration((LinphoneCore*)lc, ldata->ecCalibrationStatus, NULL, NULL, vTable); - } extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_needsEchoCalibration(JNIEnv *env, jobject thiz, jlong lcptr) { @@ -7595,6 +7601,9 @@ JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCoreImpl_reloadMsPlugins(J ReleaseStringUTFChars(env, jpath, path); } +JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCoreImpl_reloadSoundDevices(JNIEnv *env, jobject jobj, jlong pcore) { + linphone_core_reload_sound_devices((LinphoneCore*)pcore); +} JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneNatPolicyImpl_getCore(JNIEnv *env, jobject thiz, jlong jNatPolicy) { LinphoneCore *lc = ((LinphoneNatPolicy *)jNatPolicy)->lc; diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index f7b950cf6..13da7c21a 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -2395,6 +2395,14 @@ public interface LinphoneCore { * @param path The path from where plugins are to be loaded. **/ public void reloadMsPlugins(String path); + + /** + * Reload sound devices. + * Use it if you change the devices table. + */ + public void reloadSoundDevices(); + + public void setDefaultSoundDevices(); public boolean isLimeEncryptionAvailable(); diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index a99b26260..163fa1e10 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -187,6 +187,8 @@ class LinphoneCoreImpl implements LinphoneCore { private native void setAndroidWifiLock(long nativePtr,Object wifi_lock); private native void setAndroidMulticastLock(long nativePtr,Object multicast_lock); private native void reloadMsPlugins(long nativePtr, String path); + private native void reloadSoundDevices(long nativePtr); + private native void setDefaultSoundDevices(long nativePtr); LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig, File factoryConfig, Object userdata) throws IOException { mListener = listener; @@ -1696,6 +1698,14 @@ class LinphoneCoreImpl implements LinphoneCore { public void reloadMsPlugins(String path) { reloadMsPlugins(nativePtr, path); } + + public void reloadSoundDevices() { + reloadSoundDevices(nativePtr); + } + + public void setDefaultSoundDevices() { + setDefaultSoundDevices(nativePtr); + } private native boolean isLimeEncryptionAvailable(long nativePtr); public synchronized boolean isLimeEncryptionAvailable() { diff --git a/mediastreamer2 b/mediastreamer2 index 39ebebd61..110e3cf01 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 39ebebd61d8f63ecbaad03bcefe992e834bfdcaa +Subproject commit 110e3cf018187903b5638199831a43f6e9d7a021