thanks fot the hints Wim. Im going to read more before posting now.<br><br><div class="gmail_quote">On Thu, May 7, 2009 at 12:19 PM, Wim Taymans <span dir="ltr">&lt;<a href="mailto:wim.taymans@gmail.com">wim.taymans@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On Thu, 2009-05-07 at 10:23 -0300, Tiago Katcipis wrote:<br>
&gt; Im having some trouble making a wav player, when i try to build the<br>
&gt; pipeline using gst-launch it works fine, but the source code building<br>
&gt; the same pipeline generates an error. Im sorry if the question is<br>
&gt; stupid, im new at gstreamer and im not getting what im doing<br>
&gt; wrong :-(. I followed an example i found on gstreamer documentation.<br>
&gt;<br>
&gt; The gst-launch comand:<br>
&gt; gst-launch filesrc location=&quot;exemploWav.wav&quot; ! wavparse !<br>
&gt; audioconvert ! gconfaudiosink<br>
<br>
</div>Hi,<br>
<br>
Check the result codes from various methods (hint some elements will not<br>
link correctly. Another hint, read some more about dynamic pads)<br>
<font color="#888888"><br>
Wim<br>
</font><div><div></div><div class="h5">&gt;<br>
&gt; The source code that builds the same pipe (or at least it should<br>
&gt; build):<br>
&gt; #include &lt;gst/gst.h&gt;<br>
&gt; #include &lt;glib.h&gt;<br>
&gt;<br>
&gt; static gboolean<br>
&gt; bus_call (GstBus     *bus,<br>
&gt;           GstMessage *msg,<br>
&gt;           gpointer    data)<br>
&gt; {<br>
&gt;   GMainLoop *loop = (GMainLoop *) data;<br>
&gt;<br>
&gt;   switch (GST_MESSAGE_TYPE (msg)) {<br>
&gt;<br>
&gt;     case GST_MESSAGE_EOS:<br>
&gt;       g_print (&quot;End of stream\n&quot;);<br>
&gt;       g_main_loop_quit (loop);<br>
&gt;       break;<br>
&gt;<br>
&gt;     case GST_MESSAGE_ERROR: {<br>
&gt;       gchar  *debug;<br>
&gt;       GError *error;<br>
&gt;<br>
&gt;       gst_message_parse_error (msg, &amp;error, &amp;debug);<br>
&gt;       g_free (debug);<br>
&gt;<br>
&gt;       g_printerr (&quot;Error: %s\n&quot;, error-&gt;message);<br>
&gt;       g_error_free (error);<br>
&gt;<br>
&gt;       g_main_loop_quit (loop);<br>
&gt;       break;<br>
&gt;     }<br>
&gt;     default:<br>
&gt;       g_print(&quot;Teste.....[%d]\n&quot;, GST_MESSAGE_TYPE (msg));<br>
&gt;       break;<br>
&gt;   }<br>
&gt;<br>
&gt;   return TRUE;<br>
&gt; }<br>
&gt;<br>
&gt; int<br>
&gt; main (int   argc,<br>
&gt;       char *argv[])<br>
&gt; {<br>
&gt;   GMainLoop *loop;<br>
&gt;<br>
&gt;   GstElement *pipeline, *source, *sink, *convert, *wavparse;<br>
&gt;   GstBus *bus;<br>
&gt;<br>
&gt;   /* Initialisation */<br>
&gt;   gst_init (&amp;argc, &amp;argv);<br>
&gt;<br>
&gt;   loop = g_main_loop_new (NULL, FALSE);<br>
&gt;<br>
&gt;   /* Check input arguments */<br>
&gt;   if (argc != 2) {<br>
&gt;     g_printerr (&quot;Usage: %s &lt;Wav filename&gt;\n&quot;, argv[0]);<br>
&gt;     return -1;<br>
&gt;   }<br>
&gt;<br>
&gt;   /* Create gstreamer elements */<br>
&gt;   pipeline = gst_pipeline_new (&quot;wav_player&quot;);<br>
&gt;   source   = gst_element_factory_make (&quot;filesrc&quot;,<br>
&gt; &quot;file_source&quot;);<br>
&gt;   wavparse = gst_element_factory_make (&quot;wavparse&quot;,      &quot;wav_parser&quot;);<br>
&gt;   convert  = gst_element_factory_make (&quot;audioconvert&quot;,<br>
&gt; &quot;audio_convert&quot;);<br>
&gt;   sink     = gst_element_factory_make<br>
&gt; (&quot;gconfaudiosink&quot;,&quot;gnome_output&quot;);<br>
&gt;<br>
&gt;   if (!pipeline || !source || !sink || !convert || !wavparse ) {<br>
&gt;     g_printerr (&quot;One element could not be created. Exiting.\n&quot;);<br>
&gt;     return -1;<br>
&gt;   }<br>
&gt;<br>
&gt;   /* Set up the pipeline */<br>
&gt;   /* we set the input filename to the source element */<br>
&gt;   g_object_set (G_OBJECT (source), &quot;location&quot;, argv[1], NULL);<br>
&gt;<br>
&gt;   /* we add a message handler */<br>
&gt;   bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));<br>
&gt;   gst_bus_add_watch (bus, bus_call, loop);<br>
&gt;   gst_object_unref (bus);<br>
&gt;<br>
&gt;   /* we add all elements into the pipeline */<br>
&gt;   gst_bin_add_many (GST_BIN (pipeline),<br>
&gt;                     source, convert, wavparse, sink, NULL);<br>
&gt;<br>
&gt;   /* we link the elements together */<br>
&gt;   gst_element_link (source, wavparse);<br>
&gt;   gst_element_link (wavparse, convert);<br>
&gt;   gst_element_link (convert, sink);<br>
&gt;<br>
&gt;<br>
&gt;   /* Set the pipeline to &quot;playing&quot; state*/<br>
&gt;   g_print (&quot;Now playing: %s\n&quot;, argv[1]);<br>
&gt;   gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
&gt;<br>
&gt;<br>
&gt;   /* Iterate */<br>
&gt;   g_print (&quot;Running...\n&quot;);<br>
&gt;   g_main_loop_run (loop);<br>
&gt;<br>
&gt;   /* Out of the main loop, clean up nicely */<br>
&gt;   g_print (&quot;Returned, stopping playback\n&quot;);<br>
&gt;   gst_element_set_state (pipeline, GST_STATE_NULL);<br>
&gt;<br>
&gt;   g_print (&quot;Deleting pipeline\n&quot;);<br>
&gt;   gst_object_unref (GST_OBJECT (pipeline));<br>
&gt;<br>
&gt;   return 0;<br>
&gt; }<br>
&gt;<br>
&gt; The error:<br>
&gt; Error: Erro no fluxo interno de dados. (something like &quot;Error on<br>
&gt; internal data flow&quot;).<br>
&gt;<br>
&gt; best regards,<br>
&gt; Katcipis<br>
</div></div><div><div></div><div class="h5">&gt; ------------------------------------------------------------------------------<br>
&gt; The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your<br>
&gt; production scanning environment may not be a perfect world - but thanks to<br>
&gt; Kodak, there&#39;s a perfect scanner to get the job done! With the NEW KODAK i700<br>
&gt; Series Scanner you&#39;ll get full speed at 300 dpi even with all image<br>
&gt; processing features enabled. <a href="http://p.sf.net/sfu/kodak-com" target="_blank">http://p.sf.net/sfu/kodak-com</a><br>
&gt; _______________________________________________ gstreamer-devel mailing list <a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a> <a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>

<br>
<br>
------------------------------------------------------------------------------<br>
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your<br>
production scanning environment may not be a perfect world - but thanks to<br>
Kodak, there&#39;s a perfect scanner to get the job done! With the NEW KODAK i700<br>
Series Scanner you&#39;ll get full speed at 300 dpi even with all image<br>
processing features enabled. <a href="http://p.sf.net/sfu/kodak-com" target="_blank">http://p.sf.net/sfu/kodak-com</a><br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net">gstreamer-devel@lists.sourceforge.net</a><br>
<a href="https://lists.sourceforge.net/lists/listinfo/gstreamer-devel" target="_blank">https://lists.sourceforge.net/lists/listinfo/gstreamer-devel</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>&quot;it might be a profitable thing to learn Java, but it has no intellectual value whatsoever&quot; Alexander Stepanov<br>