Add possibility to change adaptive rate algorithm at runtime

This commit is contained in:
Gautier Pelloux-Prayer 2014-09-08 16:23:11 +02:00
parent a6fbc18b91
commit f6e388c4b2
7 changed files with 369 additions and 277 deletions

View file

@ -1960,6 +1960,8 @@ static void linphone_call_start_audio_stream(LinphoneCall *call, const char *cna
if (playcard && stream->max_rate>0) ms_snd_card_set_preferred_sample_rate(playcard, stream->max_rate);
if (captcard && stream->max_rate>0) ms_snd_card_set_preferred_sample_rate(captcard, stream->max_rate);
audio_stream_enable_adaptive_bitrate_control(call->audiostream,use_arc);
media_stream_set_adaptive_bitrate_algorithm(&call->audiostream->ms,
linphone_core_get_adaptive_rate_algorithm(lc));
audio_stream_enable_adaptive_jittcomp(call->audiostream, linphone_core_audio_adaptive_jittcomp_enabled(lc));
if (!call->params->in_conference && call->params->record_file){
audio_stream_mixed_record_open(call->audiostream,call->params->record_file);
@ -2050,6 +2052,8 @@ static void linphone_call_start_video_stream(LinphoneCall *call, const char *cna
video_stream_enable_adaptive_bitrate_control(call->videostream,
linphone_core_adaptive_rate_control_enabled(lc));
media_stream_set_adaptive_bitrate_algorithm(&call->videostream->ms,
linphone_core_get_adaptive_rate_algorithm(lc));
video_stream_enable_adaptive_jittcomp(call->videostream, linphone_core_video_adaptive_jittcomp_enabled(lc));
if (lc->video_conf.preview_vsize.width!=0)
video_stream_set_preview_size(call->videostream,lc->video_conf.preview_vsize);

View file

@ -785,6 +785,36 @@ bool_t linphone_core_adaptive_rate_control_enabled(const LinphoneCore *lc){
return lp_config_get_int(lc->config,"net","adaptive_rate_control",TRUE);
}
/**
* Sets adaptive rate algorithm. It will be used for each new calls starting from
* now. Calls already started will not be updated.
*
* @ingroup media_parameters
*
**/
void linphone_core_set_adaptive_rate_algorithm(LinphoneCore *lc, MSQosAnalyzerAlgorithm algorithm){
lp_config_set_string(lc->config,"net","adaptive_rate_algorithm",ms_qos_analyzer_algorithm_to_string(algorithm));
}
/**
* Returns which adaptive rate algorithm is currently configured for future calls.
*
* @ingroup media_parameters
*
* See linphone_core_set_adaptive_rate_algorithm().
**/
MSQosAnalyzerAlgorithm linphone_core_get_adaptive_rate_algorithm(const LinphoneCore *lc){
const char* alg = lp_config_get_string(lc->config, "net", "adaptive_rate_algorithm", NULL);
if (alg == NULL || strcmp(alg, "Simple")==0)
return MSQosAnalyzerAlgorithmSimple;
else if (strcmp(alg, "Stateful")==0)
return MSQosAnalyzerAlgorithmStateful;
ms_error("Invalid value for key net/adaptive_rate_control: %s", alg);
return MSQosAnalyzerAlgorithmSimple;
}
bool_t linphone_core_rtcp_enabled(const LinphoneCore *lc){
return lp_config_get_int(lc->config,"rtp","rtcp_enabled",TRUE);
}
@ -5031,13 +5061,13 @@ static void update_preview_size(LinphoneCore *lc, MSVideoSize oldvsize, MSVideoS
void linphone_core_set_preferred_video_size(LinphoneCore *lc, MSVideoSize vsize){
if (video_size_supported(vsize)){
MSVideoSize oldvsize=lc->video_conf.preview_vsize;
if (oldvsize.width==0){
oldvsize=lc->video_conf.vsize;
}
lc->video_conf.vsize=vsize;
update_preview_size(lc,oldvsize,vsize);
if (linphone_core_ready(lc))
lp_config_set_string(lc->config,"video","size",video_size_get_name(vsize));
}
@ -5951,7 +5981,7 @@ LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCore *l
}
/**
* Create a LinphoneCallParams suitable for linphone_core_invite_with_params(), linphone_core_accept_call_with_params(), linphone_core_accept_early_media_with_params(),
* Create a LinphoneCallParams suitable for linphone_core_invite_with_params(), linphone_core_accept_call_with_params(), linphone_core_accept_early_media_with_params(),
* linphone_core_accept_call_update().
* The parameters are initialized according to the current LinphoneCore configuration and the current state of the LinphoneCall.
* @param lc the LinphoneCore

View file

@ -1877,6 +1877,9 @@ LINPHONE_PUBLIC int linphone_core_get_upload_bandwidth(const LinphoneCore *lc);
LINPHONE_PUBLIC void linphone_core_enable_adaptive_rate_control(LinphoneCore *lc, bool_t enabled);
LINPHONE_PUBLIC bool_t linphone_core_adaptive_rate_control_enabled(const LinphoneCore *lc);
LINPHONE_PUBLIC void linphone_core_set_adaptive_rate_algorithm(LinphoneCore *lc, MSQosAnalyzerAlgorithm algorithm);
LINPHONE_PUBLIC MSQosAnalyzerAlgorithm linphone_core_get_adaptive_rate_algorithm(const LinphoneCore *lc);
LINPHONE_PUBLIC void linphone_core_set_download_ptime(LinphoneCore *lc, int ptime);
LINPHONE_PUBLIC int linphone_core_get_download_ptime(LinphoneCore *lc);

View file

@ -1333,6 +1333,20 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isAdaptiveRateContro
) {
return (jboolean)linphone_core_adaptive_rate_control_enabled((LinphoneCore*)lc);
}
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getAdaptiveRateAlgorithm(JNIEnv* env
,jobject thiz
,jlong lc
) {
return (jint)linphone_core_get_adaptive_rate_algorithm((LinphoneCore*)lc);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setAdaptiveRateAlgorithm(JNIEnv* env
,jobject thiz
,jlong lc
,jint alg) {
linphone_core_set_adaptive_rate_algorithm((LinphoneCore*)lc,(MSQosAnalyzerAlgorithm)alg);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableEchoCancellation(JNIEnv* env
,jobject thiz

File diff suppressed because it is too large Load diff

View file

@ -47,7 +47,7 @@ class LinphoneCoreImpl implements LinphoneCore {
private native int addProxyConfig(LinphoneProxyConfig jprtoxyCfg,long nativePtr,long proxyCfgNativePtr);
private native void removeProxyConfig(long nativePtr, long proxyCfg);
private native void clearAuthInfos(long nativePtr);
private native void clearProxyConfigs(long nativePtr);
private native void addAuthInfo(long nativePtr,long authInfoNativePtr);
private native void removeAuthInfo(long nativePtr, long authInfoNativePtr);
@ -77,6 +77,8 @@ class LinphoneCoreImpl implements LinphoneCore {
private native boolean payloadTypeIsVbr(long nativePtr, long payloadType);
private native void enableAdaptiveRateControl(long nativePtr,boolean enable);
private native boolean isAdaptiveRateControlEnabled(long nativePtr);
private native int getAdaptiveRateAlgorithm(long nativePtr);
private native void setAdaptiveRateAlgorithm(long nativePtr, int alg);
private native void enableEchoCancellation(long nativePtr,boolean enable);
private native boolean isEchoCancellationEnabled(long nativePtr);
private native Object getCurrentCall(long nativePtr) ;
@ -154,7 +156,7 @@ class LinphoneCoreImpl implements LinphoneCore {
private native boolean isSdp200AckEnabled(long nativePtr);
private native void stopRinging(long nativePtr);
private native static void setAndroidPowerManager(Object pm);
LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig, File factoryConfig, Object userdata) throws IOException {
mListener = listener;
String user = userConfig == null ? null : userConfig.getCanonicalPath();
@ -165,9 +167,9 @@ class LinphoneCoreImpl implements LinphoneCore {
mListener = listener;
nativePtr = newLinphoneCore(listener,null,null,null);
}
protected void finalize() throws Throwable {
}
private boolean contextInitialized() {
@ -195,7 +197,7 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized LinphoneProxyConfig getDefaultProxyConfig() {
isValid();
return getDefaultProxyConfig(nativePtr);
return getDefaultProxyConfig(nativePtr);
}
public synchronized LinphoneCall invite(String uri) {
@ -259,7 +261,7 @@ class LinphoneCoreImpl implements LinphoneCore {
}
public synchronized LinphoneCallLog[] getCallLogs() {
isValid();
LinphoneCallLog[] logs = new LinphoneCallLog[getNumberOfCallLogs(nativePtr)];
LinphoneCallLog[] logs = new LinphoneCallLog[getNumberOfCallLogs(nativePtr)];
for (int i=0;i < getNumberOfCallLogs(nativePtr);i++) {
logs[i] = new LinphoneCallLogImpl(getCallLog(nativePtr, i));
}
@ -267,7 +269,7 @@ class LinphoneCoreImpl implements LinphoneCore {
}
public synchronized void destroy() {
}
private void isValid() {
if (nativePtr == 0) {
throw new RuntimeException("object already destroyed");
@ -278,7 +280,7 @@ class LinphoneCoreImpl implements LinphoneCore {
}
public synchronized void setPlaybackGain(float gain) {
setPlaybackGain(nativePtr,gain);
}
public synchronized float getPlaybackGain() {
return getPlaybackGain(nativePtr);
@ -295,7 +297,7 @@ class LinphoneCoreImpl implements LinphoneCore {
throw new LinphoneCoreException("Cannot interpret ["+destination+"]");
}
}
public synchronized LinphoneCall invite(LinphoneAddress to) throws LinphoneCoreException {
public synchronized LinphoneCall invite(LinphoneAddress to) throws LinphoneCoreException {
LinphoneCall call = (LinphoneCall)inviteAddress(nativePtr,((LinphoneAddressImpl)to).nativePtr);
if (call!=null) {
return call;
@ -328,18 +330,18 @@ class LinphoneCoreImpl implements LinphoneCore {
if (enablePayloadType(nativePtr,((PayloadTypeImpl)pt).nativePtr,enable) != 0) {
throw new LinphoneCoreException("cannot enable payload type ["+pt+"]");
}
}
public synchronized boolean isPayloadTypeEnabled(PayloadType pt) {
isValid();
return isPayloadTypeEnabled(nativePtr, ((PayloadTypeImpl)pt).nativePtr);
}
public synchronized boolean payloadTypeIsVbr(PayloadType pt) {
isValid();
return payloadTypeIsVbr(nativePtr, ((PayloadTypeImpl)pt).nativePtr);
}
public synchronized void enableEchoCancellation(boolean enable) {
isValid();
enableEchoCancellation(nativePtr, enable);
@ -347,21 +349,21 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized boolean isEchoCancellationEnabled() {
isValid();
return isEchoCancellationEnabled(nativePtr);
}
public synchronized LinphoneCall getCurrentCall() {
isValid();
return (LinphoneCall)getCurrentCall(nativePtr);
}
public int getPlayLevel() {
// TODO Auto-generated method stub
return 0;
}
public void setPlayLevel(int level) {
// TODO Auto-generated method stub
}
private void applyAudioHacks() {
@ -397,20 +399,20 @@ class LinphoneCoreImpl implements LinphoneCore {
}
public synchronized void playDtmf(char number, int duration) {
playDtmf(nativePtr,number, duration);
}
public synchronized void stopDtmf() {
stopDtmf(nativePtr);
}
public synchronized void addFriend(LinphoneFriend lf) throws LinphoneCoreException {
addFriend(nativePtr,((LinphoneFriendImpl)lf).nativePtr);
}
@SuppressWarnings("deprecation")
public synchronized void setPresenceInfo(int minutes_away, String alternative_contact, OnlineStatus status) {
setPresenceInfo(nativePtr,minutes_away,alternative_contact,status.mValue);
}
@SuppressWarnings("deprecation")
public synchronized OnlineStatus getPresenceInfo() {
@ -434,7 +436,7 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized void setDeviceRotation(int rotation) {
setDeviceRotation(nativePtr, rotation);
}
public synchronized void enableVideo(boolean vcap_enabled, boolean display_enabled) {
enableVideo(nativePtr,vcap_enabled, display_enabled);
}
@ -456,15 +458,15 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized void setStunServer(String stunServer) {
setStunServer(nativePtr,stunServer);
}
public synchronized LinphoneCallParams createDefaultCallParameters() {
return new LinphoneCallParamsImpl(createDefaultCallParams(nativePtr));
}
public synchronized LinphoneCall inviteAddressWithParams(LinphoneAddress to, LinphoneCallParams params) throws LinphoneCoreException {
long ptrDestination = ((LinphoneAddressImpl)to).nativePtr;
long ptrParams =((LinphoneCallParamsImpl)params).nativePtr;
LinphoneCall call = (LinphoneCall)inviteAddressWithParams(nativePtr, ptrDestination, ptrParams);
if (call!=null) {
return call;
@ -509,19 +511,19 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized String getRing() {
return getRing(nativePtr);
}
public synchronized void setRootCA(String path) {
setRootCA(nativePtr, path);
}
public synchronized LinphoneProxyConfig[] getProxyConfigList() {
public synchronized LinphoneProxyConfig[] getProxyConfigList() {
return getProxyConfigList(nativePtr);
}
public synchronized PayloadType[] getVideoCodecs() {
long[] typesPtr = listVideoPayloadTypes(nativePtr);
if (typesPtr == null) return null;
PayloadType[] codecs = new PayloadType[typesPtr.length];
for (int i=0; i < codecs.length; i++) {
@ -533,7 +535,7 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized PayloadType[] getAudioCodecs() {
long[] typesPtr = listAudioPayloadTypes(nativePtr);
if (typesPtr == null) return null;
PayloadType[] codecs = new PayloadType[typesPtr.length];
for (int i=0; i < codecs.length; i++) {
@ -545,10 +547,10 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized boolean isNetworkReachable() {
return isNetworkStateReachable(nativePtr);
}
public synchronized void enableKeepAlive(boolean enable) {
enableKeepAlive(nativePtr,enable);
}
public synchronized boolean isKeepAliveEnabled() {
return isKeepAliveEnabled(nativePtr);
@ -556,7 +558,7 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized void startEchoCalibration(Object data) throws LinphoneCoreException {
startEchoCalibration(nativePtr, data);
}
public synchronized Transports getSignalingTransportPorts() {
Transports transports = new Transports();
transports.udp = getSignalingTransportPort(nativePtr, 0);
@ -591,7 +593,7 @@ class LinphoneCoreImpl implements LinphoneCore {
}
public synchronized void setDownloadPtime(int ptime) {
setDownloadPtime(nativePtr,ptime);
}
public synchronized void setUploadPtime(int ptime) {
setUploadPtime(nativePtr,ptime);
@ -614,12 +616,12 @@ class LinphoneCoreImpl implements LinphoneCore {
}
private native void leaveConference(long nativePtr);
private native void leaveConference(long nativePtr);
public synchronized void leaveConference() {
leaveConference(nativePtr);
}
private native boolean enterConference(long nativePtr);
private native boolean enterConference(long nativePtr);
public synchronized boolean enterConference() {
return enterConference(nativePtr);
}
@ -657,12 +659,12 @@ class LinphoneCoreImpl implements LinphoneCore {
private native void addAllToConference(long nativePtr);
public synchronized void addAllToConference() {
addAllToConference(nativePtr);
}
private native void addToConference(long nativePtr, long nativePtrLcall);
public synchronized void addToConference(LinphoneCall call) {
addToConference(nativePtr, getCallPtr(call));
}
private native void removeFromConference(long nativePtr, long nativeCallPtr);
public synchronized void removeFromConference(LinphoneCall call) {
@ -672,7 +674,7 @@ class LinphoneCoreImpl implements LinphoneCore {
private long getCallPtr(LinphoneCall call) {
return ((LinphoneCallImpl)call).nativePtr;
}
private long getCallParamsPtr(LinphoneCallParams callParams) {
return ((LinphoneCallParamsImpl)callParams).nativePtr;
}
@ -700,7 +702,7 @@ class LinphoneCoreImpl implements LinphoneCore {
return isMediaEncryptionMandatory(nativePtr);
}
public synchronized void setMediaEncryption(MediaEncryption menc) {
setMediaEncryption(nativePtr, menc.mValue);
setMediaEncryption(nativePtr, menc.mValue);
}
public synchronized void setMediaEncryptionMandatory(boolean yesno) {
setMediaEncryptionMandatory(nativePtr, yesno);
@ -751,13 +753,13 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized void tunnelAddServerAndMirror(String host, int port, int mirror, int ms) {
tunnelAddServerAndMirror(nativePtr, host, port, mirror, ms);
}
private native void tunnelAddServer(long nativePtr, TunnelConfig config);
@Override
public synchronized void tunnelAddServer(TunnelConfig config) {
tunnelAddServer(nativePtr, config);
}
private native final TunnelConfig[] tunnelGetServers(long nativePtr);
@Override
public synchronized final TunnelConfig[] tunnelGetServers() {
@ -784,7 +786,7 @@ class LinphoneCoreImpl implements LinphoneCore {
@Override
public native boolean isTunnelAvailable();
private native void acceptCallWithParams(long nativePtr, long aCall,
long params);
@Override
@ -792,14 +794,14 @@ class LinphoneCoreImpl implements LinphoneCore {
LinphoneCallParams params) throws LinphoneCoreException {
acceptCallWithParams(nativePtr, getCallPtr(aCall), getCallParamsPtr(params));
}
private native void acceptCallUpdate(long nativePtr, long aCall, long params);
@Override
public synchronized void acceptCallUpdate(LinphoneCall aCall, LinphoneCallParams params)
throws LinphoneCoreException {
acceptCallUpdate(nativePtr, getCallPtr(aCall), getCallParamsPtr(params));
acceptCallUpdate(nativePtr, getCallPtr(aCall), getCallParamsPtr(params));
}
private native void deferCallUpdate(long nativePtr, long aCall);
@Override
public synchronized void deferCallUpdate(LinphoneCall aCall)
@ -807,7 +809,7 @@ class LinphoneCoreImpl implements LinphoneCore {
deferCallUpdate(nativePtr, getCallPtr(aCall));
}
private native void setVideoPolicy(long nativePtr, boolean autoInitiate, boolean autoAccept);
public synchronized void setVideoPolicy(boolean autoInitiate, boolean autoAccept) {
setVideoPolicy(nativePtr, autoInitiate, autoAccept);
@ -820,7 +822,7 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized boolean getVideoAutoAcceptPolicy() {
return getVideoAutoAcceptPolicy(nativePtr);
}
private native void setStaticPicture(long nativePtr, String path);
public synchronized void setStaticPicture(String path) {
setStaticPicture(nativePtr, path);
@ -836,11 +838,11 @@ class LinphoneCoreImpl implements LinphoneCore {
{
setCpuCountNative(count);
}
public synchronized int getMissedCallsCount() {
return getMissedCallsCount(nativePtr);
}
public synchronized void removeCallLog(LinphoneCallLog log) {
removeCallLog(nativePtr, ((LinphoneCallLogImpl) log).getNativePtr());
}
@ -848,7 +850,7 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized void resetMissedCallsCount() {
resetMissedCallsCount(nativePtr);
}
private native void tunnelSetHttpProxy(long nativePtr, String proxy_host, int port,
String username, String password);
@Override
@ -856,12 +858,12 @@ class LinphoneCoreImpl implements LinphoneCore {
String username, String password) {
tunnelSetHttpProxy(nativePtr, proxy_host, port, username, password);
}
private native void refreshRegisters(long nativePtr);
public synchronized void refreshRegisters() {
refreshRegisters(nativePtr);
}
@Override
public String getVersion() {
return getVersion(nativePtr);
@ -878,13 +880,13 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized PayloadType findPayloadType(String mime, int clockRate) {
return findPayloadType(mime, clockRate, FIND_PAYLOAD_IGNORE_CHANNELS);
}
private native void removeFriend(long ptr, long lf);
@Override
public synchronized void removeFriend(LinphoneFriend lf) {
removeFriend(nativePtr, lf.getNativePtr());
}
private native long getFriendByAddress(long ptr, String sipUri);
@Override
public synchronized LinphoneFriend findFriendByAddress(String sipUri) {
@ -894,64 +896,64 @@ class LinphoneCoreImpl implements LinphoneCore {
}
return new LinphoneFriendImpl(ptr);
}
public synchronized void setAudioPort(int port) {
setAudioPort(nativePtr, port);
}
public synchronized void setVideoPort(int port) {
setVideoPort(nativePtr, port);
}
public synchronized void setAudioPortRange(int minPort, int maxPort) {
setAudioPortRange(nativePtr, minPort, maxPort);
}
public synchronized void setVideoPortRange(int minPort, int maxPort) {
setVideoPortRange(nativePtr, minPort, maxPort);
}
public synchronized void setIncomingTimeout(int timeout) {
setIncomingTimeout(nativePtr, timeout);
}
public synchronized void setInCallTimeout(int timeout)
{
setInCallTimeout(nativePtr, timeout);
}
private native void setMicrophoneGain(long ptr, float gain);
public synchronized void setMicrophoneGain(float gain) {
setMicrophoneGain(nativePtr, gain);
}
public synchronized void setPrimaryContact(String displayName, String username) {
setPrimaryContact(nativePtr, displayName, username);
}
public synchronized String getPrimaryContactUsername() {
return getPrimaryContactUsername(nativePtr);
}
public synchronized String getPrimaryContactDisplayName() {
return getPrimaryContactDisplayName(nativePtr);
}
private native void setUseSipInfoForDtmfs(long ptr, boolean use);
public synchronized void setUseSipInfoForDtmfs(boolean use) {
setUseSipInfoForDtmfs(nativePtr, use);
}
private native boolean getUseSipInfoForDtmfs(long ptr);
public synchronized boolean getUseSipInfoForDtmfs() {
return getUseSipInfoForDtmfs(nativePtr);
}
private native void setUseRfc2833ForDtmfs(long ptr, boolean use);
public synchronized void setUseRfc2833ForDtmfs(boolean use) {
setUseRfc2833ForDtmfs(nativePtr, use);
}
private native boolean getUseRfc2833ForDtmfs(long ptr);
public synchronized boolean getUseRfc2833ForDtmfs() {
return getUseRfc2833ForDtmfs(nativePtr);
@ -972,17 +974,17 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized void declineCall(LinphoneCall aCall, Reason reason) {
declineCall(nativePtr,((LinphoneCallImpl)aCall).nativePtr,reason.mValue);
}
private native boolean upnpAvailable(long ptr);
public synchronized boolean upnpAvailable() {
return upnpAvailable(nativePtr);
}
}
private native int getUpnpState(long ptr);
public synchronized UpnpState getUpnpState() {
return UpnpState.fromInt(getUpnpState(nativePtr));
return UpnpState.fromInt(getUpnpState(nativePtr));
}
private native String getUpnpExternalIpaddress(long ptr);
public synchronized String getUpnpExternalIpaddress() {
return getUpnpExternalIpaddress(nativePtr);
@ -992,7 +994,7 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized void startConferenceRecording(String path) {
startConferenceRecording(nativePtr,path);
}
private native int stopConferenceRecording(long nativePtr);
@Override
public synchronized void stopConferenceRecording() {
@ -1002,13 +1004,13 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized PayloadType findPayloadType(String mime) {
return findPayloadType(mime, FIND_PAYLOAD_IGNORE_RATE);
}
private native void setSipDscp(long nativePtr, int dscp);
@Override
public synchronized void setSipDscp(int dscp) {
setSipDscp(nativePtr,dscp);
}
private native int getSipDscp(long nativePtr);
@Override
public synchronized int getSipDscp() {
@ -1019,36 +1021,36 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized void setAudioDscp(int dscp) {
setAudioDscp(nativePtr, dscp);
}
private native int getAudioDscp(long nativePtr);
@Override
public synchronized int getAudioDscp() {
return getAudioDscp(nativePtr);
}
private native void setVideoDscp(long nativePtr, int dscp);
@Override
public synchronized void setVideoDscp(int dscp) {
setVideoDscp(nativePtr,dscp);
}
private native int getVideoDscp(long nativePtr);
@Override
public synchronized int getVideoDscp() {
return getVideoDscp(nativePtr);
}
private native long createInfoMessage(long nativeptr);
@Override
public synchronized LinphoneInfoMessage createInfoMessage() {
return new LinphoneInfoMessageImpl(createInfoMessage(nativePtr));
}
private native Object subscribe(long coreptr, long addrptr, String eventname, int expires, String type, String subtype, byte data [], String encoding);
@Override
public synchronized LinphoneEvent subscribe(LinphoneAddress resource, String eventname,
int expires, LinphoneContent content) {
return (LinphoneEvent)subscribe(nativePtr, ((LinphoneAddressImpl)resource).nativePtr, eventname, expires,
return (LinphoneEvent)subscribe(nativePtr, ((LinphoneAddressImpl)resource).nativePtr, eventname, expires,
content!=null ? content.getType() : null, content!=null ? content.getSubtype() : null, content!=null ? content.getData() : null,
content!=null ? content.getEncoding() : null);
}
@ -1056,7 +1058,7 @@ class LinphoneCoreImpl implements LinphoneCore {
@Override
public synchronized LinphoneEvent publish(LinphoneAddress resource, String eventname,
int expires, LinphoneContent content) {
return (LinphoneEvent)publish(nativePtr, ((LinphoneAddressImpl)resource).nativePtr, eventname, expires,
return (LinphoneEvent)publish(nativePtr, ((LinphoneAddressImpl)resource).nativePtr, eventname, expires,
content!=null ? content.getType() : null, content!=null ? content.getSubtype() : null, content!=null ? content.getData() : null,
content!=null ? content.getEncoding() : null);
}
@ -1073,15 +1075,15 @@ class LinphoneCoreImpl implements LinphoneCore {
String event, int expires) {
return (LinphoneEvent)createPublish(nativePtr, ((LinphoneAddressImpl)resource).nativePtr, event, expires);
}
public synchronized void setChatDatabasePath(String path) {
setChatDatabasePath(nativePtr, path);
}
public synchronized LinphoneChatRoom[] getChatRooms() {
long[] typesPtr = getChatRooms(nativePtr);
if (typesPtr == null) return null;
LinphoneChatRoom[] proxies = new LinphoneChatRoom[typesPtr.length];
for (int i=0; i < proxies.length; i++) {
@ -1093,7 +1095,7 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized LinphoneAuthInfo[] getAuthInfosList() {
long[] typesPtr = getAuthInfosList(nativePtr);
if (typesPtr == null) return null;
LinphoneAuthInfo[] authInfos = new LinphoneAuthInfo[typesPtr.length];
for (int i=0; i < authInfos.length; i++) {
@ -1102,12 +1104,12 @@ class LinphoneCoreImpl implements LinphoneCore {
return authInfos;
}
public synchronized LinphoneAuthInfo findAuthInfo(String username, String realm, String domain) {
long ptr = findAuthInfos(nativePtr, username, realm, domain);
if (ptr == 0)
return null;
return new LinphoneAuthInfoImpl(ptr);
}
private native LinphoneCall startReferedCall(long corePtr, long callptr, long paramsPtr);
@ -1117,7 +1119,7 @@ class LinphoneCoreImpl implements LinphoneCore {
long ptrParams =((LinphoneCallParamsImpl)params).nativePtr;
return startReferedCall(nativePtr, getCallPtr(call), ptrParams);
}
private native String[] listSupportedVideoResolutions(long ptr);
@Override
public synchronized String[] getSupportedVideoSizes() {
@ -1128,13 +1130,13 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized int migrateToMultiTransport() {
return migrateToMultiTransport(nativePtr);
}
private native boolean acceptEarlyMedia(long lc, long call);
@Override
public synchronized boolean acceptEarlyMedia(LinphoneCall call) {
return acceptEarlyMedia(nativePtr, getCallPtr(call));
}
private native boolean acceptEarlyMediaWithParams(long lc, long call, long params);
@Override
public synchronized boolean acceptEarlyMediaWithParams(LinphoneCall call,
@ -1197,7 +1199,7 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized boolean chatEnabled() {
return chatEnabled(nativePtr);
}
@Override
public synchronized void stopRinging() {
stopRinging(nativePtr);
@ -1215,13 +1217,20 @@ class LinphoneCoreImpl implements LinphoneCore {
@Override
public synchronized void enableAdaptiveRateControl(boolean enable) {
enableAdaptiveRateControl(nativePtr,enable);
}
@Override
public synchronized boolean isAdaptiveRateControlEnabled() {
return isAdaptiveRateControlEnabled(nativePtr);
}
public synchronized getAdaptiveRateAlgorithm() {
return AdaptiveRateAlgorithm.fromInt(getAdaptiveRateAlgorithm(nativePtr));
}
public synchronized void setAdaptiveRateAlgorithm(AdaptiveRateAlgorithm alg) {
setAdaptiveRateAlgorithm(nativePtr, alg.mValue);
}
private native void setAudioJittcomp(long ptr, int value);
@Override
public synchronized void setAudioJittcomp(int value) {
@ -1232,5 +1241,5 @@ class LinphoneCoreImpl implements LinphoneCore {
public synchronized void setVideoJittcomp(int value) {
setVideoJittcomp(nativePtr,value);
}
}

@ -1 +1 @@
Subproject commit b3578c1cc5861e137bf058584f2bc715d19ca405
Subproject commit 322600a869cc9b82927238a2d2fb87c11a73c5cc