コード例 #1
0
        private void but8_Click(object sender, EventArgs e)
        {
            GStreamer.StopAll();

            string ipaddr = "192.168.43.1";

            if (Settings.Instance["herelinkip"] != null)
            {
                ipaddr = Settings.Instance["herelinkip"].ToString();
            }

            InputBox.Show("herelink ip", "Enter herelink ip address", ref ipaddr);

            Settings.Instance["herelinkip"] = ipaddr;

            string url = String.Format(
                "rtspsrc location=rtsp://{0}:8554/fpv_stream1 latency=1 udp-reconnect=1 timeout=0 do-retransmission=false ! application/x-rtp ! decodebin3 ! queue max-size-buffers=1 leaky=2 ! videoconvert ! video/x-raw,format=BGRx ! appsink name=outsink",
                ipaddr);

            GStreamer.LookForGstreamer();

            if (!File.Exists(GStreamer.gstlaunch))
            {
                GStreamerUI.DownloadGStreamer();

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

            GStreamer.StartA(url);
        }
コード例 #2
0
        public MasterDetailPage1Detail()
        {
            InitializeComponent();

            string url =
                "rtspsrc location=rtsp://192.168.0.10:8554/fpv_stream latency=41 udp-reconnect=1 timeout=0 do-retransmission=false ! application/x-rtp ! rtph264depay ! h264parse ! queue ! avdec_h264 ! video/x-raw,format=BGRx ! appsink name=outsink";

            GStreamer.StartA(url);
        }
コード例 #3
0
        private void Video_Load(object sender, EventArgs e)
        {
            CheckBox chk = new CheckBox();

            chk.Text = "Display External";
            flowLayoutPanel1.Controls.Add(chk);

            foreach (var zeroconfHost in ZeroConf.Hosts)
            {
                Label lbl = new Label();
                lbl.Text = zeroconfHost.Id;
                flowLayoutPanel1.Controls.Add(lbl);
                foreach (var service in zeroconfHost.Services)
                {
                    foreach (var valueProperty in service.Value.Properties)
                    {
                        foreach (var property in valueProperty)
                        {
                            var matchs = Regex.Match(property.Value, @"\s*(\w+)\(");

                            var resolutions = new Regex(@"(?:([0-9]+)x([0-9]+)[,\)])");

                            if (matchs.Length > 0)
                            {
                                var reslist = resolutions.Matches(property.Value);

                                foreach (Match match in reslist)
                                {
                                    var      width  = match.Groups[1].Value;
                                    var      height = match.Groups[2].Value;
                                    MyButton but    = new MyButton();
                                    but.Text = service.Value.Properties[0]["name"] + "     \n" +
                                               matchs.Groups[1].Value.ToString() + " - " + width + "x" + height;
                                    but.Size   = TextRenderer.MeasureText(but.Text + "   ", but.Font);
                                    but.Click += delegate(object o, EventArgs args)
                                    {
                                        GStreamer.StartA(String.Format(
                                                             "rtspsrc location=rtsp://{0}:{1}{2}?width={3}&height={4} ! application/x-rtp ! rtpjpegdepay ! videoconvert ! video/x-raw,format=BGRA ! appsink name=outsink",
                                                             zeroconfHost.IPAddress, service.Value.Port, service.Value.PTR, width,
                                                             height));
                                    };
                                    flowLayoutPanel1.Controls.Add(but);
                                }
                            }
                        }
                    }
                }
            }
        }