I have a small program that uses the GStreamer library to play videos from local files and videos on web servers using HTTP. How can I connect to UDP broadcast in C using GStreamer ?
For example, what is required to play streaming video in this hypothetical URI? 10.0.11.255:9001
I tried:
// using playbin2 connect to UDP broadcast g_object_set (data.playbin2, "uri", "udp://10.0.11.255:9001", NULL);
Then I try to start the stream with the following:
if( gst_element_set_state (data.playbin2, GST_STATE_PLAYING) == GST_STATE_CHANGE_FAILURE ) { g_printerr ("Unable to set the pipeline to the playing state.\n"); gst_object_unref (data.playbin2); return( -1 ); }
and I get a message about the status change of the message.
I did a google search and did not find anything useful.
EDIT: after a few more searches, I found out about udpsrc . However, I cannot figure out how to use it in C code.
source share