From 9e55c638750368e5b87ff986d4a304ab5c17944d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Fri, 17 Oct 2014 13:38:37 +0200 Subject: [PATCH] Add getPlayer() method to LinphoneCore class --- coreapi/linphonecore_jni.cc | 4 ++++ java/common/org/linphone/core/LinphoneCall.java | 7 +++++++ java/impl/org/linphone/core/LinphoneCallImpl.java | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 2fff651f5..857ad716d 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -2445,6 +2445,10 @@ extern "C" jfloat Java_org_linphone_core_LinphoneCallImpl_getAverageQuality( JNI return (jfloat)linphone_call_get_average_quality((LinphoneCall*)ptr); } +extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_getPlayer(JNIEnv *env, jobject thiz, jlong callPtr) { + return (jlong)linphone_call_get_player((LinphoneCall *)callPtr); +} + //LinphoneFriend extern "C" jlong Java_org_linphone_core_LinphoneFriendImpl_newLinphoneFriend(JNIEnv* env ,jobject thiz diff --git a/java/common/org/linphone/core/LinphoneCall.java b/java/common/org/linphone/core/LinphoneCall.java index d75f1bbdb..f6f11ebd7 100644 --- a/java/common/org/linphone/core/LinphoneCall.java +++ b/java/common/org/linphone/core/LinphoneCall.java @@ -333,4 +333,11 @@ public interface LinphoneCall { * @return an Object. */ Object getUserData(); + + /** + * Get a call player + * Call player enable to stream a media file through a call + * @return A player + */ + public LinphonePlayer getPlayer(); } diff --git a/java/impl/org/linphone/core/LinphoneCallImpl.java b/java/impl/org/linphone/core/LinphoneCallImpl.java index ee78e9d89..b2cad202c 100644 --- a/java/impl/org/linphone/core/LinphoneCallImpl.java +++ b/java/impl/org/linphone/core/LinphoneCallImpl.java @@ -245,4 +245,10 @@ class LinphoneCallImpl implements LinphoneCall { public Object getUserData() { return userData; } + + private native long getPlayer(long callPtr); + @Override + public LinphonePlayer getPlayer() { + return new LinphonePlayerImpl(getPlayer(nativePtr)); + } }