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

Quan Nguyen friday_morning at yahoo.com
Sun Dec 21 22:13:02 CET 2003


Thanks.  Then my question is this.  How do I read data
from a decoder's source pad?  Do I have to create a
GstElement and connect it to the source pad of a
decoder?  I don't want to create a GstElement to
accept data from the source pad of another element.  I
just want to be able to read the data from an audio
decoder and perform some analysis on it with a C++
function that I wrote.  

--- Benjamin Otte <in7y118 at public.uni-hamburg.de>
wrote:
> 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
> 
> 
> 
>
-------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux
> Tutorials.
> Become an expert in LINUX or just sharpen your
> skills.  Sign up for IBM's
> Free Linux Tutorials.  Learn everything from the
> bash shell to sys admin.
> Click now!
>
http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
>
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree




More information about the gstreamer-devel mailing list