[gst-devel] [gstreamer] Problem with pulling data from a sink pad

Benjamin Otte in7y118 at public.uni-hamburg.de
Fri Dec 19 18:38:00 CET 2003


You can not pull from sinkpads. Sinkpads can only take data, not produce
it.
What you probably want to do is insert a tee element in front of the audio
sink and connect a spectrum analyzer element to a src pad of that tee.

Benjamin


On Fri, 19 Dec 2003, Quan Nguyen wrote:

> I am trying to pull data from an audio sink to use for a spectrum analyzer that I am coding up.  When I try to output the data, I get all zeroes.  I did not quite understand the documentation on the gstreamer website.  Any suggestions?  Here is a fragment of my code pertaining to this issue:
>
> // First, I get the sink pad from the audio sink
> GstPad *sinkpad;
> sinkpad = gst_element_get_pad (audiosink, "sink");
>
> GstBuffer *buffer, *outbuffer;
> while (1) {
>     // For testing purposes, I put it into an infinite loop.
>     // I pull from the sinkpad
>     buffer = gst_pad_pull (sinkpad);
>
>     // output the size of the data and the actual data to the screen
>     cout << buffer->size << endl;
>     for (int i=0; i<buffer->size; ++i)
>     {
>         cout << buffer->data[i] << ", ";
>     }
>     gst_bin_iterate (GST_BIN (pipeline));
>   }
>
>
>
>
> ---------------------------------
> Do you Yahoo!?
> New Yahoo! Photos - easier uploading and sharing





More information about the gstreamer-devel mailing list