Commit 1de0c3be authored by Margaux Clerc's avatar Margaux Clerc
Browse files

Fix automatically accept video call

parent a857dba2
...@@ -54,7 +54,6 @@ namespace Linphone.Controls ...@@ -54,7 +54,6 @@ namespace Linphone.Controls
{ {
InitializeComponent(); InitializeComponent();
microphone.IsChecked = LinphoneManager.Instance.Core.IsMicEnabled; microphone.IsChecked = LinphoneManager.Instance.Core.IsMicEnabled;
video.IsEnabled = LinphoneManager.Instance.IsVideoAvailable;
camera.IsEnabled = LinphoneManager.Instance.IsVideoAvailable && LinphoneManager.Instance.NumberOfCameras > 1; camera.IsEnabled = LinphoneManager.Instance.IsVideoAvailable && LinphoneManager.Instance.NumberOfCameras > 1;
} }
......
...@@ -543,6 +543,7 @@ namespace Linphone.Model ...@@ -543,6 +543,7 @@ namespace Linphone.Model
{ {
Core.VideoDevice = frontCamera; Core.VideoDevice = frontCamera;
} }
if (Core.IsInCall) if (Core.IsInCall)
{ {
Call call = Core.CurrentCall; Call call = Core.CurrentCall;
...@@ -627,7 +628,14 @@ namespace Linphone.Model ...@@ -627,7 +628,14 @@ namespace Linphone.Model
else if (state == CallState.UpdatedByRemote) else if (state == CallState.UpdatedByRemote)
{ {
Core.DeferCallUpdate(call); bool remoteVideo = call.RemoteParams.IsVideoEnabled;
bool localVideo = call.CurrentParams.Copy().IsVideoEnabled;
bool autoAcceptCameraPolicy = Core.VideoPolicy.AutomaticallyAccept;
if (remoteVideo && !localVideo && !autoAcceptCameraPolicy)
{
Core.DeferCallUpdate(call);
}
#pragma warning disable CS4014 // Dans la mesure où cet appel n'est pas attendu, l'exécution de la méthode actuelle continue avant la fin de l'appel #pragma warning disable CS4014 // Dans la mesure où cet appel n'est pas attendu, l'exécution de la méthode actuelle continue avant la fin de l'appel
CoreDispatcher.RunAsync(CoreDispatcherPriority.Normal, () => CoreDispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{ {
......
...@@ -195,6 +195,7 @@ namespace Linphone.Views ...@@ -195,6 +195,7 @@ namespace Linphone.Views
oneSecondTimer.Start(); oneSecondTimer.Start();
statusIcon.Visibility = Visibility.Visible; statusIcon.Visibility = Visibility.Visible;
buttons.enabledVideo(false);
} }
if (state == CallState.StreamsRunning) if (state == CallState.StreamsRunning)
{ {
...@@ -256,7 +257,7 @@ namespace Linphone.Views ...@@ -256,7 +257,7 @@ namespace Linphone.Views
if (remoteVideo && !localVideo && !autoAcceptCameraPolicy) if (remoteVideo && !localVideo && !autoAcceptCameraPolicy)
{ {
AskVideoPopup(call); AskVideoPopup(call);
} }
} }
} }
refreshUI(); refreshUI();
...@@ -269,7 +270,7 @@ namespace Linphone.Views ...@@ -269,7 +270,7 @@ namespace Linphone.Views
buttons.enabledVideo(false); buttons.enabledVideo(false);
} }
else { else {
if (LinphoneManager.Instance.Core.CurrentCall.CurrentParams.IsVideoEnabled) if (LinphoneManager.Instance.Core.CurrentCall != null && LinphoneManager.Instance.Core.CurrentCall.CurrentParams.IsVideoEnabled)
{ {
buttons.checkedVideo(true); buttons.checkedVideo(true);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment