mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-20 04:28:10 +00:00
Wraps LinphoneConferenceParams into Java
This commit is contained in:
parent
523ad425a5
commit
9eced02408
5 changed files with 144 additions and 18 deletions
|
|
@ -4315,6 +4315,21 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getConferenceSize(JNIEnv
|
|||
return (jint)linphone_core_get_conference_size((LinphoneCore *) pCore);
|
||||
}
|
||||
|
||||
extern "C" jobject Java_org_linphone_core_LinphoneCoreImpl_createConference(JNIEnv *env, jobject thiz, jlong corePtr, jobject jparams) {
|
||||
jclass params_class = env->FindClass("org/linphone/core/LinphoneConferenceParamsImpl");
|
||||
jclass conference_class = env->FindClass("org/linphone/core/LinphoneConferenceImpl");
|
||||
jfieldID params_native_ptr_attr = env->GetFieldID(params_class, "nativePtr", "J");
|
||||
jmethodID conference_constructor = env->GetMethodID(conference_class, "<init>", "(J)V");
|
||||
LinphoneConferenceParams *params = NULL;
|
||||
LinphoneConference *conference;
|
||||
jobject jconference;
|
||||
|
||||
if(jparams) params = (LinphoneConferenceParams *)env->GetLongField(params_class, params_native_ptr_attr);
|
||||
conference = linphone_core_create_conference_with_params((LinphoneCore *)corePtr, params);
|
||||
if(conference) return env->NewObject(conference_class, conference_constructor, (jlong)conference);
|
||||
else return NULL;
|
||||
}
|
||||
|
||||
extern "C" jobject Java_org_linphone_core_LinphoneCoreImpl_getConference(JNIEnv *env, jobject thiz, jlong pCore) {
|
||||
jclass conference_class = env->FindClass("org/linphone/core/LinphoneConferenceImpl");
|
||||
jmethodID conference_constructor = env->GetMethodID(conference_class, "<init>", "(J)V");
|
||||
|
|
@ -6746,6 +6761,32 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneCoreImpl_getNortpTimeout(J
|
|||
|
||||
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneConferenceParamsImpl_createInstance(JNIEnv *env, jobject thiz, jobject jcore) {
|
||||
jclass core_class = env->FindClass("org/linphone/core/LinphoneCoreImpl");
|
||||
jfieldID native_ptr_attr = env->GetFieldID(core_class, "nativePtr", "J");
|
||||
LinphoneCore *core = NULL;
|
||||
if(jcore) core = (LinphoneCore *)env->GetLongField(jcore, native_ptr_attr);
|
||||
return (jlong)linphone_conference_params_new(core);
|
||||
}
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneConferenceParamsImpl_copyInstance(JNIEnv *env, jobject thiz, jlong paramsPtr) {
|
||||
return (jlong)linphone_conference_params_clone((LinphoneConferenceParams *)paramsPtr);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneConferenceParamsImpl_destroyInstance(JNIEnv *env, jobject thiz, jlong paramsPtr) {
|
||||
linphone_conference_params_free((LinphoneConferenceParams *)paramsPtr);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneConferenceParamsImpl_enableVideo(JNIEnv *env, jobject thiz, jlong paramsPtr, jboolean enable) {
|
||||
linphone_conference_params_enable_video((LinphoneConferenceParams *)paramsPtr, enable);
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneConferenceParamsImpl_isVideoEnabled(JNIEnv *env, jobject thiz, jlong paramsPtr) {
|
||||
return linphone_conference_params_video_requested((LinphoneConferenceParams *)paramsPtr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern "C" jobjectArray Java_org_linphone_core_LinphoneConferenceImpl_getParticipants(JNIEnv *env, jobject thiz, jlong pconference) {
|
||||
MSList *participants, *it;
|
||||
jclass addr_class = env->FindClass("org/linphone/core/LinphoneAddressImpl");
|
||||
|
|
|
|||
25
java/common/org/linphone/core/LinphoneConferenceParams.java
Normal file
25
java/common/org/linphone/core/LinphoneConferenceParams.java
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
/*
|
||||
LinphoneConferenceParams.java
|
||||
Copyright (C) 2015 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
package org.linphone.core;
|
||||
|
||||
public interface LinphoneConferenceParams {
|
||||
public void enableVideo(boolean enable);
|
||||
public boolean isVideoRequested();
|
||||
}
|
||||
|
|
@ -1348,6 +1348,19 @@ public interface LinphoneCore {
|
|||
void setZrtpSecretsCache(String file);
|
||||
void enableEchoLimiter(boolean val);
|
||||
|
||||
/**
|
||||
* Create a conference
|
||||
* @param params Parameters of the conference. Can be null
|
||||
* @return The new conference or null if the creation has failed
|
||||
*/
|
||||
LinphoneConference createConference(LinphoneConferenceParams params);
|
||||
/**
|
||||
* Return the value of the C pointer on the conference instance.
|
||||
*
|
||||
* That function can be used to test whether a conference is running.
|
||||
* @return A positive value if a conference is running, 0 if not.
|
||||
**/
|
||||
LinphoneConference getConference();
|
||||
/**
|
||||
* Indicates whether the local user is part of the conference.
|
||||
**/
|
||||
|
|
@ -1368,7 +1381,6 @@ public interface LinphoneCore {
|
|||
* When the local participant is out of the conference, the remote participants can continue to talk normally.
|
||||
**/
|
||||
void leaveConference();
|
||||
|
||||
/**
|
||||
* Merge a call into a conference.
|
||||
*
|
||||
|
|
@ -1417,13 +1429,6 @@ public interface LinphoneCore {
|
|||
* @returns the number of participants to the conference
|
||||
**/
|
||||
int getConferenceSize();
|
||||
/**
|
||||
* Return the value of the C pointer on the conference instance.
|
||||
*
|
||||
* That function can be used to test whether a conference is running.
|
||||
* @return A positive value if a conference is running, 0 if not.
|
||||
**/
|
||||
LinphoneConference getConference();
|
||||
|
||||
/**
|
||||
* Request recording of the conference into a supplied file path.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
LinphoneConferenceParamsImpl.java
|
||||
Copyright (C) 2015 Belledonne Communications, Grenoble, France
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
package org.linphone.core;
|
||||
|
||||
public class LinphoneConferenceParamsImpl implements LinphoneConferenceParams {
|
||||
private long nativePtr = 0;
|
||||
|
||||
private native long createInstance(LinphoneCoreImpl core);
|
||||
public LinphoneConferenceParamsImpl(LinphoneCore core) {
|
||||
this.nativePtr = createInstance((LinphoneCoreImpl)core);
|
||||
}
|
||||
|
||||
private native long copyInstance(long paramsPtr);
|
||||
public LinphoneConferenceParamsImpl(LinphoneConferenceParamsImpl params) {
|
||||
nativePtr = copyInstance(params.nativePtr);
|
||||
}
|
||||
|
||||
private native void destroyInstance(long nativePtr);
|
||||
public void finalize() {
|
||||
destroyInstance(this.nativePtr);
|
||||
}
|
||||
|
||||
private native void enableVideo(long paramsPtr, boolean enable);
|
||||
@Override
|
||||
public void enableVideo(boolean enable) {
|
||||
enableVideo(this.nativePtr, enable);
|
||||
}
|
||||
|
||||
private native boolean isVideoRequested(long paramsPtr);
|
||||
@Override
|
||||
public boolean isVideoRequested() {
|
||||
return isVideoRequested(this.nativePtr);
|
||||
}
|
||||
}
|
||||
|
|
@ -322,7 +322,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
setNetworkStateReachable(nativePtr,isReachable);
|
||||
}
|
||||
public synchronized void setPlaybackGain(float gain) {
|
||||
setPlaybackGain(nativePtr,gain);
|
||||
setPlaybackGain(nativePtr, gain);
|
||||
|
||||
}
|
||||
public synchronized float getPlaybackGain() {
|
||||
|
|
@ -382,7 +382,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
|
||||
public synchronized boolean payloadTypeIsVbr(PayloadType pt) {
|
||||
isValid();
|
||||
return payloadTypeIsVbr(nativePtr, ((PayloadTypeImpl)pt).nativePtr);
|
||||
return payloadTypeIsVbr(nativePtr, ((PayloadTypeImpl) pt).nativePtr);
|
||||
}
|
||||
|
||||
public synchronized void enableEchoCancellation(boolean enable) {
|
||||
|
|
@ -449,7 +449,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
}
|
||||
|
||||
public synchronized void addFriend(LinphoneFriend lf) throws LinphoneCoreException {
|
||||
addFriend(nativePtr,((LinphoneFriendImpl)lf).nativePtr);
|
||||
addFriend(nativePtr, ((LinphoneFriendImpl) lf).nativePtr);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -484,7 +484,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
return new LinphoneChatRoomImpl(getOrCreateChatRoom(nativePtr,to));
|
||||
}
|
||||
public synchronized LinphoneChatRoom getChatRoom(LinphoneAddress to) {
|
||||
return new LinphoneChatRoomImpl(getChatRoom(nativePtr,((LinphoneAddressImpl)to).nativePtr));
|
||||
return new LinphoneChatRoomImpl(getChatRoom(nativePtr, ((LinphoneAddressImpl) to).nativePtr));
|
||||
}
|
||||
public synchronized void setPreviewWindow(Object w) {
|
||||
setPreviewWindowId(nativePtr,w);
|
||||
|
|
@ -497,7 +497,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
}
|
||||
|
||||
public synchronized void enableVideo(boolean vcap_enabled, boolean display_enabled) {
|
||||
enableVideo(nativePtr,vcap_enabled, display_enabled);
|
||||
enableVideo(nativePtr, vcap_enabled, display_enabled);
|
||||
}
|
||||
public synchronized boolean isVideoEnabled() {
|
||||
return isVideoEnabled(nativePtr);
|
||||
|
|
@ -515,7 +515,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
setFirewallPolicy(nativePtr,pol.value());
|
||||
}
|
||||
public synchronized void setStunServer(String stunServer) {
|
||||
setStunServer(nativePtr,stunServer);
|
||||
setStunServer(nativePtr, stunServer);
|
||||
}
|
||||
|
||||
public synchronized LinphoneCall inviteAddressWithParams(LinphoneAddress to, LinphoneCallParams params) throws LinphoneCoreException {
|
||||
|
|
@ -655,7 +655,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
}
|
||||
|
||||
public synchronized void enableIpv6(boolean enable) {
|
||||
enableIpv6(nativePtr,enable);
|
||||
enableIpv6(nativePtr, enable);
|
||||
}
|
||||
public synchronized boolean isIpv6Enabled() {
|
||||
return isIpv6Enabled(nativePtr);
|
||||
|
|
@ -678,14 +678,14 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
|
||||
}
|
||||
public synchronized void setUploadPtime(int ptime) {
|
||||
setUploadPtime(nativePtr,ptime);
|
||||
setUploadPtime(nativePtr, ptime);
|
||||
}
|
||||
|
||||
public synchronized void setZrtpSecretsCache(String file) {
|
||||
setZrtpSecretsCache(nativePtr,file);
|
||||
setZrtpSecretsCache(nativePtr, file);
|
||||
}
|
||||
public synchronized void enableEchoLimiter(boolean val) {
|
||||
enableEchoLimiter(nativePtr,val);
|
||||
enableEchoLimiter(nativePtr, val);
|
||||
}
|
||||
public synchronized void setVideoDevice(int id) {
|
||||
Log.i("Setting camera id :", id);
|
||||
|
|
@ -721,6 +721,10 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
public synchronized int getConferenceSize() {
|
||||
return getConferenceSize(nativePtr);
|
||||
}
|
||||
private native LinphoneConference createConference(long corePtr, LinphoneConferenceParams params);
|
||||
public synchronized LinphoneConference createConference(LinphoneConferenceParams params) {
|
||||
return createConference(this.nativePtr, params);
|
||||
}
|
||||
private native LinphoneConference getConference(long nativePtr);
|
||||
public synchronized LinphoneConference getConference() {
|
||||
return getConference(nativePtr);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue