Esempio n. 1
0
 private void OpenLiveviewConnection(string url)
 {
     if (lvp != null && lvp.IsOpen)
     {
         lvp.CloseConnection();
     }
     lvp = new LvStreamProcessor();
     lvp.OpenConnection(url, OnJpeg, () =>
     {
         Debug.WriteLine("LiveviewStream closed");
         data.add("LiveviewStream closed");
     });
 }
Esempio n. 2
0
        private void OpenLiveviewConnection()
        {
            AppStatus.GetInstance().IsTryingToConnectLiveview = true;
            client.StartLiveview((code) =>
            {
                AppStatus.GetInstance().IsTryingToConnectLiveview = false;
            }, (url) =>
            {
                if (lvProcessor != null && lvProcessor.IsOpen)
                {
                    Debug.WriteLine("Close previous LVProcessor");
                    CloseLiveviewConnection();
                }

                lvProcessor = new LvStreamProcessor();
                try
                {
                    lvProcessor.OpenConnection(url, OnJpegRetrieved, () =>
                    {
                        AppStatus.GetInstance().IsTryingToConnectLiveview = false;
                    });
                }
                catch (InvalidOperationException)
                {
                    return;
                }
            });
        }