protected override void CloseInternal()
 {
     lock (_locker)
     {
         _streamer?.StopStreaming();
         _streamer = null;
         base.CloseInternal();
     }
 }
Пример #2
0
 private void Window_Initialized(object sender, EventArgs e)
 {
     LogWriter.CurrentWriter.List.CollectionChanged += List_CollectionChanged;
     _streamer                  = new LocalStreamer(this.Dispatcher);
     _recorder                  = new LocalRecorder(this.Dispatcher);
     _streamer.Stopped         += _streamer_Stopped;
     this.DataContext           = _streamer;
     groupBoxRecord.DataContext = _recorder;
     listDevices.ItemsSource    = Decklink.Manager.Devices;
 }
 private void InitStreaming()
 {
     lock (_locker)
     {
         try
         {
             _streamer?.StopStreaming();
             wfControl.BeginInvoke(new Action(() =>
             {
                 var size  = Utils.TransformToPixels(this, new System.Windows.Size(Width, Height));
                 _streamer = new LocalStreamer(_deviceIndex, wfControl.Handle, _source.SelectedEnum, CAPTURETYPE.CAPTURETYPE_ALL, (uint)size.Width, (uint)size.Height, _resolution.SelectedEnum, _format.SelectedEnum);
                 _streamer.StartStreaming();
             }));
         }
         catch
         {
             throw;
         }
     }
 }