Hack to fix preview issue after call paused

This commit is contained in:
Sylvain Berfini 2012-04-20 13:15:32 +02:00
parent 9aee2dd375
commit 0245c56776
3 changed files with 6 additions and 7 deletions

View file

@ -353,11 +353,6 @@ public class IncallActivity extends AbstractCalleesActivity implements
List<LinphoneCall> pausedCalls = LinphoneUtils.getCallsInState(lc(), Arrays.asList(State.Paused)); List<LinphoneCall> pausedCalls = LinphoneUtils.getCallsInState(lc(), Arrays.asList(State.Paused));
if (pausedCalls.size() == 1) { if (pausedCalls.size() == 1) {
LinphoneCall callToResume = pausedCalls.get(0); LinphoneCall callToResume = pausedCalls.get(0);
if (callToResume != null && callToResume.cameraEnabled() && callToResume.getCurrentParamsCopy().getVideoEnabled())
{
finish();
LinphoneActivity.instance().startVideoActivity(callToResume, 0);
}
lc().resumeCall(callToResume); lc().resumeCall(callToResume);
} }
} }

View file

@ -486,7 +486,7 @@ public class LinphoneActivity extends TabActivity implements ContactPicked
if (state == LinphoneCall.State.StreamsRunning && Version.isVideoCapable() && !call.isInConference()) { if (state == LinphoneCall.State.StreamsRunning && Version.isVideoCapable() && !call.isInConference()) {
// call.cameraEnabled() contains the wish of the user // call.cameraEnabled() contains the wish of the user
// set in LinphoneManager#onCallStateChanged(OutgoingInit||IncomingReceived) // set in LinphoneManager#onCallStateChanged(OutgoingInit||IncomingReceived)
boolean videoEnabled = call.cameraEnabled() && call.getCurrentParamsCopy().getVideoEnabled(); boolean videoEnabled = call.getCurrentParamsCopy().getVideoEnabled();
if (videoEnabled) { if (videoEnabled) {
finishActivity(incall_activity); finishActivity(incall_activity);
startVideoActivity(call, 0); startVideoActivity(call, 0);

View file

@ -181,6 +181,10 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
} }
} }
// Hack to force the redraw of the preview
// Camera will be re-enabled in onResume just after anyway
shouldRestartVideoOnResume = true;
LinphoneManager.getLc().getCurrentCall().enableCamera(false);
} }
void updateQualityOfSignalIcon(float quality) void updateQualityOfSignalIcon(float quality)
@ -288,7 +292,6 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
// Send NoWebcam since Android 4.0 can't get the video from the webcam if the activity is not in foreground // Send NoWebcam since Android 4.0 can't get the video from the webcam if the activity is not in foreground
shouldRestartVideoOnResume = true; shouldRestartVideoOnResume = true;
LinphoneManager.getLc().getCurrentCall().enableCamera(false); LinphoneManager.getLc().getCurrentCall().enableCamera(false);
} }
launched=false; launched=false;
synchronized (androidVideoWindowImpl) { synchronized (androidVideoWindowImpl) {
@ -436,5 +439,6 @@ public class VideoCallActivity extends Activity implements LinphoneOnCallStateCh
} else { } else {
LinphoneManager.getLc().terminateAllCalls(); LinphoneManager.getLc().terminateAllCalls();
} }
finish();
} }
} }