예제 #1
0
        void pollingTimer_Tick(object sender)
        {
            if (Dispatcher != null)
            {
                // these metrics need to get polled from the UI thread.
#if SILVERLIGHT
                Dispatcher.BeginInvoke(PollUIThreadLogs);
#else
                var t = Dispatcher.RunAsync(CoreDispatcherPriority.Normal, PollUIThreadLogs);
#endif
            }
            else
            {
                PollUIThreadLogs();
            }

            // get adaptive heuristics data on a background thread
            if (AdaptiveMonitor != null)
            {
                AdaptiveMonitor.Refresh();
                AddLog(new BufferSizeLog(AdaptiveMonitor.VideoBufferSize, "video"));
                AddLog(new BufferSizeLog(AdaptiveMonitor.AudioBufferSize, "audio"));
                AddLog(new PerceivedBandwidthLog(AdaptiveMonitor.PerceivedBandwidth));
            }
        }
 public void Dispose()
 {
     Manager.OpenedBackground -= Manager_Opened;
     Manager.ClosedBackground -= Manager_Closed;
     Manager.RefreshingState -= Manager_RefreshingState;
     Manager = null;
     adaptiveMonitor = null;
 }
 public AdaptiveMonitorFactory(AdaptiveStreamingManager manager)
 {
     Manager = manager;
     adaptiveMonitor = new AdaptiveMonitor();
     manager.OpenedBackground += Manager_Opened;
     manager.ClosedBackground += Manager_Closed;
     manager.RefreshingState += Manager_RefreshingState;
 }