From 6b1fc72b5e46825e110af8d692f5c97626641e7a Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 22 Mar 2017 21:36:34 +0100 Subject: [PATCH] Fix problem where AVPF is disabled by a video reINVITE, due to the use of LinphoneCall.getCurrentParamsCopy() instead of LinphoneCore.createCallParams(). --- src/org/linphone/CallActivity.java | 12 ++++++------ src/org/linphone/CallManager.java | 6 +++--- src/org/linphone/LinphoneActivity.java | 2 +- src/org/linphone/LinphoneManager.java | 2 +- src/org/linphone/LinphoneService.java | 4 ++-- src/org/linphone/StatusFragment.java | 4 ++-- src/org/linphone/ui/LinphoneOverlay.java | 2 +- submodules/bcg729 | 2 +- submodules/linphone | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/org/linphone/CallActivity.java b/src/org/linphone/CallActivity.java index 9c530ec69..6876d9256 100644 --- a/src/org/linphone/CallActivity.java +++ b/src/org/linphone/CallActivity.java @@ -208,7 +208,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList } else if (state == State.Resuming) { if(LinphonePreferences.instance().isVideoEnabled()){ status.refreshStatusItems(call, isVideoEnabled(call)); - if(call.getCurrentParamsCopy().getVideoEnabled()){ + if(call.getCurrentParams().getVideoEnabled()){ showVideoView(); } } @@ -231,7 +231,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList } boolean remoteVideo = call.getRemoteParams().getVideoEnabled(); - boolean localVideo = call.getCurrentParamsCopy().getVideoEnabled(); + boolean localVideo = call.getCurrentParams().getVideoEnabled(); boolean autoAcceptCameraPolicy = LinphonePreferences.instance().shouldAutomaticallyAcceptVideoRequests(); if (remoteVideo && !localVideo && !autoAcceptCameraPolicy && !LinphoneManager.getLc().isInConference()) { showAcceptCallUpdateDialog(); @@ -254,10 +254,10 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList @Override public void callEncryptionChanged(LinphoneCore lc, final LinphoneCall call, boolean encrypted, String authenticationToken) { if (status != null) { - if(call.getCurrentParamsCopy().getMediaEncryption().equals(LinphoneCore.MediaEncryption.ZRTP) && !call.isAuthenticationTokenVerified()){ + if(call.getCurrentParams().getMediaEncryption().equals(LinphoneCore.MediaEncryption.ZRTP) && !call.isAuthenticationTokenVerified()){ status.showZRTPDialog(call); } - status.refreshStatusItems(call, call.getCurrentParamsCopy().getVideoEnabled()); + status.refreshStatusItems(call, call.getCurrentParams().getVideoEnabled()); } } @@ -329,7 +329,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList private boolean isVideoEnabled(LinphoneCall call) { if(call != null){ - return call.getCurrentParamsCopy().getVideoEnabled(); + return call.getCurrentParams().getVideoEnabled(); } return false; } @@ -1759,7 +1759,7 @@ public class CallActivity extends LinphoneGenericActivity implements OnClickList if (LinphoneManager.getLcIfManagerNotDestroyedOrNull() == null) return; synchronized(LinphoneManager.getLc()) { if (LinphoneActivity.isInstanciated()) { - LinphoneCallParams params = call.getCurrentParamsCopy(); + LinphoneCallParams params = call.getCurrentParams(); if (params != null) { LinphoneCallStats audioStats = call.getAudioStats(); LinphoneCallStats videoStats = null; diff --git a/src/org/linphone/CallManager.java b/src/org/linphone/CallManager.java index 480aec8bc..f095cb9d3 100644 --- a/src/org/linphone/CallManager.java +++ b/src/org/linphone/CallManager.java @@ -85,7 +85,7 @@ public class CallManager { Log.e("Trying to reinviteWithVideo while not in call: doing nothing"); return false; } - LinphoneCallParams params = lCall.getCurrentParamsCopy(); + LinphoneCallParams params = lc.createCallParams(lCall); if (params.getVideoEnabled()) return false; @@ -115,7 +115,7 @@ public class CallManager { Log.e("Trying to reinvite while not in call: doing nothing"); return; } - LinphoneCallParams params = lCall.getCurrentParamsCopy(); + LinphoneCallParams params = lc.createCallParams(lCall); bm().updateWithProfileSettings(lc, params); lc.updateCall(lCall, params); } @@ -132,7 +132,7 @@ public class CallManager { Log.e("Trying to updateCall while not in call: doing nothing"); return; } - LinphoneCallParams params = lCall.getCurrentParamsCopy(); + LinphoneCallParams params = lc.createCallParams(lCall); bm().updateWithProfileSettings(lc, params); lc.updateCall(lCall, null); } diff --git a/src/org/linphone/LinphoneActivity.java b/src/org/linphone/LinphoneActivity.java index 3341838db..a353358e9 100644 --- a/src/org/linphone/LinphoneActivity.java +++ b/src/org/linphone/LinphoneActivity.java @@ -1012,7 +1012,7 @@ public class LinphoneActivity extends LinphoneGenericActivity implements OnClick if (lc != null) { lc.setDeviceRotation(rotation); LinphoneCall currentCall = lc.getCurrentCall(); - if (currentCall != null && currentCall.cameraEnabled() && currentCall.getCurrentParamsCopy().getVideoEnabled()) { + if (currentCall != null && currentCall.cameraEnabled() && currentCall.getCurrentParams().getVideoEnabled()) { lc.updateCall(currentCall, null); } } diff --git a/src/org/linphone/LinphoneManager.java b/src/org/linphone/LinphoneManager.java index bc96fb0a4..296dfcbf8 100644 --- a/src/org/linphone/LinphoneManager.java +++ b/src/org/linphone/LinphoneManager.java @@ -1257,7 +1257,7 @@ public class LinphoneManager implements LinphoneCoreListener, LinphoneChatMessag if (state == State.CallUpdatedByRemote) { // If the correspondent proposes video while audio call boolean remoteVideo = call.getRemoteParams().getVideoEnabled(); - boolean localVideo = call.getCurrentParamsCopy().getVideoEnabled(); + boolean localVideo = call.getCurrentParams().getVideoEnabled(); boolean autoAcceptCameraPolicy = LinphonePreferences.instance().shouldAutomaticallyAcceptVideoRequests(); if (remoteVideo && !localVideo && !autoAcceptCameraPolicy && !LinphoneManager.getLc().isInConference()) { try { diff --git a/src/org/linphone/LinphoneService.java b/src/org/linphone/LinphoneService.java index d105d885f..fce042048 100644 --- a/src/org/linphone/LinphoneService.java +++ b/src/org/linphone/LinphoneService.java @@ -459,7 +459,7 @@ public final class LinphoneService extends Service { if (mOverlay != null) destroyOverlay(); LinphoneCall call = LinphoneManager.getLc().getCurrentCall(); - if (call == null || !call.getCurrentParamsCopy().getVideoEnabled()) return; + if (call == null || !call.getCurrentParams().getVideoEnabled()) return; mOverlay = new LinphoneOverlay(this); WindowManager.LayoutParams params = mOverlay.getWindowManagerLayoutParams(); @@ -533,7 +533,7 @@ public final class LinphoneService extends Service { public void refreshIncallIcon(LinphoneCall currentCall) { LinphoneCore lc = LinphoneManager.getLc(); if (currentCall != null) { - if (currentCall.getCurrentParamsCopy().getVideoEnabled() && currentCall.cameraEnabled()) { + if (currentCall.getCurrentParams().getVideoEnabled() && currentCall.cameraEnabled()) { // checking first current params is mandatory setIncallIcon(IncallIconState.VIDEO); } else { diff --git a/src/org/linphone/StatusFragment.java b/src/org/linphone/StatusFragment.java index c5061440e..079597167 100644 --- a/src/org/linphone/StatusFragment.java +++ b/src/org/linphone/StatusFragment.java @@ -312,7 +312,7 @@ public class StatusFragment extends Fragment { if (isInCall && (call != null || lc.getConferenceSize() > 1 || lc.getCallsNb() > 0)) { if (call != null) { startCallQuality(); - refreshStatusItems(call, call.getCurrentParamsCopy().getVideoEnabled()); + refreshStatusItems(call, call.getCurrentParams().getVideoEnabled()); } menu.setVisibility(View.INVISIBLE); encryption.setVisibility(View.VISIBLE); @@ -351,7 +351,7 @@ public class StatusFragment extends Fragment { public void refreshStatusItems(final LinphoneCall call, boolean isVideoEnabled) { if (call != null) { voicemailCount.setVisibility(View.GONE); - MediaEncryption mediaEncryption = call.getCurrentParamsCopy().getMediaEncryption(); + MediaEncryption mediaEncryption = call.getCurrentParams().getMediaEncryption(); if (isVideoEnabled) { //background.setVisibility(View.GONE); diff --git a/src/org/linphone/ui/LinphoneOverlay.java b/src/org/linphone/ui/LinphoneOverlay.java index e4b2fd7f6..b7a30af32 100644 --- a/src/org/linphone/ui/LinphoneOverlay.java +++ b/src/org/linphone/ui/LinphoneOverlay.java @@ -59,7 +59,7 @@ public class LinphoneOverlay extends org.linphone.mediastream.video.display.GL2J }); LinphoneCall call = LinphoneManager.getLc().getCurrentCall(); - LinphoneCallParams callParams = call.getCurrentParamsCopy(); + LinphoneCallParams callParams = call.getCurrentParams(); params.width = callParams.getReceivedVideoSize().width; params.height = callParams.getReceivedVideoSize().height; LinphoneManager.getLc().setVideoWindow(androidVideoWindowImpl); diff --git a/submodules/bcg729 b/submodules/bcg729 index 1e684cd9a..9b07c787f 160000 --- a/submodules/bcg729 +++ b/submodules/bcg729 @@ -1 +1 @@ -Subproject commit 1e684cd9a7440c0ddb5cdc8b8c9b80ab8733c2ce +Subproject commit 9b07c787fdc60463e5746a4f4f8530d40f2eb53c diff --git a/submodules/linphone b/submodules/linphone index f74e37bec..c1434a3f7 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit f74e37becfc6377bd7124b72aca129310dff8e15 +Subproject commit c1434a3f7c029fb69f557fca2b5fa1682786da5f