Fix problem where AVPF is disabled by a video reINVITE, due to the use of LinphoneCall.getCurrentParamsCopy() instead of LinphoneCore.createCallParams().

This commit is contained in:
Simon Morlat 2017-03-22 21:36:34 +01:00
parent 789291dae6
commit 6b1fc72b5e
9 changed files with 18 additions and 18 deletions

View file

@ -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;

View file

@ -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);
}

View file

@ -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);
}
}

View file

@ -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 {

View file

@ -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 {

View file

@ -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);

View file

@ -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);

@ -1 +1 @@
Subproject commit 1e684cd9a7440c0ddb5cdc8b8c9b80ab8733c2ce
Subproject commit 9b07c787fdc60463e5746a4f4f8530d40f2eb53c

@ -1 +1 @@
Subproject commit f74e37becfc6377bd7124b72aca129310dff8e15
Subproject commit c1434a3f7c029fb69f557fca2b5fa1682786da5f