[gst-devel] Noobie Connection problems
Michael Stute
mrstute at gmail.com
Tue May 19 18:36:21 CEST 2009
I have the following rough code trying to get a pipeline going. All the
GstElement * variables are global to the file so I left those out. But every
call to gst_element_factory_make works with no NULL values return.
I want the following:
uridecodebin ---> volume --> equalizer-10band --> alsasink
If I connect uridecodebin directly to the alsasink sink everything works,
but when I connect the pad in on_pad_connect to volume "sink" or mixer
"sink" I get an Internal Data Error. Volume and mixer sink accepts raw data,
uridecodebin outputs raw data.
If I launch gst-launch with this chain everything works.
What am I doing wrong?
----------------------------------------------------------
----------------------------------------------------------
static void
on_pad_added (GstElement *element,
GstPad *pad,
gpointer data)
{
GstPad *sinkpad;
sinkpad = gst_element_get_static_pad (mixer, "sink");
if(sinkpad==NULL)
printf("Sink pad is null\n");
gst_pad_link (pad, sinkpad);
gst_object_unref (sinkpad);
}
/*
* Set up the streaming pipleine
*
*
*/
GstElement *
init_streamer(void) {
GstElement *pipeline;
/* create pipeline */
pipeline = gst_pipeline_new ("rpm streamer");
src=gst_element_factory_make ("uridecodebin", "play");
if(!src) {
printf("Failed to create source\n");
exit(0);
}
audio=gst_element_factory_make ("alsasink", "output");
gain=gst_element_factory_make("volume","gain");
if(!gain) {
printf("Failed to create gain\n");
exit(0);
}
mixer=gst_element_factory_make("equalizer-10bands","mix");
if(!mixer) {
printf("Failed to create mixer\n");
exit(0);
}
ac=gst_element_factory_make("audioconvert","convert");
if(!ac) {
printf("Failed to create audioconvert\n");
exit(0);
}
//
g_object_set (G_OBJECT (gain), "volume", 1.0, NULL);
g_signal_connect (src, "pad-added", G_CALLBACK (on_pad_added), NULL);
//pipeline=gst_element_factory_make ("playbin", "play");
gst_bin_add_many (GST_BIN (pipeline), src, mixer, audio, NULL);
return(pipeline);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090519/9b50c67b/attachment.htm>
More information about the gstreamer-devel
mailing list