mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
JNI wrapper for accept_early_media methods
This commit is contained in:
parent
f3ca28fe64
commit
c0bd6fb61e
3 changed files with 51 additions and 0 deletions
|
|
@ -1015,6 +1015,21 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_deferCallUpdate(JNIEnv *
|
|||
linphone_core_defer_call_update((LinphoneCore*)lc,(LinphoneCall*)call);
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_acceptEarlyMedia(JNIEnv *env, jobject thiz, jlong lc, jlong c) {
|
||||
LinphoneCore *core = (LinphoneCore *)lc;
|
||||
LinphoneCall *call = (LinphoneCall *)c;
|
||||
int ret = linphone_core_accept_early_media(core, call);
|
||||
return (jboolean) ret == 0;
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_acceptEarlyMediaWithParams(JNIEnv *env, jobject thiz, jlong lc, jlong c, jlong params) {
|
||||
LinphoneCore *core = (LinphoneCore *)lc;
|
||||
LinphoneCall *call = (LinphoneCall *)c;
|
||||
const LinphoneCallParams *call_params = (LinphoneCallParams *) params;
|
||||
int ret = linphone_core_accept_early_media_with_params(core, call, call_params);
|
||||
return (jboolean) ret == 0;
|
||||
}
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getCallLog( JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc
|
||||
|
|
|
|||
|
|
@ -1496,4 +1496,26 @@ public interface LinphoneCore {
|
|||
* @returns 1 if migration was done, 0 if not done because unnecessary or already done, -1 in case of error.
|
||||
*/
|
||||
public int migrateToMultiTransport();
|
||||
|
||||
/**
|
||||
* When receiving an incoming, accept to start a media session as early-media.
|
||||
* This means the call is not accepted but audio & video streams can be established if the remote party supports early media.
|
||||
* However, unlike after call acceptance, mic and camera input are not sent during early-media, though received audio & video are played normally.
|
||||
* The call can then later be fully accepted using linphone_core_accept_call() or linphone_core_accept_call_with_params().
|
||||
* @param lc the linphonecore
|
||||
* @param call the call
|
||||
* @param params the call params, can be NULL.
|
||||
* @return true if successful, false otherwise.
|
||||
*/
|
||||
public boolean acceptEarlyMedia(LinphoneCall call);
|
||||
|
||||
/**
|
||||
* Accept an early media session for an incoming call.
|
||||
* This is identical as calling linphone_core_accept_early_media_with_params() with NULL call parameters.
|
||||
* @see linphone_core_accept_early_media_with_params()
|
||||
* @param lc the core
|
||||
* @param call the incoming call
|
||||
* @return true if successful, false otherwise.
|
||||
*/
|
||||
public boolean acceptEarlyMediaWithParams(LinphoneCall call, LinphoneCallParams params);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1115,4 +1115,18 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
public int migrateToMultiTransport() {
|
||||
return migrateToMultiTransport(nativePtr);
|
||||
}
|
||||
|
||||
private native boolean acceptEarlyMedia(long lc, long call);
|
||||
@Override
|
||||
public boolean acceptEarlyMedia(LinphoneCall call) {
|
||||
return acceptEarlyMedia(nativePtr, getCallPtr(call));
|
||||
}
|
||||
|
||||
private native boolean acceptEarlyMediaWithParams(long lc, long call, long params);
|
||||
@Override
|
||||
public boolean acceptEarlyMediaWithParams(LinphoneCall call,
|
||||
LinphoneCallParams params) {
|
||||
long ptrParams = params != null ? ((LinphoneCallParamsImpl) params).nativePtr : 0;
|
||||
return acceptEarlyMediaWithParams(nativePtr, getCallPtr(call), ptrParams);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue