<p><font size="2">Hi all<br></font></p><p><font size="2">I am writing a demo to act as the following command line</font></p><p><font size="2">gst-launch rtspsrc location = " rtsp://192.168.1.100/1.mp3" ! queue ! fakesink
</font></p><p><font size="2">but when I compiled and ran the following helloworld.c</font></p><p><font size="2">[root@localhost / ] # helloworld </font><font size="2">rtsp://192.168.1.100/1.mp3</font></p><p><font size="2">
it says <br></font></p><p><font size="2">"""""""""""""""""""""""</font><font size="2"><br>ERROR: from element /pipeline/rtp_disk_source/udpsrc2: Internal data flow error.
<br>
Additional debug info:<br>
gstbasesrc.c(1614): gst_base_src_loop (): /pipeline/rtp_disk_source/udpsrc2:<br>
streaming task paused, reason not-linked (-1)</font><font size="2"> <br></font></p><p><font size="2">"""""""""""""""""""""""
</font></p><p><font size="2">the gst-launch command line works just fine, but I don't know why the demo can't do it</font></p><p><font size="2">does anybody know this ?</font></p><p><font size="2">thank you very much
<br></font></p><p><font size="2">------------------------------------------------------------<br></font></p><p><font size="2">// helloworld.c<br></font></p><p><font size="2">#include <stdlib.h><br>
#include <gst/gst.h><br>
<br>
static void<br>
event_loop (GstElement * pipe)<br>
{<br>
GstBus *bus;<br>
GstMessage *message = NULL;<br>
<br>
bus = gst_element_get_bus (GST_ELEMENT (pipe));<br>
<br>
while (TRUE) {<br>
message = gst_bus_poll (bus, GST_MESSAGE_ANY, -1);<br>
<br>
g_assert (message != NULL);<br>
<br>
switch (message->type) {<br>
case GST_MESSAGE_EOS:<br>
gst_message_unref (message);<br>
return;<br>
case GST_MESSAGE_WARNING:<br>
case GST_MESSAGE_ERROR:{<br>
GError *gerror;<br>
gchar *debug;<br>
<br>
gst_message_parse_error (message, &gerror, &debug);<br>
gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);<br>
gst_message_unref (message);<br>
g_error_free (gerror);<br>
g_free (debug);<br>
return;<br>
}<br>
default:<br>
gst_message_unref (message);<br>
break;<br>
}<br>
}<br>
}<br>
<br>
int main (int argc, char *argv[])<br>
{<br>
GstElement *bin, *filesrc , *fakesink, *queue;<br>
<br></font></p><p><font size="2"> gst_init (&argc, &argv);<br>
<br>
if (argc != 2) {<br>
g_print ("usage: %s <rtsp mp3 file>\n", argv[0]);<br>
exit (-1);<br>
}<br>
<br>
/* create a new bin to hold the elements */<br>
bin = gst_pipeline_new ("pipeline");<br>
g_assert (bin);<br>
<br>
/* create a disk reader */<br>
filesrc = gst_element_factory_make ("rtspsrc", "rtp_disk_source");<br>
if(!filesrc)<br>
{<br>
printf("could not create \"rtspsrc\" element!"); <br>
return -1;<br>
}<br>
g_object_set (G_OBJECT (filesrc), "location", argv[1] , NULL);<br>
printf("argv[1] is %s\n",argv[1]);<br>
<br>
/* and an audio sink */<br>
fakesink = gst_element_factory_make ("fakesink","fake_sink");<br>
<br>
queue = gst_element_factory_make ("queue","queue");<br>
<br>
/* add objects to the main pipeline */<br>
gst_bin_add_many (GST_BIN (bin),filesrc, queue, fakesink,NULL);<br>
<br>
/* link the elements */<br> gst_element_link_many (filesrc, queue, fakesink,NULL);<br>
<br>
/* start playing */<br>
gst_element_set_state (bin, GST_STATE_PLAYING);<br>
<br>
/* Run event loop listening for bus messages until EOS or ERROR */<br>
event_loop (bin);<br>
<br>
/* stop the bin */<br>
gst_element_set_state (bin, GST_STATE_NULL);<br>
<br>
exit (0);<br>
}<br>
</font>
</p>
<font size="2"><br>ERROR: from element /pipeline/rtp_disk_source/udpsrc2: Internal data flow error.<br>
Additional debug info:<br>
gstbasesrc.c(1614): gst_base_src_loop (): /pipeline/rtp_disk_source/udpsrc2:<br>
streaming task paused, reason not-linked (-1)</font>