Converting a gst-launch pipeline to C code

William Salibrici bsalibrici at latticeinc.com
Wed Jul 27 20:52:19 UTC 2016


Hi Sebastian,
Yes, I’m running gst-launch on the very same machine and it’s the same version. 
Wireshark shows udp packets being received ok with no fragmentation.

I tried switching my sender and receiver machines and then the c code udpsrc receiver worked ok. The windows firewall was disabled on the new receiver machine [which used to be the old sender machine]. 

So, I looked again at the windows firewall settings on my original receiver machine and discovered that unsolicited in-bound packets were being blocked [silently]. I changed the setting to ‘defer to user’ and the c code udpsrc receiver pipeline now works ok. 

The firewall usually barks when something is wrong so I didn’t think to look there at first. Wireshark must hook in at a lower level [not blocked by the firewall] because it was showing udp packets coming in, but they weren’t reaching the application. 

Anyway, thanks again for your help.
Bill

-----Original Message-----
From: gstreamer-devel [mailto:gstreamer-devel-bounces at lists.freedesktop.org] On Behalf Of Sebastian Dröge
Sent: Wednesday, July 27, 2016 2:29 AM
To: Discussion of the development of and with GStreamer <gstreamer-devel at lists.freedesktop.org>
Subject: Re: Converting a gst-launch pipeline to C code

On Di, 2016-07-26 at 18:50 +0000, William Salibrici wrote:
> Hello,
> 
> I am converting the following simple pipeline to C code but it is not 
> working. This receiver pipeline works just fine using the launch tool 
> which shows that my test environment is set up correctly.
> 
> udpsrc address="192.168.1.101" port=5018 ! fakesink dump=TRUE
> 
>  
> 
> Attached is my C code snippet. My bus_call message handler [not 
> included] prints out the pipeline state changes. I used visual studio
> 2010 to compile the C code. Here is the run time screen capture.
> 
>  
> 
> GST_STATE_CHANGE_ASYNC for udp recv.
>  
> Running...
>  
> Pipeline state changed from NULL to READY.
>  
> Pipeline state changed from READY to PAUSED.
> 
>  
> 
> So, the return from setting the pipeline to playing is the ‘async’
> state change. As I understand it, this means that pipeline state 
> changes may be delayed. However, for my simple test case the pipeline 
> never goes to the PLAYING state. The pipeline just sits there in the 
> PAUSED state and data never flows to the display. For my test case I 
> start the receiver first, then the sender which runs on a separate 
> machine.
> 
> I’m using GStreamer 1.8.1 with your windows pre-built binaries on my 
> windows 7 machines.
> 
> I’m probably tripping over something simple. Any ideas on what I might 
> be doing wrong?

The code looks correct from a short look over it, or at least equivalent to what gst-launch would do. Are you running gst-launch on the very same machine? Is it the same version?

Basically the behaviour you see means that you never receive any packets for that IP on that port (double check with e.g. wireshark or tcpdump if they actually arrive and the port/address is correct). The pipeline would automatically get to PLAYING once a packet was received and passed to fakesink.

--
Sebastian Dröge, Centricular Ltd · http://www.centricular.com


More information about the gstreamer-devel mailing list