diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index c63616231..ef5d93643 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -2745,6 +2745,7 @@ static void linphone_call_start_video_stream(LinphoneCall *call, bool_t all_inpu if (is_multicast) rtp_session_set_multicast_ttl(call->videostream->ms.sessions.rtp_session,vstream->ttl); + video_stream_use_video_preset(call->videostream, lp_config_get_string(lc->config, "video", "preset", NULL)); if( lc->video_conf.reuse_preview_source && source ){ ms_message("video_stream_start_with_source kept: %p", source); video_stream_start_with_source(call->videostream, diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 7a702ca45..6f79635c8 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -7370,6 +7370,10 @@ bool_t linphone_core_video_multicast_enabled(const LinphoneCore *lc) { return lc->rtp_conf.video_multicast_enabled; } +void linphone_core_set_video_preset(LinphoneCore *lc, const char *preset) { + lp_config_set_string(lc->config, "video", "preset", NULL); +} + #ifdef ANDROID static int linphone_core_call_void_method(jobject obj, jmethodID id) { JNIEnv *env=ms_get_jni_env(); diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 47bc7fcc6..2c6a52276 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -3521,6 +3521,13 @@ LINPHONE_PUBLIC int linphone_core_set_network_simulator_params(LinphoneCore *lc, **/ LINPHONE_PUBLIC const OrtpNetworkSimulatorParams *linphone_core_get_network_simulator_params(const LinphoneCore *lc); +/** + * Set the video preset to be used for video calls. + * @param[in] lc LinphoneCore object + * @param[in] preset The name of the video preset to be used (can be NULL to use the default video preset). + */ +LINPHONE_PUBLIC void linphone_core_set_video_preset(LinphoneCore *lc, const char *preset); + #ifdef __cplusplus } #endif diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index b310ac543..c916ea4d2 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -6215,3 +6215,9 @@ JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCoreImpl_enableDnsSrv(JNIE JNIEXPORT jboolean JNICALL Java_org_linphone_core_LinphoneCoreImpl_dnsSrvEnabled(JNIEnv *env, jobject thiz, jlong lc) { return linphone_core_dns_srv_enabled((LinphoneCore *)lc); } + +JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCoreImpl_setVideoPreset(JNIEnv *env, jobject thiz, jlong lc, jstring preset) { + const char *char_preset = preset ? env->GetStringUTFChars(preset, NULL) : NULL; + linphone_core_set_video_preset((LinphoneCore *)lc, char_preset); + if (char_preset) env->ReleaseStringUTFChars(preset, char_preset); +} diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 33f917b7c..9af7b1309 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -2035,4 +2035,10 @@ public interface LinphoneCore { */ public boolean dnsSrvEnabled(); + /** + * Set the video preset to be used for video calls. + * @param lc LinphoneCore object + * @param preset The name of the video preset to be used (can be null to use the default video preset). + */ + public void setVideoPreset(String preset); } diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index 3e7fd1910..84b7915cc 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -1479,4 +1479,10 @@ class LinphoneCoreImpl implements LinphoneCore { public boolean dnsSrvEnabled() { return dnsSrvEnabled(nativePtr); } + + private native void setVideoPreset(long nativePtr, String preset); + @Override + public void setVideoPreset(String preset) { + setVideoPreset(nativePtr, preset); + } } diff --git a/mediastreamer2 b/mediastreamer2 index 2bf2780d9..4b3211ea7 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 2bf2780d900bba2cff6c9819bd9ef3bb05d39adf +Subproject commit 4b3211ea7aa00acf1bc4f6f46180fa4d59d100a0 diff --git a/oRTP b/oRTP index 6e619ac1f..74a48864b 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 6e619ac1ffc23a83c56b69a39d0bb0593fe10f68 +Subproject commit 74a48864b37726c6e93ca3d32894046ac2321199