From fae2bf32e5df948f7db07d849cfcf9f1260a8f82 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Fri, 1 Apr 2016 13:00:21 +0200 Subject: [PATCH] Added hasCrappyOpenGL for Android --- coreapi/linphonecore_jni.cc | 16 +++++++++++++++- java/common/org/linphone/core/LinphoneCore.java | 5 +++++ .../impl/org/linphone/core/LinphoneCoreImpl.java | 5 +++++ mediastreamer2 | 2 +- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 0331ba033..917add4e4 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -2315,7 +2315,8 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_needsEchoCalibration return TRUE; } - SoundDeviceDescription *sound_description = sound_device_description_get(); + MSDevicesInfo *devices = ms_factory_get_devices_info(factory); + SoundDeviceDescription *sound_description = ms_devices_info_get_sound_device_description(devices); if(sound_description != NULL && sound_description == &genericSoundDeviceDescriptor){ return TRUE; } @@ -2325,6 +2326,19 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_needsEchoCalibration return TRUE; } +extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_hasCrappyOpenGL(JNIEnv *env, jobject thiz, jlong lcptr) { + LinphoneCore *lc = (LinphoneCore*) lcptr; + MSFactory * factory = linphone_core_get_ms_factory(lc); + MSDevicesInfo *devices = ms_factory_get_devices_info(factory); + SoundDeviceDescription *sound_description = ms_devices_info_get_sound_device_description(devices); + if (sound_description != NULL && sound_description == &genericSoundDeviceDescriptor){ + return FALSE; + } + + if (sound_description->flags & DEVICE_HAS_CRAPPY_OPENGL) return TRUE; + return FALSE; +} + extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_hasBuiltInEchoCanceler(JNIEnv *env, jobject thiz, jlong lcptr) { MSSndCard *sndcard; LinphoneCore *lc = (LinphoneCore*) lcptr; diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 2992b3c34..f75523317 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -1330,6 +1330,11 @@ public interface LinphoneCore { * If the device has a builtin echo canceller, it will return false. */ boolean hasBuiltInEchoCanceler(); + + /** + * Returns true if the OpenGL on this device is crappy and we need to use the old Android display + */ + boolean hasCrappyOpenGL(); void enableIpv6(boolean enable); diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index e7b63c1be..c2df92a72 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -1108,6 +1108,11 @@ class LinphoneCoreImpl implements LinphoneCore { public synchronized boolean hasBuiltInEchoCanceler() { return hasBuiltInEchoCanceler(nativePtr); } + private native boolean hasCrappyOpenGL(long ptr); + @Override + public synchronized boolean hasCrappyOpenGL() { + return hasCrappyOpenGL(nativePtr); + } private native void declineCall(long coreptr, long callptr, int reason); @Override public synchronized void declineCall(LinphoneCall aCall, Reason reason) { diff --git a/mediastreamer2 b/mediastreamer2 index 91cf88734..52806d2c5 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 91cf887343448db8d1a67e5e62647fad4f40c680 +Subproject commit 52806d2c5dde697d190ce33f2b5bad386e5bb74f