Skip to content

Commit

Permalink
AutoConnect: fix pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
meee1 committed Jan 10, 2023
1 parent a83d32b commit bbb1288
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
11 changes: 6 additions & 5 deletions ExtLibs/Utilities/AutoConnect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
11 changes: 10 additions & 1 deletion ExtLibs/Utilities/GStreamer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1247,6 +1247,8 @@ static void ThreadStart(object datao)
int argc = 1;
string[] argv = new string[] { "-vvv" };

Environment.SetEnvironmentVariable("GST_DEBUG", "*:4");

try
{

Expand Down Expand Up @@ -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;
Expand All @@ -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))
Expand Down

0 comments on commit bbb1288

Please sign in to comment.