Kost...<br><br>Tks for your help so far... I fixed the problem removing and compiling again the libraries and plug-ins. It seems that I had some problems with the installation.<br><br> I am gettting a last error mensagem when I am running the spectrum script available in the spectrum plugin page.<br>
<br>   That is the problem:<br><br>   ./spectrum <br><br>(spectrum:3124): GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT (object)&#39; failed<br><br>(spectrum:3124): GStreamer-CRITICAL **: gst_element_link_pads_filtered: assertion `GST_IS_ELEMENT (dest)&#39; failed<br>
can&#39;t link elements<br><br>  It does seem to have a connection with the other problem... is it a commom problem?? Do you think a should start over again compiling and installing everything???????<br><br><br><div class="gmail_quote">
On Sun, May 24, 2009 at 10:21 AM, Guilherme <span dir="ltr">&lt;<a href="mailto:grlongo.ireland@gmail.com">grlongo.ireland@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;">
It is not  ;O)<br>
<br>
But you probably noticed that I was just trying different codes to see if things  worked out in here ;O)!<br>
<br>
<br>
The output is this:<div class="im"><br>
<br>
pkg-config --cflags --libs gstreamer-0.10<br></div>
-pthread -I/usr/include/gstreamer-0.10 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libxml2  -pthread -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lxml2 -lglib-2.0<br>
<br>
It seems that the paths are right.... strange!<br>
<br>
Tks!<br>
<br>
-------------------<br>
<br>
Guilherme Longo<br>
Dept. Eng. da Computação<br>
Unaerp<br>
<br>
Linux User - #484927<br>
<br>
*Before Asking<br>
<a href="http://www.istf.com.br/?page=perguntas" target="_blank">http://www.istf.com.br/?page=perguntas</a><br>
<br>
!- I&#39;d rather die on my feet than live on my knees -!<div><div></div><div class="h5"><br>
<br>
<br>
<br>
Stefan Kost wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Guilherme Raymo Longo schrieb:<br>
  <br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Mates, I am having a issue when trying to compile a simple code that<br>
should work without problems.<br>
I have it running in other machines, but I can&#39;t figure out what it<br>
might be.<br>
    <br>
</blockquote>
<br>
<br>
what does this print?<br>
pkg-config --cflags --libs gstreamer-0.10<br>
<br>
Besides the code below does not look like spectrum.c :)<br>
<br>
Stefan<br>
  <br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
This is the output:<br>
<br>
bash-3.1# gcc -Wall $(pkg-config --cflags --libs gstreamer-0.10) spectrum.c<br>
/tmp/cccrQH9p.o: In function `bus_call&#39;:<br>
spectrum.c:(.text+0xd): undefined reference to `gst_message_get_type&#39;<br>
spectrum.c:(.text+0x64): undefined reference to `gst_message_parse_error&#39;<br>
/tmp/cccrQH9p.o: In function `on_pad_added&#39;:<br>
spectrum.c:(.text+0xdd): undefined reference to `gst_element_get_static_pad&#39;<br>
spectrum.c:(.text+0xf1): undefined reference to `gst_pad_link&#39;<br>
spectrum.c:(.text+0xff): undefined reference to `gst_object_unref&#39;<br>
/tmp/cccrQH9p.o: In function `main&#39;:<br>
spectrum.c:(.text+0x12b): undefined reference to `gst_init&#39;<br>
spectrum.c:(.text+0x17c): undefined reference to `gst_pipeline_new&#39;<br>
spectrum.c:(.text+0x194): undefined reference to `gst_element_factory_make&#39;<br>
spectrum.c:(.text+0x1ac): undefined reference to `gst_element_factory_make&#39;<br>
spectrum.c:(.text+0x1c4): undefined reference to `gst_element_factory_make&#39;<br>
spectrum.c:(.text+0x1dc): undefined reference to `gst_element_factory_make&#39;<br>
spectrum.c:(.text+0x1f4): undefined reference to `gst_element_factory_make&#39;<br>
spectrum.c:(.text+0x26c): undefined reference to `gst_pipeline_get_type&#39;<br>
spectrum.c:(.text+0x285): undefined reference to `gst_pipeline_get_bus&#39;<br>
spectrum.c:(.text+0x29e): undefined reference to `gst_bus_add_watch&#39;<br>
spectrum.c:(.text+0x2ac): undefined reference to `gst_object_unref&#39;<br>
spectrum.c:(.text+0x2b4): undefined reference to `gst_bin_get_type&#39;<br>
spectrum.c:(.text+0x2de): undefined reference to `gst_bin_add_many&#39;<br>
spectrum.c:(.text+0x2ef): undefined reference to `gst_element_link&#39;<br>
spectrum.c:(.text+0x302): undefined reference to `gst_element_link_many&#39;<br>
spectrum.c:(.text+0x34e): undefined reference to `gst_element_set_state&#39;<br>
spectrum.c:(.text+0x38c): undefined reference to `gst_element_set_state&#39;<br>
spectrum.c:(.text+0x3a4): undefined reference to `gst_object_get_type&#39;<br>
spectrum.c:(.text+0x3bd): undefined reference to `gst_object_unref&#39;<br>
collect2: ld returned 1 exit status<br>
<br>
<br>
<br>
I have the PKG_CONFIG_PATH duly configured and gstreamer-0.10 libraries<br>
are installed. What am I missing here??????<br>
<br>
This is the code:<br>
<br>
#include &lt;gst/gst.h&gt;<br>
#include &lt;glib.h&gt;<br>
<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>
      break;<br>
  }<br>
<br>
  return TRUE;<br>
}<br>
<br>
<br>
static void<br>
on_pad_added (GstElement *element,<br>
              GstPad     *pad,<br>
              gpointer    data)<br>
{<br>
  GstPad *sinkpad;<br>
  GstElement *decoder = (GstElement *) data;<br>
<br>
  /* We can now link this pad with the vorbis-decoder sink pad */<br>
  g_print (&quot;Dynamic pad created, linking demuxer/decoder\n&quot;);<br>
<br>
  sinkpad = gst_element_get_static_pad (decoder, &quot;sink&quot;);<br>
<br>
  gst_pad_link (pad, sinkpad);<br>
<br>
  gst_object_unref (sinkpad);<br>
}<br>
<br>
<br>
<br>
int<br>
main (int   argc,<br>
      char *argv[])<br>
{<br>
  GMainLoop *loop;<br>
<br>
  GstElement *pipeline, *source, *demuxer, *decoder, *conv, *sink;<br>
  GstBus *bus;<br>
<br>
  /* Initialisation */<br>
  gst_init (&amp;argc, &amp;argv);<br>
<br>
  loop = g_main_loop_new (NULL, FALSE);<br>
<br>
<br>
  /* Check input arguments */<br>
  if (argc != 2) {<br>
    g_printerr (&quot;Usage: %s &lt;Ogg/Vorbis filename&gt;\n&quot;, argv[0]);<br>
    return -1;<br>
  }<br>
<br>
<br>
  /* Create gstreamer elements */<br>
  pipeline = gst_pipeline_new (&quot;audio-player&quot;);<br>
  source   = gst_element_factory_make (&quot;filesrc&quot;,       &quot;file-source&quot;);<br>
  demuxer  = gst_element_factory_make (&quot;oggdemux&quot;,      &quot;ogg-demuxer&quot;);<br>
  decoder  = gst_element_factory_make (&quot;vorbisdec&quot;,     &quot;vorbis-decoder&quot;);<br>
  conv     = gst_element_factory_make (&quot;audioconvert&quot;,  &quot;converter&quot;);<br>
  sink     = gst_element_factory_make (&quot;autoaudiosink&quot;, &quot;audio-output&quot;);<br>
<br>
  if (!pipeline || !source || !demuxer || !decoder || !conv || !sink) {<br>
    g_printerr (&quot;One element could not be created. Exiting.\n&quot;);<br>
    return -1;<br>
  }<br>
<br>
  /* Set up the pipeline */<br>
<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>
  /* file-source | ogg-demuxer | vorbis-decoder | converter | alsa-output */<br>
  gst_bin_add_many (GST_BIN (pipeline),<br>
                    source, demuxer, decoder, conv, sink, NULL);<br>
<br>
  /* we link the elements together */<br>
  /* file-source -&gt; ogg-demuxer ~&gt; vorbis-decoder -&gt; converter -&gt;<br>
alsa-output */<br>
  gst_element_link (source, demuxer);<br>
  gst_element_link_many (decoder, conv, sink, NULL);<br>
  g_signal_connect (demuxer, &quot;pad-added&quot;, G_CALLBACK (on_pad_added),<br>
decoder);<br>
<br>
  /* note that the demuxer will be linked to the decoder dynamically.<br>
     The reason is that Ogg may contain various streams (for example<br>
     audio and video). The source pad(s) will be created at run time,<br>
     by the demuxer when it detects the amount and nature of streams.<br>
     Therefore we connect a callback function which will be executed<br>
     when the &quot;pad-added&quot; is emitted.*/<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>
<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>
<br>
Tks so much!<br>
<br>
<br>
------------------------------------------------------------------------<br>
<br>
------------------------------------------------------------------------------<br>
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT<br>
is a gathering of tech-side developers &amp; brand creativity professionals. Meet<br>
the minds behind Google Creative Lab, Visual Complexity, Processing, &amp; iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian<br>
Group, R/GA, &amp; Big Spaceship. <a href="http://www.creativitycat.com" target="_blank">http://www.creativitycat.com</a> <br>
<br>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">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>
    <br>
</blockquote>
<br>
<br>
------------------------------------------------------------------------------<br>
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT<br>
is a gathering of tech-side developers &amp; brand creativity professionals. Meet<br>
the minds behind Google Creative Lab, Visual Complexity, Processing, &amp; iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian<br>
Group, R/GA, &amp; Big Spaceship. <a href="http://www.creativitycat.com" target="_blank">http://www.creativitycat.com</a> _______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.sourceforge.net" target="_blank">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>
<br>
  <br>
</blockquote>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Guilherme Raymo Longo<br>Software Developer<br>Mob. 087 - 3179008<br>msn: <a href="mailto:grlongo.ireland@hotmail.com">grlongo.ireland@hotmail.com</a><br>skype: grlongo.ireland<br>