hmm thanks for the help, im going to read more then. I got confused because on gst-launch it worked, i didnt realized that gst-launch was linking diferent.<br><br><div class="gmail_quote">On Thu, May 7, 2009 at 11:57 AM, Andrey Boyko <span dir="ltr">&lt;<a href="mailto:andreib@module.ru">andreib@module.ru</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 bgcolor="#ffffff" text="#000000">
Because gst-launch as an application do it for you. I think in function
gst_parse_perform_delayed_link in file grammar.tab.c.<div><div></div><div class="h5"><br>
<br>
Tiago Katcipis wrote:
<blockquote type="cite">but why does it work every time with gst-launch?<br>
  <br>
  <div class="gmail_quote">On Thu, May 7, 2009 at 11:14 AM, Andrey
Boyko <span dir="ltr">&lt;<a href="mailto:andreib@module.ru" target="_blank">andreib@module.ru</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 bgcolor="#ffffff" text="#000000">
wavparse element has &#39;sometimes&#39; src pads so you can&#39;t just do
gst_element_link (wavparse, convert);<br>
See <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/index.html" target="_blank">http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/index.html</a>
section 8.1.1 how to handle it.<br>
    <br>
Tiago Katcipis wrote:
    <blockquote type="cite">
      <div>
      <div>Im having some trouble making a wav player, when
i try to
build the pipeline using gst-launch it works fine, but the source code
building the same pipeline generates an error. Im sorry if the question
is stupid, im new at gstreamer and im not getting what im doing wrong
:-(. I followed an example i found on gstreamer documentation.<br>
      <br>
The gst-launch comand:<br>
gst-launch filesrc location=&quot;exemploWav.wav&quot; ! wavparse ! audioconvert
! gconfaudiosink<br>
      <br>
The source code that builds the same pipe (or at least it should build):<br>
#include &lt;gst/gst.h&gt;<br>
#include &lt;glib.h&gt;<br>
      <br>
static gboolean<br>
bus_call (GstBus     *bus,<br>
          GstMessage *msg,<br>
          gpointer    data)<br>
{<br>
  GMainLoop *loop = (GMainLoop *) data;<br>
      <br>
  switch (GST_MESSAGE_TYPE (msg)) {<br>
      <br>
    case GST_MESSAGE_EOS:<br>
      g_print (&quot;End of stream\n&quot;);<br>
      g_main_loop_quit (loop);<br>
      break;<br>
      <br>
    case GST_MESSAGE_ERROR: {<br>
      gchar  *debug;<br>
      GError *error;<br>
      <br>
      gst_message_parse_error (msg, &amp;error, &amp;debug);<br>
      g_free (debug);<br>
      <br>
      g_printerr (&quot;Error: %s\n&quot;, error-&gt;message);<br>
      g_error_free (error);<br>
      <br>
      g_main_loop_quit (loop);<br>
      break;<br>
    }<br>
    default:<br>
      g_print(&quot;Teste.....[%d]\n&quot;, GST_MESSAGE_TYPE (msg));<br>
      break;<br>
  }<br>
      <br>
  return TRUE;<br>
}<br>
      <br>
int<br>
main (int   argc,<br>
      char *argv[])<br>
{<br>
  GMainLoop *loop;<br>
      <br>
  GstElement *pipeline, *source, *sink, *convert, *wavparse;<br>
  GstBus *bus;<br>
      <br>
  /* Initialisation */<br>
  gst_init (&amp;argc, &amp;argv);<br>
      <br>
  loop = g_main_loop_new (NULL, FALSE);<br>
      <br>
  /* Check input arguments */<br>
  if (argc != 2) {<br>
    g_printerr (&quot;Usage: %s &lt;Wav filename&gt;\n&quot;, argv[0]);<br>
    return -1;<br>
  }<br>
      <br>
  /* Create gstreamer elements */<br>
  pipeline = gst_pipeline_new (&quot;wav_player&quot;);<br>
  source   = gst_element_factory_make (&quot;filesrc&quot;,       &quot;file_source&quot;);<br>
  wavparse = gst_element_factory_make (&quot;wavparse&quot;,      &quot;wav_parser&quot;);<br>
  convert  = gst_element_factory_make (&quot;audioconvert&quot;, 
&quot;audio_convert&quot;);<br>
  sink     = gst_element_factory_make (&quot;gconfaudiosink&quot;,&quot;gnome_output&quot;);<br>
      <br>
  if (!pipeline || !source || !sink || !convert || !wavparse ) {<br>
    g_printerr (&quot;One element could not be created. Exiting.\n&quot;);<br>
    return -1;<br>
  }<br>
      <br>
  /* Set up the pipeline */<br>
  /* we set the input filename to the source element */<br>
  g_object_set (G_OBJECT (source), &quot;location&quot;, argv[1], NULL);<br>
      <br>
  /* we add a message handler */<br>
  bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline));<br>
  gst_bus_add_watch (bus, bus_call, loop);<br>
  gst_object_unref (bus);<br>
      <br>
  /* we add all elements into the pipeline */<br>
  gst_bin_add_many (GST_BIN (pipeline),<br>
                    source, convert, wavparse, sink, NULL);<br>
      <br>
  /* we link the elements together */<br>
  gst_element_link (source, wavparse);<br>
  gst_element_link (wavparse, convert);<br>
  gst_element_link (convert, sink);<br>
  <br>
  <br>
  /* Set the pipeline to &quot;playing&quot; state*/<br>
  g_print (&quot;Now playing: %s\n&quot;, argv[1]);<br>
  gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
      <br>
      <br>
  /* Iterate */<br>
  g_print (&quot;Running...\n&quot;);<br>
  g_main_loop_run (loop);<br>
      <br>
  /* Out of the main loop, clean up nicely */<br>
  g_print (&quot;Returned, stopping playback\n&quot;);<br>
  gst_element_set_state (pipeline, GST_STATE_NULL);<br>
      <br>
  g_print (&quot;Deleting pipeline\n&quot;);<br>
  gst_object_unref (GST_OBJECT (pipeline));<br>
      <br>
  return 0;<br>
}<br>
      <br>
The error:<br>
Error: Erro no fluxo interno de dados. (something like &quot;Error on
internal data flow&quot;).<br>
      <br>
best regards,<br>
Katcipis<br>
      </div>
      </div>
      <pre><hr size="4" width="90%">
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there&#39;s a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you&#39;ll get full speed at 300 dpi even with all image 
processing features enabled. <a href="http://p.sf.net/sfu/kodak-com" target="_blank">http://p.sf.net/sfu/kodak-com</a></pre>
      <pre><hr size="4" width="90%">
_______________________________________________
gstreamer-devel mailing list
<a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">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>
  </pre>
    </blockquote>
    <br>
    </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>
</blockquote>
<br>
</div></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>