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

Quan Nguyen friday_morning at yahoo.com
Tue Dec 23 08:52:04 CET 2003


Thanks!  I appreciate your help and advice.  Let me describe what I'm working on so that everyone can make some comments on whether my approach is ok.  
 
I am building an application that takes in some audio and does some analysis on the raw audio.  The application then makes certain decisions based on the results of the analysis.  There are many ways of doing this particular analysis, so this application will have its own plugin system so that people can write new analysis algorithms.  
 
The reason I wanted to use Gstreamer was to conveniently get audio from different sources.  If I understand your comments correctly, you are suggesting that instead of my application having its own plugin system, I should just write plugins for Gstreamer to perform the analysis?

Ronald Bultje <rbultje at ronald.bitfreak.net> wrote:
On Mon, 2003-12-22 at 18:56, Quan Nguyen wrote:
> By the way, I may not have been clear before. What I want to do is
> to get the raw audio data from a decoder so that I can manipulate it
> with standard C++ code. I don't want to have to hook the decoder up
> to another element. Thanks.

First a note: this is a *really* bad idea. GStreamer is intended for
elements that can be used by each application. By using such 'hacks',
the whole idea of GStreamer has little use.

How:

#include 

static void
cb_manipulate (GstElement *element,
GstData *data)
{
GstBuffer *buffer;

/* no events */
if (!GST_IS_BUFFER (data))
return;
buffer = GST_BUFFER (data);

/* manipulate your data here */
[..]
}

int
main ()
{
GstElement *listener;
[..]
listener = gst_element_factory_make ("identity", 
"listener");
g_signal_connect (G_OBJECT (listener), "handoff",
G_CALLBACK (cb_manipulate), NULL);
[..]
/* example pipeline... */
gst_element_link_many (audiosource, decoder, listener,
audiosink, NULL);
}

But again, this is a really bad idea. It's nice as a quick hack, but
nothing more than that. Rethink your application if it requires this.

Ronald

-- 
Ronald Bultje 
Linux Video/Multimedia developer


---------------------------------
Do you Yahoo!?
Yahoo! Photos - Get your photo on the big screen in Times Square
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20031223/531d3915/attachment.htm>


More information about the gstreamer-devel mailing list