Commit 900f53fb authored by Ghislain MARY's avatar Ghislain MARY

Detect default camera at liblinphone initialization.

parent ec8346b6
......@@ -11,6 +11,7 @@ using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Threading;
using System.Xml.Linq;
using Windows.Phone.Media.Capture;
using Windows.Phone.Media.Devices;
using Windows.Phone.Networking.Voip;
......@@ -274,6 +275,31 @@ namespace Linphone.Model
LinphoneCore.GetDefaultProxyConfig().SetContactParameters("app-id=" + host + ";pn-type=wp;pn-tok=" + token + ";pn-msg-str=IM_MSG;pn-call-str=IC_MSG;pn-call-snd=ring.caf;pn-msg-snd=msg.caf");
}
if (LinphoneCore.IsVideoSupported())
{
String frontCamera = null;
String backCamera = null;
foreach (String device in LinphoneCore.GetVideoDevices())
{
if (device.EndsWith(CameraSensorLocation.Front.ToString()))
{
frontCamera = device;
}
else if (device.EndsWith(CameraSensorLocation.Back.ToString()))
{
backCamera = device;
}
}
if (frontCamera != null)
{
LinphoneCore.SetVideoDevice(frontCamera);
}
else if (backCamera != null)
{
LinphoneCore.SetVideoDevice(backCamera);
}
}
lastNetworkState = DeviceNetworkInformation.IsNetworkAvailable;
LinphoneCore.SetNetworkReachable(lastNetworkState);
DeviceNetworkInformation.NetworkAvailabilityChanged += new EventHandler<NetworkNotificationEventArgs>(OnNetworkStatusChanged);
......
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