private void timerQuality_Elapsed(object sender, ElapsedEventArgs e)
{
try
{
if (this.Dispatcher.Thread != System.Threading.Thread.CurrentThread)
{
this.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal,
new EventHandler<ElapsedEventArgs>(this.timerQuality_Elapsed), sender, new object[] { e });
return;
}
if (this.AVSession != null && this.AVSession.IsActive)
{
QoS qos = this.AVSession.GetVideoQualityInfo();
if (qos != null)
{
this.labelQuality.Content = string.Format("Quality: {0}%", (uint)(qos.getQavg() * 100));
if (this.qosWindow != null && this.qosWindow.IsVisible)
{
this.qosWindow.Info = qos;
}
}
}
}
catch (Exception ex)
{
LOG.Error(ex);
}
}