diff --git a/ExtLibs/Utilities/AutoConnect.cs b/ExtLibs/Utilities/AutoConnect.cs index 062340f02a..7ee49fc0e9 100644 --- a/ExtLibs/Utilities/AutoConnect.cs +++ b/ExtLibs/Utilities/AutoConnect.cs @@ -27,20 +27,21 @@ public class AutoConnect new ConnectionInfo("Mavlink sitl port", false, 5760, ProtocolType.Tcp, ConnectionFormat.MAVLink, Direction.Outbound, "127.0.0.1"), - + new ConnectionInfo("Video udp 5000 h264", true, 5000, ProtocolType.Udp, ConnectionFormat.Video, Direction.Inbound, - "udpsrc port=5000 buffer-size=90000 ! application/x-rtp ! decodebin3 ! queue max-size-buffers=1 leaky=2 ! videoconvert ! video/x-raw,format=BGRA ! appsink name=outsink sync=false"), + "udpsrc port=5000 buffer-size=90000 ! application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264 ! decodebin3 ! queue max-size-buffers=1 leaky=2 ! videoconvert ! video/x-raw,format=BGRA ! appsink name=outsink sync=false"), new ConnectionInfo("Video udp 5100 h264", true, 5100, ProtocolType.Udp, ConnectionFormat.Video, Direction.Inbound, - "udpsrc port=5100 buffer-size=90000 ! application/x-rtp ! decodebin3 ! queue max-size-buffers=1 leaky=2 ! videoconvert ! video/x-raw,format=BGRA ! appsink name=outsink sync=false"), + "udpsrc port=5100 buffer-size=90000 ! application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264 ! decodebin3 ! queue max-size-buffers=1 leaky=2 ! videoconvert ! video/x-raw,format=BGRA ! appsink name=outsink sync=false"), + // "C:\ProgramData\Mission Planner\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe" videotestsrc pattern=ball is-live=true ! video/x-raw,width=640,height=480 ! clockoverlay ! x264enc ! rtph264pay ! udpsink host=127.0.0.1 port=5600 new ConnectionInfo("Video udp 5600 h264", true, 5600, ProtocolType.Udp, ConnectionFormat.Video, Direction.Inbound, - "udpsrc port=5600 buffer-size=90000 ! application/x-rtp ! decodebin3 ! queue max-size-buffers=1 leaky=2 ! videoconvert ! video/x-raw,format=BGRA ! appsink name=outsink sync=false"), + "udpsrc port=5600 buffer-size=90000 ! application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H264 ! decodebin3 ! queue max-size-buffers=1 leaky=2 ! videoconvert ! video/x-raw,format=BGRA ! appsink name=outsink sync=false"), new ConnectionInfo("Video udp 5601 h265", true, 5601, ProtocolType.Udp, ConnectionFormat.Video, Direction.Inbound, - "udpsrc port=5601 buffer-size=90000 ! application/x-rtp ! decodebin3 ! queue max-size-buffers=1 leaky=2 ! videoconvert ! video/x-raw,format=BGRA ! appsink name=outsink sync=false"), + "udpsrc port=5601 buffer-size=90000 ! application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)H265 ! decodebin3 ! queue max-size-buffers=1 leaky=2 ! videoconvert ! video/x-raw,format=BGRA ! appsink name=outsink sync=false"), new ConnectionInfo("SkyViper", false, 554, ProtocolType.Tcp, ConnectionFormat.Video, Direction.Outbound, "rtspsrc location=rtsp://192.168.99.1/media/stream2 debug=false buffer-mode=1 latency=100 ntp-time-source=3 ! application/x-rtp ! decodebin3 ! queue max-size-buffers=1 leaky=2 ! videoconvert ! video/x-raw,format=BGRA ! appsink name=outsink sync=false"), diff --git a/ExtLibs/Utilities/GStreamer.cs b/ExtLibs/Utilities/GStreamer.cs index d7571d8e39..0e25d9c573 100644 --- a/ExtLibs/Utilities/GStreamer.cs +++ b/ExtLibs/Utilities/GStreamer.cs @@ -1247,6 +1247,8 @@ static void ThreadStart(object datao) int argc = 1; string[] argv = new string[] { "-vvv" }; + Environment.SetEnvironmentVariable("GST_DEBUG", "*:4"); + try { @@ -1346,11 +1348,12 @@ static void ThreadStart(object datao) log.Info("set playing "); /* Wait until error or EOS */ var bus = NativeMethods.gst_element_get_bus(pipeline); + int Width = 0; int Height = 0; - int trys = 0; // prevent it falling out of scope + int trys = 0; GstAppSinkCallbacks callbacks2 = callbacks; run = true; @@ -1364,6 +1367,12 @@ static void ThreadStart(object datao) run = false; } + else { + var msg = NativeMethods.gst_bus_timed_pop_filtered(bus, 0, + (int)(GstMessageType.GST_MESSAGE_ERROR | GstMessageType.GST_MESSAGE_EOS)); + if (msg != IntPtr.Zero) + run = false; + } log.Info("start frame loop gst_app_sink_is_eos"); while (run && !NativeMethods.gst_app_sink_is_eos(appsink))