Get supported video resolutions in Android from linphonecore

This commit is contained in:
Sylvain Berfini 2014-01-28 13:59:55 +01:00
parent 187c55bfd8
commit 809123e950
4 changed files with 44 additions and 12 deletions

View file

@ -2979,6 +2979,26 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getVideoDevice(JNIEnv *e
return 0; return 0;
} }
extern "C" jobjectArray Java_org_linphone_core_LinphoneCoreImpl_listSupportedVideoResolutions(JNIEnv *env, jobject thiz, jlong lc) {
const MSVideoSizeDef *pdef = linphone_core_get_supported_video_sizes((LinphoneCore *)lc);
int count = 0;
int i = 0;
for (; pdef->name!=NULL; pdef++) {
i++;
}
count = i;
jobjectArray resolutions = (jobjectArray) env->NewObjectArray(count, env->FindClass("java/lang/String"), env->NewStringUTF(""));
pdef = linphone_core_get_supported_video_sizes((LinphoneCore *)lc);
i = 0;
for (; pdef->name!=NULL; pdef++) {
env->SetObjectArrayElement(resolutions, i, env->NewStringUTF(pdef->name));
i++;
}
return resolutions;
}
extern "C" jstring Java_org_linphone_core_LinphoneCallImpl_getAuthenticationToken(JNIEnv* env,jobject thiz,jlong ptr) { extern "C" jstring Java_org_linphone_core_LinphoneCallImpl_getAuthenticationToken(JNIEnv* env,jobject thiz,jlong ptr) {
LinphoneCall *call = (LinphoneCall *) ptr; LinphoneCall *call = (LinphoneCall *) ptr;
const char* token = linphone_call_get_authentication_token(call); const char* token = linphone_call_get_authentication_token(call);

View file

@ -1413,4 +1413,10 @@ public interface LinphoneCore {
* @return an array of LinphoneChatRoom * @return an array of LinphoneChatRoom
*/ */
public LinphoneChatRoom[] getChatRooms(); public LinphoneChatRoom[] getChatRooms();
/**
* Gets the linphonecore supported resolutions for video
* @return an array of String
*/
public String[] getSupportedVideoSizes();
} }

View file

@ -1088,4 +1088,10 @@ class LinphoneCoreImpl implements LinphoneCore {
long ptrParams =((LinphoneCallParamsImpl)params).nativePtr; long ptrParams =((LinphoneCallParamsImpl)params).nativePtr;
return startReferedCall(nativePtr, getCallPtr(call), ptrParams); return startReferedCall(nativePtr, getCallPtr(call), ptrParams);
} }
private native String[] listSupportedVideoResolutions(long ptr);
@Override
public String[] getSupportedVideoSizes() {
return listSupportedVideoResolutions(nativePtr);
}
} }