diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index c089f7796..5d82d099b 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1230,6 +1230,10 @@ extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_enableCamera(JNIEnv *en 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){ 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 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) { LinphoneCall *call = (LinphoneCall *) ptr; const char* token = linphone_call_get_authentication_token(call); diff --git a/java/common/org/linphone/core/LinphoneCall.java b/java/common/org/linphone/core/LinphoneCall.java index 1c0252aa2..8cf246507 100644 --- a/java/common/org/linphone/core/LinphoneCall.java +++ b/java/common/org/linphone/core/LinphoneCall.java @@ -152,6 +152,8 @@ public interface LinphoneCall { LinphoneCallParams getCurrentParamsCopy(); void enableCamera(boolean enabled); + boolean cameraEnabled(); + /** * Enables or disable echo cancellation. * @param enable diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index f28cb77fd..a56e2b861 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -477,6 +477,7 @@ public interface LinphoneCore { void setDeviceRotation(int rotation); void setVideoDevice(int id); + int getVideoDevice(); /** * Enables video globally. diff --git a/mediastreamer2 b/mediastreamer2 index a82dcdbf8..af7bb8b24 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit a82dcdbf8a4e8364bdcaa6f6fb88ca087f48a780 +Subproject commit af7bb8b24da40d653a89bc61cd7832db773fa48c