Finished RTT JNI/Java API

This commit is contained in:
Sylvain Berfini 2015-08-05 16:52:35 +02:00
parent 2e331a0ca0
commit 7f98e218f0
6 changed files with 43 additions and 8 deletions

View file

@ -6190,3 +6190,27 @@ JNIEXPORT jstring JNICALL Java_org_linphone_core_LinphoneCoreImpl_getVideoPreset
const char *tmp = linphone_core_get_video_preset((LinphoneCore *)lc);
return tmp ? env->NewStringUTF(tmp) : NULL;
}
extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_getChatRoom(JNIEnv* env ,jobject thiz, jlong ptr) {
return (jlong) linphone_call_get_chat_room((LinphoneCall *) ptr);
}
extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_enableRealTimeText(JNIEnv* env ,jobject thiz, jlong ptr, jboolean yesno) {
linphone_call_params_enable_realtime_text((LinphoneCallParams *)ptr, yesno);
}
extern "C" jboolean Java_org_linphone_core_LinphoneCallParamsImpl_realTimeTextEnabled(JNIEnv* env ,jobject thiz, jlong ptr) {
return linphone_call_params_realtime_text_enabled((LinphoneCallParams *)ptr);
}
extern "C" void Java_org_linphone_core_LinphoneChatMessageImpl_putChar(JNIEnv* env ,jobject thiz, jlong ptr, jlong character) {
linphone_chat_message_put_char((LinphoneChatMessage *)ptr, character);
}
extern "C" jobject Java_org_linphone_core_LinphoneChatRoomImpl_getCall(JNIEnv* env ,jobject thiz, jlong ptr) {
return getCall(env, linphone_chat_room_get_call((LinphoneChatRoom *)ptr));
}
extern "C" jlong Java_org_linphone_core_LinphoneChatRoomImpl_getChar(JNIEnv* env ,jobject thiz, jlong ptr) {
return linphone_chat_room_get_char((LinphoneChatRoom *)ptr);
}

View file

@ -233,6 +233,6 @@ public interface LinphoneChatMessage {
* @param[in] character T.140 char
* @throw LinphoneCoreExeption .
*/
void putChar(long charater) throws LinphoneCoreException;
void putChar(long character) throws LinphoneCoreException;
}

View file

@ -254,9 +254,11 @@ class LinphoneCallImpl implements LinphoneCall {
public LinphonePlayer getPlayer() {
return new LinphonePlayerImpl(getPlayer(nativePtr));
}
private native long getChatRoom(long nativePtr);
@Override
public LinphoneChatRoom getChatRoom() {
throw new RuntimeException("java binding not implemented yet");
return new LinphoneChatRoomImpl(getChatRoom(nativePtr));
}
}

View file

@ -172,13 +172,15 @@ public class LinphoneCallParamsImpl implements LinphoneCallParams {
return videoMulticastEnabled(nativePtr);
}
private native void enableRealTimeText(long nativePtr, boolean yesno);
@Override
public void enableRealTimeText(boolean yesno) {
throw new RuntimeException("java binding not implemented yet");
enableRealTimeText(nativePtr, yesno);
}
private native boolean realTimeTextEnabled(long nativePtr);
@Override
public boolean realTimeTextEnabled() {
throw new RuntimeException("java binding not implemented yet");
return realTimeTextEnabled(nativePtr);
}
}

View file

@ -154,8 +154,10 @@ public class LinphoneChatMessageImpl implements LinphoneChatMessage {
public void setListener(LinphoneChatMessageListener listener) {
setListener(nativePtr, listener);
}
private native void putChar(long nativePtr, long character);
@Override
public void putChar(long charater) throws LinphoneCoreException {
throw new RuntimeException("java binding not implemented yet");
public void putChar(long character) throws LinphoneCoreException {
putChar(nativePtr, character);
}
}

View file

@ -20,6 +20,7 @@ package org.linphone.core;
import org.linphone.core.LinphoneChatMessage.State;
import org.linphone.core.LinphoneChatMessage.StateListener;
import org.linphone.core.LinphoneCall;
@SuppressWarnings("deprecation")
class LinphoneChatRoomImpl implements LinphoneChatRoom {
@ -174,12 +175,16 @@ class LinphoneChatRoomImpl implements LinphoneChatRoom {
public void sendChatMessage(LinphoneChatMessage message) {
sendChatMessage(nativePtr, message, ((LinphoneChatMessageImpl)message).getNativePtr());
}
private native Object getCall(long nativePtr);
@Override
public LinphoneCall getCall() {
throw new RuntimeException("java binding not implemented yet");
return (LinphoneCall) getCall(nativePtr);
}
private native long getChar(long nativePtr);
@Override
public long getChar() {
throw new RuntimeException("java binding not implemented yet");
return getChar(nativePtr);
}
}