forked from mirrors/linphone-iphone
JNI wrapper for LinphoneCallParams getSentVideoSize and getReceivedVideoSize methods
This commit is contained in:
parent
3cd4eb5e75
commit
3a3f331ca3
4 changed files with 53 additions and 2 deletions
|
|
@ -2660,6 +2660,24 @@ extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_setRecordFile(JNIE
|
|||
}else linphone_call_params_set_record_file((LinphoneCallParams*)lcp,NULL);
|
||||
}
|
||||
|
||||
extern "C" jintArray Java_org_linphone_core_LinphoneCallParamsImpl_getSentVideoSize(JNIEnv *env, jobject thiz, jlong lcp) {
|
||||
const LinphoneCallParams *params = (LinphoneCallParams *) lcp;
|
||||
MSVideoSize vsize = linphone_call_params_get_sent_video_size(params);
|
||||
jintArray arr = env->NewIntArray(2);
|
||||
int tVsize [2]= {vsize.width,vsize.height};
|
||||
env->SetIntArrayRegion(arr, 0, 2, tVsize);
|
||||
return arr;
|
||||
}
|
||||
|
||||
extern "C" jintArray Java_org_linphone_core_LinphoneCallParamsImpl_getReceivedVideoSize(JNIEnv *env, jobject thiz, jlong lcp) {
|
||||
const LinphoneCallParams *params = (LinphoneCallParams *) lcp;
|
||||
MSVideoSize vsize = linphone_call_params_get_received_video_size(params);
|
||||
jintArray arr = env->NewIntArray(2);
|
||||
int tVsize [2]= {vsize.width,vsize.height};
|
||||
env->SetIntArrayRegion(arr, 0, 2, tVsize);
|
||||
return arr;
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_destroy(JNIEnv *env, jobject thiz, jlong lc){
|
||||
return linphone_call_params_destroy((LinphoneCallParams*)lc);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,4 +116,16 @@ public interface LinphoneCallParams {
|
|||
* @return the session name
|
||||
**/
|
||||
String getSessionName();
|
||||
|
||||
/**
|
||||
* Gets the size of the video that is sent.
|
||||
* @return The sent video size.
|
||||
*/
|
||||
VideoSize getSentVideoSize();
|
||||
|
||||
/**
|
||||
* Gets the size of the video that is received.
|
||||
* @return The received video size.
|
||||
*/
|
||||
VideoSize getReceivedVideoSize();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,9 @@ public final class VideoSize {
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
public String toDisplayableString() {
|
||||
return width + "x" + height;
|
||||
}
|
||||
public String toString() {
|
||||
return "width = "+width + " height = " + height;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,5 +130,24 @@ public class LinphoneCallParamsImpl implements LinphoneCallParams {
|
|||
public String getSessionName() {
|
||||
return getSessionName(nativePtr);
|
||||
}
|
||||
|
||||
|
||||
private native int[] getSentVideoSize(long nativePtr);
|
||||
@Override
|
||||
public VideoSize getSentVideoSize() {
|
||||
int[] nativeSize = getSentVideoSize(nativePtr);
|
||||
VideoSize vSize = new VideoSize();
|
||||
vSize.width = nativeSize[0];
|
||||
vSize.height = nativeSize[1];
|
||||
return vSize;
|
||||
}
|
||||
|
||||
private native int[] getReceivedVideoSize(long nativePtr);
|
||||
@Override
|
||||
public VideoSize getReceivedVideoSize() {
|
||||
int[] nativeSize = getReceivedVideoSize(nativePtr);
|
||||
VideoSize vSize = new VideoSize();
|
||||
vSize.width = nativeSize[0];
|
||||
vSize.height = nativeSize[1];
|
||||
return vSize;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue