]> sjero.net Git - linphone/commitdiff
android: improve android linphone app (video calls)
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@linphone.org>
Fri, 16 Sep 2011 08:37:24 +0000 (10:37 +0200)
committerPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@linphone.org>
Fri, 16 Sep 2011 08:37:24 +0000 (10:37 +0200)
coreapi/linphonecore_jni.cc
java/common/org/linphone/core/LinphoneCall.java
java/common/org/linphone/core/LinphoneCore.java
mediastreamer2

index c089f7796f7b44384e9281229957216b047bcfa8..5d82d099b4a9e8cb00a56cc7c8132e5503b07b01 100644 (file)
@@ -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);
index 1c0252aa22d75611d892303f4fb2603f2b2a045f..8cf2465077a23e1a232f61e2653635a3e6cdb94c 100644 (file)
@@ -152,6 +152,8 @@ public interface LinphoneCall {
        LinphoneCallParams getCurrentParamsCopy();
        
        void enableCamera(boolean enabled);
+       boolean cameraEnabled();
+       
        /**
         * Enables or disable echo cancellation.
         * @param enable
index f28cb77fd8aacb1140d91bb40e698ebd465287d6..a56e2b86193f21e7272f27eac0aaccd17d695f00 100644 (file)
@@ -477,6 +477,7 @@ public interface LinphoneCore {
        void setDeviceRotation(int rotation);
        
        void setVideoDevice(int id);
+       int getVideoDevice();
        
        /**
         * Enables video globally.
index a82dcdbf8a4e8364bdcaa6f6fb88ca087f48a780..af7bb8b24da40d653a89bc61cd7832db773fa48c 160000 (submodule)
@@ -1 +1 @@
-Subproject commit a82dcdbf8a4e8364bdcaa6f6fb88ca087f48a780
+Subproject commit af7bb8b24da40d653a89bc61cd7832db773fa48c