[gst-devel] Using volume in an autoplugging pipeline

Michael Stute mrstute at gmail.com
Thu May 21 14:52:26 CEST 2009


I need a little help on this. Using
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/index.htmlas
a guide I have tried to create an autoplugging pipeline that contains
both volume and equalizer-10band. In the pad callback if I connect the
dynamic pad directly to the alsasink sink it works.  But if I create the
pipeline and try to connect volume or the EQ I get an "Error: Internal data
flow error." error. I van't seem to find any examples or additional
information for this.

Can anybody point me to an example or help out?

static void
on_pad_added (GstElement *element,
              GstPad     *pad,
              gpointer    data)
{
  GstPad *sinkpad;

  sinkpad = gst_element_get_static_pad (gain, "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 ("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, gain, audio, NULL);

    return(pipeline);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20090521/74e34670/attachment.htm>


More information about the gstreamer-devel mailing list