예제 #1
0
        public void Shutdown()
        {
            logger.Debug("DeckLinkDeviceManager::Shutdown()");

            Started = false;

            if (deckLinkDiscovery != null)
            {
                deckLinkDiscovery.UninstallDeviceNotifications();

                var refCount = Marshal.ReleaseComObject(deckLinkDiscovery);

                Debug.Assert(refCount == 0, "refCount == 0");
                deckLinkDiscovery = null;
            }

            if (inputDevices.Count > 0)
            {
                for (int i = 0; i < inputDevices.Count; i++)
                {
                    var inputDevice = inputDevices[i];
                    if (inputDevice != null)
                    {
                        inputDevice.Dispose();
                        inputDevice = null;
                    }
                }
            }
        }
예제 #2
0
        public bool Startup()
        {
            logger.Debug("DeckLinkDeviceManager::Startup()");

            if (Started)
            {
                Debug.Assert(deckLinkDiscovery != null, "deckLinkDiscovery!=null");

                return(Started);
            }

            try
            {
                deckLinkDiscovery = new CDeckLinkDiscovery();
                deckLinkDiscovery.InstallDeviceNotifications(this);

                Started = true;
            }
            catch (Exception ex)
            {
                logger.Error(ex);

                Started = false;
            }

            return(Started);
        }
예제 #3
0
        public Form1()
        {
            InitializeComponent();

            _Discovery = new CDeckLinkDiscovery();
            _GLHelper  = new CDeckLinkGLScreenPreviewHelper();

            if (_Discovery != null)
            {
                _Discovery.InstallDeviceNotifications(this);
            }

            find.Enabled       = false;
            stream.Enabled     = false;
            notifications.Text = "Please wait 2 seconds for the preview box to initialise...";

            _GLHack.Interval  = TimeSpan.FromSeconds(2).TotalMilliseconds;
            _GLHack.Elapsed  += DelayedLoad;
            _GLHack.AutoReset = false;
        }
예제 #4
0
 public DeckLinkDeviceDiscovery()
 {
     m_deckLinkDiscovery = new CDeckLinkDiscovery();
 }
예제 #5
0
 public DeckLinkDeviceDiscovery(IObserver <IDeckLink> observer)
 {
     Observer          = observer;
     DeckLinkDiscovery = new CDeckLinkDiscovery();
     DeckLinkDiscovery.InstallDeviceNotifications(this);
 }