Commit 9db25e99 authored by Pierre-Eric Pelloux-Prayer's avatar Pierre-Eric Pelloux-Prayer
Browse files

android: improve android linphone app (video calls)

parent 36a99389
...@@ -1230,6 +1230,10 @@ extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_enableCamera(JNIEnv *en ...@@ -1230,6 +1230,10 @@ extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_enableCamera(JNIEnv *en
linphone_call_enable_camera((LinphoneCall *)lc, (bool_t) b); linphone_call_enable_camera((LinphoneCall *)lc, (bool_t) b);
} }
extern "C" jboolean Java_org_linphone_core_LinphoneCallImpl_cameraEnabled(JNIEnv *env, jobject thiz, jlong lc){
linphone_call_camera_enabled((LinphoneCall *)lc);
}
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_inviteAddressWithParams(JNIEnv *env, jobject thiz, jlong lc, jlong addr, jlong params){ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_inviteAddressWithParams(JNIEnv *env, jobject thiz, jlong lc, jlong addr, jlong params){
return (jlong) linphone_core_invite_address_with_params((LinphoneCore *)lc, (const LinphoneAddress *)addr, (const LinphoneCallParams *)params); return (jlong) linphone_core_invite_address_with_params((LinphoneCore *)lc, (const LinphoneAddress *)addr, (const LinphoneCallParams *)params);
} }
...@@ -1370,6 +1374,28 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_setVideoDevice(JNIEnv *e ...@@ -1370,6 +1374,28 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_setVideoDevice(JNIEnv *e
return -1; return -1;
} }
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getVideoDevice(JNIEnv *env,jobject thiz,jlong pCore) {
LinphoneCore* lc = (LinphoneCore *) pCore;
const char** devices = linphone_core_get_video_devices(lc);
if (devices == NULL) {
ms_error("No existing video devices\n");
return -1;
}
const char* cam = linphone_core_get_video_device(lc);
if (cam == NULL) {
ms_error("No current video device\n");
} else {
int i=0;
while(devices[i] != NULL) {
if (strcmp(devices[i], cam) == 0)
return i;
i++;
}
}
ms_warning("Returning default (0) device\n");
return 0;
}
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);
......
...@@ -152,6 +152,8 @@ public interface LinphoneCall { ...@@ -152,6 +152,8 @@ public interface LinphoneCall {
LinphoneCallParams getCurrentParamsCopy(); LinphoneCallParams getCurrentParamsCopy();
void enableCamera(boolean enabled); void enableCamera(boolean enabled);
boolean cameraEnabled();
/** /**
* Enables or disable echo cancellation. * Enables or disable echo cancellation.
* @param enable * @param enable
......
...@@ -477,6 +477,7 @@ public interface LinphoneCore { ...@@ -477,6 +477,7 @@ public interface LinphoneCore {
void setDeviceRotation(int rotation); void setDeviceRotation(int rotation);
void setVideoDevice(int id); void setVideoDevice(int id);
int getVideoDevice();
/** /**
* Enables video globally. * Enables video globally.
......
mediastreamer2 @ af7bb8b2
Subproject commit a82dcdbf8a4e8364bdcaa6f6fb88ca087f48a780 Subproject commit af7bb8b24da40d653a89bc61cd7832db773fa48c
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment