mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-19 12:08:11 +00:00
Added JNI API to read video policies
This commit is contained in:
parent
d21c1a917f
commit
08c59397cb
3 changed files with 47 additions and 0 deletions
|
|
@ -1110,6 +1110,12 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_enablePayloadType(JNIEnv
|
|||
,jboolean enable) {
|
||||
return (jint)linphone_core_enable_payload_type((LinphoneCore*)lc,(PayloadType*)pt,enable);
|
||||
}
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isPayloadTypeEnabled(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc
|
||||
,jlong pt) {
|
||||
return (jboolean) linphone_core_payload_type_enabled((LinphoneCore*)lc, (PayloadType*)pt);
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableEchoCancellation(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc
|
||||
|
|
@ -2938,6 +2944,16 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVideoPolicy(JNIEnv *e
|
|||
linphone_core_set_video_policy((LinphoneCore *)lc, &vpol);
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_getVideoAutoInitiatePolicy(JNIEnv *env, jobject thiz, jlong lc){
|
||||
const LinphoneVideoPolicy *vpol = linphone_core_get_video_policy((LinphoneCore *)lc);
|
||||
return (jboolean) vpol->automatically_initiate;
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_getVideoAutoAcceptPolicy(JNIEnv *env, jobject thiz, jlong lc){
|
||||
const LinphoneVideoPolicy *vpol = linphone_core_get_video_policy((LinphoneCore *)lc);
|
||||
return (jboolean) vpol->automatically_accept;
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setStaticPicture(JNIEnv *env, jobject thiz, jlong lc, jstring path) {
|
||||
const char *cpath = env->GetStringUTFChars(path, NULL);
|
||||
linphone_core_set_static_picture((LinphoneCore *)lc, cpath);
|
||||
|
|
|
|||
|
|
@ -638,6 +638,12 @@ public interface LinphoneCore {
|
|||
*
|
||||
*/
|
||||
void enablePayloadType(PayloadType pt, boolean enable) throws LinphoneCoreException;
|
||||
|
||||
/**
|
||||
* Returns whether or not the payload is enabled in linphonecore.
|
||||
*/
|
||||
boolean isPayloadTypeEnabled(PayloadType pt);
|
||||
|
||||
/**
|
||||
* Enables or disable echo cancellation.
|
||||
* @param enable
|
||||
|
|
@ -1162,6 +1168,17 @@ public interface LinphoneCore {
|
|||
* @param autoAccept video shall be accepter by default for incoming calls
|
||||
**/
|
||||
void setVideoPolicy(boolean autoInitiate, boolean autoAccept);
|
||||
|
||||
/**
|
||||
* Gets the policy for the autoInitiate video
|
||||
*/
|
||||
boolean getVideoAutoInitiatePolicy();
|
||||
|
||||
/**
|
||||
* Gets the policy for the autoAccept video
|
||||
*/
|
||||
boolean getVideoAutoAcceptPolicy();
|
||||
|
||||
/** Set static picture to be used when "Static picture" is the video device
|
||||
* @param path to the static picture file
|
||||
* */
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
private native boolean isMicMuted(long nativePtr);
|
||||
private native long findPayloadType(long nativePtr, String mime, int clockRate, int channels);
|
||||
private native int enablePayloadType(long nativePtr, long payloadType, boolean enable);
|
||||
private native boolean isPayloadTypeEnabled(long nativePtr, long payloadType);
|
||||
private native void enableEchoCancellation(long nativePtr,boolean enable);
|
||||
private native boolean isEchoCancellationEnabled(long nativePtr);
|
||||
private native Object getCurrentCall(long nativePtr) ;
|
||||
|
|
@ -321,6 +322,10 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
}
|
||||
|
||||
}
|
||||
public synchronized boolean isPayloadTypeEnabled(PayloadType pt) {
|
||||
isValid();
|
||||
return isPayloadTypeEnabled(nativePtr, ((PayloadTypeImpl)pt).nativePtr);
|
||||
}
|
||||
public synchronized void enableEchoCancellation(boolean enable) {
|
||||
isValid();
|
||||
enableEchoCancellation(nativePtr, enable);
|
||||
|
|
@ -788,6 +793,15 @@ class LinphoneCoreImpl implements LinphoneCore {
|
|||
public synchronized void setVideoPolicy(boolean autoInitiate, boolean autoAccept) {
|
||||
setVideoPolicy(nativePtr, autoInitiate, autoAccept);
|
||||
}
|
||||
private native boolean getVideoAutoInitiatePolicy(long nativePtr);
|
||||
public synchronized boolean getVideoAutoInitiatePolicy() {
|
||||
return getVideoAutoInitiatePolicy(nativePtr);
|
||||
}
|
||||
private native boolean getVideoAutoAcceptPolicy(long nativePtr);
|
||||
public synchronized boolean getVideoAutoAcceptPolicy() {
|
||||
return getVideoAutoAcceptPolicy(nativePtr);
|
||||
}
|
||||
|
||||
private native void setStaticPicture(long nativePtr, String path);
|
||||
public synchronized void setStaticPicture(String path) {
|
||||
setStaticPicture(nativePtr, path);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue