[gst-devel] how does the mixtramix plugin work?

Akos Maroy darkeye at tyrell.hu
Thu May 26 08:42:02 CEST 2005


Ikke wrote:
> I've been fighting with this one too for a while (although I used the
> adder). One of the things you should make sure is all inputs got exactly

I just tried adder (thanks for the tip), but if I add more than one sink
to it, I get:

(process:5810): GStreamer-WARNING **: pushing data on non-negotiated pad
my_decoder1:src, not allowed.


> the same format (#channels, sample rate, bit depth,...). Audioconvert
> can help here.

and they are the same, acutally the two decoders I use are the same file..


Akos

PS: this is the code I'm experimenting with:

#include <gst/gst.h>

gint
main(gint    argc,
     gchar * argv[])
{
    GstElement *pipeline, *filesrc1, *decoder1, *filesrc2, *decoder2;
    GstElement *filter, *sink;
    GValue      gvalue = { 0 };
    gint        input  = 0;
    gint        sinkpads;
    gint        sourcepads;
    gfloat   ** mixmatrix;

    /* initialization */
    gst_init(&argc, &argv);

    /* create elements */
    pipeline = gst_pipeline_new ("my_pipeline");

    filesrc1 = gst_element_factory_make("filesrc", "my_filesource1");
    decoder1 = gst_element_factory_make("mad", "my_decoder1");
    filesrc2 = gst_element_factory_make("filesrc", "my_filesource2");
    decoder2 = gst_element_factory_make("mad", "my_decoder2");
    filter   = gst_element_factory_make("adder", "adder");
    sink     = gst_element_factory_make("osssink", "audiosink");

    g_object_set(G_OBJECT(filesrc1), "location", argv[1], NULL);
    g_object_set(G_OBJECT(filesrc2), "location", argv[2], NULL);

    /* link everything together */
    gst_element_link_many(filesrc1, decoder1, filter, NULL);
    gst_element_link_many(filesrc2, decoder2, filter, NULL);
    gst_element_link_many(filter, sink, NULL);
    gst_bin_add_many(GST_BIN (pipeline),
                     filesrc1, decoder1,
                     filesrc2, decoder2,
                     filter, sink, NULL);

    gst_element_set_state (pipeline, GST_STATE_PLAYING);
    while (gst_bin_iterate (GST_BIN (pipeline)));

    /* clean up */
    gst_element_set_state (pipeline, GST_STATE_NULL);
    gst_object_unref (GST_OBJECT (pipeline));

    return 0;
}




More information about the gstreamer-devel mailing list