Пример #1
0
        public static void DownloadGStreamer(Action <int, string> status = null)
        {
            var output = Settings.GetDataDirectory() + "gstreamer-1.0-x86_64-1.12.4.zip";

            status?.Invoke(0, "Downloading..");

            try
            {
                Download.ParallelDownloadFile(
                    "http://firmware.ardupilot.org/MissionPlanner/gstreamer/gstreamer-1.0-x86_64-1.12.4.zip",
                    output, status: status);

                status?.Invoke(50, "Extracting..");
                ZipFile.ExtractToDirectory(output, Settings.GetDataDirectory());
                status?.Invoke(100, "Done.");
            }
            catch (WebException ex)
            {
                status?.Invoke(-1, "Error downloading file " + ex.ToString());
                try
                {
                    if (File.Exists(output))
                    {
                        File.Delete(output);
                    }
                }
                catch
                {
                }
            }
        }
Пример #2
0
        private static void clientdata(IAsyncResult ar)
        {
            var client = ((UdpClient)ar.AsyncState);

            if (client == null || client.Client == null)
            {
                return;
            }

            var port = ((IPEndPoint)client.Client.LocalEndPoint).Port;

            if (client != null)
            {
                client.Close();
            }

            if (!File.Exists(GStreamer.gstlaunch))
            {
                var gstpath = GStreamer.LookForGstreamer();

                if (File.Exists(gstpath))
                {
                    GStreamer.gstlaunch = gstpath;
                }
                else
                {
                    if (CustomMessageBox.Show("A video stream has been detected, but gstreamer has not been configured/installed.\nDo you want to install/config it now? It will download in the background.", "GStreamer", System.Windows.Forms.MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes)
                    {
                        //CustomMessageBox.Show("Please download gstreamer 1.9.2 from [link;HERE;https://gstreamer.freedesktop.org/data/pkg/windows/1.9.2/gstreamer-1.0-x86-1.9.2.msi]\n And install it using the 'COMPLETE' option");

                        var output = Settings.GetDataDirectory() + "gstreamer-1.0-x86-1.9.2.zip";

                        Download.ParallelDownloadFile(
                            "http://firmware.ardupilot.org/MissionPlanner/gstreamer/gstreamer-1.0-x86-1.9.2.zip",
                            output);

                        ZipArchive zip = new ZipArchive(File.OpenRead(output));

                        zip.ExtractToDirectory(Settings.GetDataDirectory());

                        zip.Dispose();

                        GStreamer.gstlaunch = GStreamer.LookForGstreamer();
                        if (!File.Exists(GStreamer.gstlaunch))
                        {
                            return;
                        }
                    }
                    else
                    {
                        return;
                    }
                }
            }

            GStreamer.UdpPort = port;
            gst = GStreamer.Start();
        }
Пример #3
0
        public static void DownloadGStreamer(Action <int, string> status = null)
        {
            var output = Settings.GetDataDirectory() + "gstreamer-1.0-x86_64-1.12.4.zip";

            status?.Invoke(0, "Downloading..");

            Download.ParallelDownloadFile(
                "http://firmware.ardupilot.org/MissionPlanner/gstreamer/gstreamer-1.0-x86_64-1.12.4.zip",
                output, status: status);

            status?.Invoke(50, "Extracting..");
            ZipFile.ExtractToDirectory(output, Settings.GetDataDirectory());
            status?.Invoke(100, "Done.");
        }
Пример #4
0
        public static void DownloadGStreamer()
        {
            var output = Settings.GetDataDirectory() + "gstreamer-1.0-x86-1.9.2.zip";

            Download.ParallelDownloadFile(
                "http://firmware.ardupilot.org/MissionPlanner/gstreamer/gstreamer-1.0-x86-1.9.2.zip",
                output);

            ZipArchive zip = new ZipArchive(File.OpenRead(output));

            zip.ExtractToDirectory(Settings.GetDataDirectory());

            zip.Dispose();
        }