mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 19:18:06 +00:00
Added audio and video port API to JNI
This commit is contained in:
parent
0e580208a6
commit
78a66ffc91
3 changed files with 56 additions and 0 deletions
|
|
@ -2114,6 +2114,22 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setCpuCountNative(JNIEnv
|
|||
ms_set_cpu_count(count);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setAudioPort(JNIEnv *env, jobject thiz, jlong lc, jint port) {
|
||||
linphone_core_set_audio_port((LinphoneCore *)lc, port);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVideoPort(JNIEnv *env, jobject thiz, jlong lc, jint port) {
|
||||
linphone_core_set_video_port((LinphoneCore *)lc, port);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setAudioPortRange(JNIEnv *env, jobject thiz, jlong lc, jint min_port, jint max_port) {
|
||||
linphone_core_set_audio_port_range((LinphoneCore *)lc, min_port, max_port);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVideoPortRange(JNIEnv *env, jobject thiz, jlong lc, jint min_port, jint max_port) {
|
||||
linphone_core_set_video_port_range((LinphoneCore *)lc, min_port, max_port);
|
||||
}
|
||||
|
||||
extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getVersion(JNIEnv* env,jobject thiz,jlong ptr) {
|
||||
jstring jvalue =env->NewStringUTF(linphone_core_get_version());
|
||||
return jvalue;
|
||||
|
|
|
|||
|
|
@ -809,4 +809,24 @@ public interface LinphoneCore {
|
|||
* return a linphone friend (if exists) that matches the sip address
|
||||
*/
|
||||
LinphoneFriend findFriendByAddress(String sipUri);
|
||||
|
||||
/**
|
||||
* Sets the UDP port used for audio streaming.
|
||||
**/
|
||||
void setAudioPort(int port);
|
||||
|
||||
/**
|
||||
* Sets the UDP port range from which to randomly select the port used for audio streaming.
|
||||
*/
|
||||
void setAudioPortRange(int minPort, int maxPort);
|
||||
|
||||
/**
|
||||
* Sets the UDP port used for video streaming.
|
||||
**/
|
||||
void setVideoPort(int port);
|
||||
|
||||
/**
|
||||
* Sets the UDP port range from which to randomly select the port used for video streaming.
|
||||
*/
|
||||
void setVideoPortRange(int minPort, int maxPort);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,6 +110,10 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
private native int getMissedCallsCount(long nativePtr);
|
||||
private native void resetMissedCallsCount(long nativePtr);
|
||||
private native String getVersion(long nativePtr);
|
||||
private native void setAudioPort(long nativePtr, int port);
|
||||
private native void setVideoPort(long nativePtr, int port);
|
||||
private native void setAudioPortRange(long nativePtr, int minPort, int maxPort);
|
||||
private native void setVideoPortRange(long nativePtr, int minPort, int maxPort);
|
||||
|
||||
LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig,File factoryConfig,Object userdata) throws IOException {
|
||||
mListener=listener;
|
||||
|
|
@ -757,4 +761,20 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
}
|
||||
return new LinphoneFriendImpl(ptr);
|
||||
}
|
||||
|
||||
public void setAudioPort(int port) {
|
||||
setAudioPort(nativePtr, port);
|
||||
}
|
||||
|
||||
public void setVideoPort(int port) {
|
||||
setVideoPort(nativePtr, port);
|
||||
}
|
||||
|
||||
public void setAudioPortRange(int minPort, int maxPort) {
|
||||
setAudioPortRange(nativePtr, minPort, maxPort);
|
||||
}
|
||||
|
||||
public void setVideoPortRange(int minPort, int maxPort) {
|
||||
setVideoPortRange(nativePtr, minPort, maxPort);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue