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)' failed<br><br>(spectrum:3124): GStreamer-CRITICAL **: gst_element_link_pads_filtered: assertion `GST_IS_ELEMENT (dest)' failed<br>
can'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"><<a href="mailto:grlongo.ireland@gmail.com">grlongo.ireland@gmail.com</a>></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'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'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':<br>
spectrum.c:(.text+0xd): undefined reference to `gst_message_get_type'<br>
spectrum.c:(.text+0x64): undefined reference to `gst_message_parse_error'<br>
/tmp/cccrQH9p.o: In function `on_pad_added':<br>
spectrum.c:(.text+0xdd): undefined reference to `gst_element_get_static_pad'<br>
spectrum.c:(.text+0xf1): undefined reference to `gst_pad_link'<br>
spectrum.c:(.text+0xff): undefined reference to `gst_object_unref'<br>
/tmp/cccrQH9p.o: In function `main':<br>
spectrum.c:(.text+0x12b): undefined reference to `gst_init'<br>
spectrum.c:(.text+0x17c): undefined reference to `gst_pipeline_new'<br>
spectrum.c:(.text+0x194): undefined reference to `gst_element_factory_make'<br>
spectrum.c:(.text+0x1ac): undefined reference to `gst_element_factory_make'<br>
spectrum.c:(.text+0x1c4): undefined reference to `gst_element_factory_make'<br>
spectrum.c:(.text+0x1dc): undefined reference to `gst_element_factory_make'<br>
spectrum.c:(.text+0x1f4): undefined reference to `gst_element_factory_make'<br>
spectrum.c:(.text+0x26c): undefined reference to `gst_pipeline_get_type'<br>
spectrum.c:(.text+0x285): undefined reference to `gst_pipeline_get_bus'<br>
spectrum.c:(.text+0x29e): undefined reference to `gst_bus_add_watch'<br>
spectrum.c:(.text+0x2ac): undefined reference to `gst_object_unref'<br>
spectrum.c:(.text+0x2b4): undefined reference to `gst_bin_get_type'<br>
spectrum.c:(.text+0x2de): undefined reference to `gst_bin_add_many'<br>
spectrum.c:(.text+0x2ef): undefined reference to `gst_element_link'<br>
spectrum.c:(.text+0x302): undefined reference to `gst_element_link_many'<br>
spectrum.c:(.text+0x34e): undefined reference to `gst_element_set_state'<br>
spectrum.c:(.text+0x38c): undefined reference to `gst_element_set_state'<br>
spectrum.c:(.text+0x3a4): undefined reference to `gst_object_get_type'<br>
spectrum.c:(.text+0x3bd): undefined reference to `gst_object_unref'<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 <gst/gst.h><br>
#include <glib.h><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 ("End of stream\n");<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, &error, &debug);<br>
g_free (debug);<br>
<br>
g_printerr ("Error: %s\n", error->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 ("Dynamic pad created, linking demuxer/decoder\n");<br>
<br>
sinkpad = gst_element_get_static_pad (decoder, "sink");<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 (&argc, &argv);<br>
<br>
loop = g_main_loop_new (NULL, FALSE);<br>
<br>
<br>
/* Check input arguments */<br>
if (argc != 2) {<br>
g_printerr ("Usage: %s <Ogg/Vorbis filename>\n", argv[0]);<br>
return -1;<br>
}<br>
<br>
<br>
/* Create gstreamer elements */<br>
pipeline = gst_pipeline_new ("audio-player");<br>
source = gst_element_factory_make ("filesrc", "file-source");<br>
demuxer = gst_element_factory_make ("oggdemux", "ogg-demuxer");<br>
decoder = gst_element_factory_make ("vorbisdec", "vorbis-decoder");<br>
conv = gst_element_factory_make ("audioconvert", "converter");<br>
sink = gst_element_factory_make ("autoaudiosink", "audio-output");<br>
<br>
if (!pipeline || !source || !demuxer || !decoder || !conv || !sink) {<br>
g_printerr ("One element could not be created. Exiting.\n");<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), "location", 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 -> ogg-demuxer ~> vorbis-decoder -> converter -><br>
alsa-output */<br>
gst_element_link (source, demuxer);<br>
gst_element_link_many (decoder, conv, sink, NULL);<br>
g_signal_connect (demuxer, "pad-added", 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 "pad-added" is emitted.*/<br>
<br>
<br>
/* Set the pipeline to "playing" state*/<br>
g_print ("Now playing: %s\n", argv[1]);<br>
gst_element_set_state (pipeline, GST_STATE_PLAYING);<br>
<br>
<br>
/* Iterate */<br>
g_print ("Running...\n");<br>
g_main_loop_run (loop);<br>
<br>
<br>
/* Out of the main loop, clean up nicely */<br>
g_print ("Returned, stopping playback\n");<br>
gst_element_set_state (pipeline, GST_STATE_NULL);<br>
<br>
g_print ("Deleting pipeline\n");<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 & brand creativity professionals. Meet<br>
the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian<br>
Group, R/GA, & 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 & brand creativity professionals. Meet<br>
the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian<br>
Group, R/GA, & 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>