private async void OnVideoFrame(VideoFrame frame)
{
if (frame?.Data != null && frame.Data.Length > 0)
{
try
{
var randomAccessStream = await ConvertTo(frame.Data);
await Core.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
var bitmapImage = new BitmapImage();
bitmapImage.SetSource(randomAccessStream);
ImageViewSource = bitmapImage;
});
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}
}
}
Line 23 throws the following exception after a while:
System.Runtime.InteropServices.SEHException: ‘External component has thrown an exception.’