#include "linphonecore_utils.h"
#include <ortp/zrtp.h>
+extern "C" {
+#include "mediastreamer2/mediastream.h"
+}
#include "mediastreamer2/msjava.h"
-
+#include "private.h"
#include <cpu-features.h>
#ifdef ANDROID
linphone_core_set_native_video_window_id((LinphoneCore*)lc,(unsigned long)obj);
}
+extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPreviewWindowId(JNIEnv* env
+ ,jobject thiz
+ ,jlong lc
+ ,jobject obj) {
+ linphone_core_set_native_preview_window_id((LinphoneCore*)lc,(unsigned long)obj);
+}
+
+extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setDeviceRotation(JNIEnv* env
+ ,jobject thiz
+ ,jlong lc
+ ,jint rotation) {
+ linphone_core_set_device_rotation((LinphoneCore*)lc,rotation);
+}
+
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setFirewallPolicy(JNIEnv *env, jobject thiz, jlong lc, int enum_value){
linphone_core_set_firewall_policy((LinphoneCore*)lc,(LinphoneFirewallPolicy)enum_value);
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);
}
extern "C" jint Java_org_linphone_core_LinphoneCallImpl_getDuration(JNIEnv* env,jobject thiz,jlong ptr) {
linphone_call_get_duration((LinphoneCall *) ptr);
}
-
+
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getSignalingTransportPort(JNIEnv* env,jobject thiz,jlong ptr, jint code) {
LCSipTransports tr;
linphone_core_get_sip_transports((LinphoneCore *) ptr, &tr);
tr.udp_port = udp;
tr.tcp_port = tcp;
tr.tls_port = tls;
-
+
linphone_core_set_sip_transports(lc, &tr); // tr will be copied
}
}
}
+extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_setVideoDevice(JNIEnv *env,jobject thiz,jlong pCore,jint id) {
+ 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;
+ }
+ int i;
+ for(i=0; i<=id; i++) {
+ if (devices[i] == NULL)
+ break;
+ ms_message("Existing device %d : %s\n", i, devices[i]);
+ if (i==id) {
+ return linphone_core_set_video_device(lc, devices[i]);
+ }
+ }
+ 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);
msandroid_hack_speaker_state(speakerOn);
// End Galaxy S hack functions
}
-