From 75f5c45f15d6c185a941911bbac779339cf2c79b Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 18 Jun 2010 11:01:12 +0200 Subject: [PATCH] add codec management start OUTGOING Call intent management --- LinphoneCoreFactoryImpl.java | 6 ++++++ LinphoneCoreImpl.java | 18 +++++++++++++++++- LinphoneProxyConfigImpl.java | 11 +++++++++++ PayloadTypeImpl.java | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 PayloadTypeImpl.java diff --git a/LinphoneCoreFactoryImpl.java b/LinphoneCoreFactoryImpl.java index a34eabcae..712e27b63 100644 --- a/LinphoneCoreFactoryImpl.java +++ b/LinphoneCoreFactoryImpl.java @@ -62,4 +62,10 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory { @Override public native void setDebugMode(boolean enable); + + @Override + public void setLogHandler(LinphoneLogHandler handler) { + //not implemented on Android + + } } diff --git a/LinphoneCoreImpl.java b/LinphoneCoreImpl.java index 547e4bc0d..376831473 100644 --- a/LinphoneCoreImpl.java +++ b/LinphoneCoreImpl.java @@ -56,7 +56,8 @@ class LinphoneCoreImpl implements LinphoneCore { private native void sendDtmf(long nativePtr,char dtmf); private native void clearCallLogs(long nativePtr); private native boolean isMicMuted(long nativePtr); - + private native long findPayloadType(long nativePtr, String mime, int clockRate); + private native int enablePayloadType(long nativePtr, long payloadType, boolean enable); LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig,File factoryConfig,Object userdata) throws IOException { mListener=listener; @@ -190,4 +191,19 @@ class LinphoneCoreImpl implements LinphoneCore { public boolean isMicMuted() { return isMicMuted(nativePtr); } + public PayloadType findPayloadType(String mime, int clockRate) { + long playLoadType = findPayloadType(nativePtr, mime, clockRate); + if (playLoadType == 0) { + return null; + } else { + return new PayloadTypeImpl(playLoadType); + } + } + public void enablePayloadType(PayloadType pt, boolean enable) + throws LinphoneCoreException { + if (enablePayloadType(nativePtr,((PayloadTypeImpl)pt).nativePtr,enable) != 0) { + throw new LinphoneCoreException("cannot enable payload type ["+pt+"]"); + } + + } } diff --git a/LinphoneProxyConfigImpl.java b/LinphoneProxyConfigImpl.java index 01080bfc0..7ffb164b2 100644 --- a/LinphoneProxyConfigImpl.java +++ b/LinphoneProxyConfigImpl.java @@ -69,6 +69,9 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig { private native void setDialEscapePlus(long ptr, boolean value); + private native String getRoute(long ptr); + private native int setRoute(long ptr,String uri); + public void enableRegister(boolean value) { enableRegister(nativePtr,value); } @@ -114,4 +117,12 @@ class LinphoneProxyConfigImpl implements LinphoneProxyConfig { public boolean registerEnabled() { return isRegisterEnabled(nativePtr); } + public String getRoute() { + return getRoute(nativePtr); + } + public void setRoute(String routeUri) throws LinphoneCoreException { + if (setRoute(nativePtr, routeUri) != 0) { + throw new LinphoneCoreException("cannot set route ["+routeUri+"]"); + } + } } diff --git a/PayloadTypeImpl.java b/PayloadTypeImpl.java new file mode 100644 index 000000000..28c206786 --- /dev/null +++ b/PayloadTypeImpl.java @@ -0,0 +1,34 @@ +/* +PayloadTypeImpl.java +Copyright (C) 2010 Belledonne Communications, Grenoble, France + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +package org.linphone.core; + +class PayloadTypeImpl implements PayloadType { + + protected final long nativePtr; + + private native String toString(long ptr); + + protected PayloadTypeImpl(long aNativePtr) { + nativePtr = aNativePtr; + } + public String toString() { + return toString(nativePtr); + } +}