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

Quan Nguyen friday_morning at yahoo.com
Fri Dec 19 17:00:01 CET 2003


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20031219/15eafd24/attachment.htm>


More information about the gstreamer-devel mailing list