<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 = &quot; rtsp://192.168.1.100/1.mp3&quot; ! 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">&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;</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">&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;
</font></p><p><font size="2">the gst-launch command line works just fine, but I don&#39;t know why the demo can&#39;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">//&nbsp; helloworld.c<br></font></p><p><font size="2">#include &lt;stdlib.h&gt;<br>
#include &lt;gst/gst.h&gt;<br>
<br>
static void<br>
event_loop (GstElement * pipe)<br>
{<br>
&nbsp; GstBus *bus;<br>
&nbsp; GstMessage *message = NULL;<br>
<br>
&nbsp; bus = gst_element_get_bus (GST_ELEMENT (pipe));<br>
<br>
&nbsp; while (TRUE) {<br>
&nbsp;&nbsp;&nbsp; message = gst_bus_poll (bus, GST_MESSAGE_ANY, -1);<br>
<br>
&nbsp;&nbsp;&nbsp; g_assert (message != NULL);<br>
<br>
&nbsp;&nbsp;&nbsp; switch (message-&gt;type) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case GST_MESSAGE_EOS:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_message_unref (message);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case GST_MESSAGE_WARNING:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case GST_MESSAGE_ERROR:{<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GError *gerror;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gchar *debug;<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_message_parse_error (message, &amp;gerror, &amp;debug);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_message_unref (message);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g_error_free (gerror);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; g_free (debug);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; default:<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; gst_message_unref (message);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp; }<br>
}<br>
<br>
int main (int argc, char *argv[])<br>
{<br>
&nbsp; GstElement *bin, *filesrc , *fakesink, *queue;<br>
&nbsp; <br></font></p><p><font size="2">&nbsp; gst_init (&amp;argc, &amp;argv);<br>
<br>
&nbsp; if (argc != 2) {<br>
&nbsp;&nbsp;&nbsp; g_print (&quot;usage: %s &lt;rtsp mp3 file&gt;\n&quot;, argv[0]);<br>
&nbsp;&nbsp;&nbsp; exit (-1);<br>
&nbsp; }<br>
<br>
&nbsp; /* create a new bin to hold the elements */<br>
&nbsp; bin = gst_pipeline_new (&quot;pipeline&quot;);<br>
&nbsp; g_assert (bin);<br>
<br>
&nbsp; /* create a disk reader */<br>
&nbsp; filesrc = gst_element_factory_make (&quot;rtspsrc&quot;, &quot;rtp_disk_source&quot;);<br>
&nbsp; if(!filesrc)<br>
&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; printf(&quot;could not create \&quot;rtspsrc\&quot; element!&quot;);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; return -1;<br>
&nbsp;&nbsp; }<br>
&nbsp; g_object_set (G_OBJECT (filesrc), &quot;location&quot;, argv[1] , NULL);<br>
&nbsp; printf(&quot;argv[1] is %s\n&quot;,argv[1]);<br>
<br>
&nbsp; /* and an audio sink */<br>&nbsp;
fakesink = gst_element_factory_make (&quot;fakesink&quot;,&quot;fake_sink&quot;);<br>
<br>
&nbsp; queue = gst_element_factory_make (&quot;queue&quot;,&quot;queue&quot;);<br>
<br>
&nbsp; /* add objects to the main pipeline */<br>
&nbsp; gst_bin_add_many (GST_BIN (bin),filesrc, queue, fakesink,NULL);<br>
<br>
&nbsp; /* link the elements */<br>&nbsp; gst_element_link_many (filesrc, queue, fakesink,NULL);<br>
&nbsp;<br>
&nbsp; /* start playing */<br>
&nbsp; gst_element_set_state (bin, GST_STATE_PLAYING);<br>
<br>
&nbsp; /* Run event loop listening for bus messages until EOS or ERROR */<br>
&nbsp; event_loop (bin);<br>
<br>
&nbsp; /* stop the bin */<br>
&nbsp; gst_element_set_state (bin, GST_STATE_NULL);<br>
<br>
&nbsp; 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>