Commit 7f98e218 authored by Sylvain Berfini's avatar Sylvain Berfini 🐮
Browse files

Finished RTT JNI/Java API

parent 2e331a0c
......@@ -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);
}
\ No newline at end of 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;
}
......@@ -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));
}
}
......@@ -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);
}
}
......@@ -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);
}
}
......@@ -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);
}
}
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