Commit 075f13f2 authored by Margaux Clerc's avatar Margaux Clerc
Browse files

Remove textReceived callback

Made  echo calibration at start
parent 0aef436d
......@@ -118,6 +118,7 @@ LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/../build/android \
$(LOCAL_PATH)/../oRTP/include \
$(LOCAL_PATH)/../mediastreamer2/include \
$(LOCAL_PATH)/../mediastreamer2/src/audiofilters/ \
$(LOCAL_PATH)/../../belle-sip/include \
$(LOCAL_PATH)/../../../gen \
$(LOCAL_PATH)/../../externals/libxml2/include \
......
......@@ -104,7 +104,6 @@ public class TutorialBuddyStatus implements LinphoneCoreListener {
public void displayMessage(LinphoneCore lc, String message) {}
public void displayWarning(LinphoneCore lc, String message) {}
public void globalState(LinphoneCore lc, GlobalState state, String message) {}
public void textReceived(LinphoneCore lc, LinphoneChatRoom cr,LinphoneAddress from, String message) {}
public void callState(LinphoneCore lc, LinphoneCall call, State cstate, String msg) {}
public void callStatsUpdated(LinphoneCore lc, LinphoneCall call, LinphoneCallStats stats) {}
public void ecCalibrationStatus(LinphoneCore lc, EcCalibratorStatus status,int delay_ms, Object data) {}
......
......@@ -90,10 +90,6 @@ public class TutorialChatRoom implements LinphoneCoreListener, LinphoneChatMessa
public void callEncryptionChanged(LinphoneCore lc, LinphoneCall call,boolean encrypted, String authenticationToken) {}
public void notifyReceived(LinphoneCore lc, LinphoneCall call, LinphoneAddress from, byte[] event){}
public void dtmfReceived(LinphoneCore lc, LinphoneCall call, int dtmf) {}
public void textReceived(LinphoneCore lc, LinphoneChatRoom cr,LinphoneAddress from, String message) {
//Deprecated
}
......
......@@ -88,7 +88,6 @@ public class TutorialRegistration implements LinphoneCoreListener {
public void globalState(LinphoneCore lc, GlobalState state, String message) {}
public void newSubscriptionRequest(LinphoneCore lc, LinphoneFriend lf,String url) {}
public void notifyPresenceReceived(LinphoneCore lc, LinphoneFriend lf) {}
public void textReceived(LinphoneCore lc, LinphoneChatRoom cr,LinphoneAddress from, String message) {}
public void callState(LinphoneCore lc, LinphoneCall call, State cstate, String msg) {}
public void callStatsUpdated(LinphoneCore lc, LinphoneCall call, LinphoneCallStats stats) {}
public void ecCalibrationStatus(LinphoneCore lc, EcCalibratorStatus status,int delay_ms, Object data) {}
......
......@@ -29,6 +29,7 @@ extern "C" {
#include "mediastreamer2/mscommon.h"
#include "mediastreamer2/msmediaplayer.h"
#include "mediastreamer2/msutils.h"
#include "devices.h"
}
#include "mediastreamer2/msjava.h"
#include "private.h"
......@@ -377,12 +378,6 @@ public:
vTable->notify_presence_received = notify_presence_received;
}
/*void textReceived(LinphoneCore lc, LinphoneChatRoom cr,LinphoneAddress from,String message);*/
textReceivedId = env->GetMethodID(listenerClass,"textReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneChatRoom;Lorg/linphone/core/LinphoneAddress;Ljava/lang/String;)V");
if (textReceivedId) {
vTable->text_received = text_received;
}
messageReceivedId = env->GetMethodID(listenerClass,"messageReceived","(Lorg/linphone/core/LinphoneCore;Lorg/linphone/core/LinphoneChatRoom;Lorg/linphone/core/LinphoneChatMessage;)V");
if (messageReceivedId) {
vTable->message_received = message_received;
......@@ -522,7 +517,6 @@ public:
jmethodID displayStatusId;
jmethodID newSubscriptionRequestId;
jmethodID notifyPresenceReceivedId;
jmethodID textReceivedId;
jmethodID messageReceivedId;
jmethodID isComposingReceivedId;
jmethodID dtmfReceivedId;
......@@ -786,23 +780,6 @@ public:
,dtmf);
handle_possible_java_exception(env, lcData->listener);
}
static void text_received(LinphoneCore *lc, LinphoneChatRoom *room, const LinphoneAddress *from, const char *message) {
JNIEnv *env = 0;
jint result = jvm->AttachCurrentThread(&env,NULL);
if (result != 0) {
ms_error("cannot attach VM");
return;
}
LinphoneCoreVTable *table = linphone_core_get_current_vtable(lc);
LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_v_table_get_user_data(table);
env->CallVoidMethod(lcData->listener
,lcData->textReceivedId
,lcData->core
,env->NewObject(lcData->chatRoomClass,lcData->chatRoomCtrId,(jlong)room)
,env->NewObject(lcData->addressClass,lcData->addressCtrId,(jlong)from)
,message ? env->NewStringUTF(message) : NULL);
handle_possible_java_exception(env, lcData->listener);
}
static void message_received(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage *msg) {
JNIEnv *env = 0;
jobject jmsg;
......@@ -2008,24 +1985,29 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_needsEchoCalibration
ms_error("Could not get soundcard %s", card);
return TRUE;
}
SoundDeviceDescription *sound_description = sound_device_description_get();
if(sound_description != NULL && sound_description == &genericSoundDeviceDescriptor){
return TRUE;
}
if (ms_snd_card_get_capabilities(sndcard) & MS_SND_CARD_CAP_BUILTIN_ECHO_CANCELLER) return FALSE;
if (ms_snd_card_get_minimal_latency(sndcard) != 0) return FALSE;
return TRUE;
}
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_needsEchoCanceler(JNIEnv *env, jobject thiz, jlong lc) {
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_hasBuiltInEchoCanceler(JNIEnv *env, jobject thiz, jlong lc) {
MSSndCard *sndcard;
MSSndCardManager *m = ms_snd_card_manager_get();
const char *card = linphone_core_get_capture_device((LinphoneCore*)lc);
sndcard = ms_snd_card_manager_get_card(m, card);
if (sndcard == NULL) {
ms_error("Could not get soundcard %s", card);
return TRUE;
return FALSE;
}
if (ms_snd_card_get_capabilities(sndcard) & MS_SND_CARD_CAP_BUILTIN_ECHO_CANCELLER) return FALSE;
return TRUE;
if (ms_snd_card_get_capabilities(sndcard) & MS_SND_CARD_CAP_BUILTIN_ECHO_CANCELLER) return TRUE;
return FALSE;
}
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getMediaEncryption(JNIEnv* env
......
......@@ -1186,7 +1186,7 @@ public interface LinphoneCore {
* Returns true if the software echo canceler needs to be turned on.
* If the device has a builtin echo canceller, it will return false.
*/
boolean needsEchoCanceler();
boolean hasBuiltInEchoCanceler();
void enableIpv6(boolean enable);
......
......@@ -53,15 +53,6 @@ public interface LinphoneCoreListener {
*/
void notifyPresenceReceived(LinphoneCore lc, LinphoneFriend lf);
/**
* invoked when a new text message is received
* @param lc LinphoneCore
* @param room LinphoneChatRoom involved in this conversation. Can be be created by the framework in case the from is not present in any chat room.
* @param from LinphoneAddress from
* @param message incoming message
*/
void textReceived(LinphoneCore lc, LinphoneChatRoom cr, LinphoneAddress from, String message);
/**
* invoked when a new dtmf is received
* @param lc LinphoneCore
......
......@@ -38,13 +38,6 @@ public class LinphoneCoreListenerBase implements LinphoneCoreListener {
}
@Override
public void textReceived(LinphoneCore lc, LinphoneChatRoom cr,
LinphoneAddress from, String message) {
// TODO Auto-generated method stub
}
@Override
public void dtmfReceived(LinphoneCore lc, LinphoneCall call, int dtmf) {
// TODO Auto-generated method stub
......
......@@ -1057,10 +1057,10 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized boolean needsEchoCalibration() {
return needsEchoCalibration(nativePtr);
}
private native boolean needsEchoCanceler(long ptr);
private native boolean hasBuiltInEchoCanceler(long ptr);
@Override
public synchronized boolean needsEchoCanceler() {
return needsEchoCanceler(nativePtr);
public synchronized boolean hasBuiltInEchoCanceler() {
return hasBuiltInEchoCanceler(nativePtr);
}
private native void declineCall(long coreptr, long callptr, int reason);
@Override
......
mediastreamer2 @ cbdcaacb
Subproject commit 46c025c428a0bd7c351258ce0d20d6341e895287
Subproject commit cbdcaacbb6a4938c2c5997049b4f701c664aa0f1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment