[gst-devel] Question about and appsink pipeline

W. Michael Petullo mike at flyn.org
Sun Feb 1 09:56:04 CET 2009


I have been having trouble building an appsink pipeline in C. I was able
to get it to work, but now have a question.

I have two ways to initialize my pipeline. One works and the other does
not. Could someone tell me why?

This does not work:

        stream->priv->src     = gst_element_factory_make ("giosrc", "src");
        stream->priv->decode  = gst_element_factory_make ("decodebin",
"decode");
        stream->priv->convert = gst_element_factory_make ("audioconvert",
"convert");
        stream->priv->encode  = gst_element_factory_make ("lame", "encode");
        stream->priv->sink    = gst_element_factory_make ("appsink", "sink");

        gst_bin_add_many (GST_BIN (stream->priv->pipeline),
                          stream->priv->src,
                          stream->priv->decode,
                          stream->priv->convert,
                          stream->priv->encode,
                          stream->priv->sink,
                          NULL);

        gst_element_link_many (stream->priv->src,
                               stream->priv->decode,
                               stream->priv->convert,
                               stream->priv->encode,
                               stream->priv->sink,
                               NULL);

        g_object_set (G_OBJECT (stream->priv->src), "location", uri, NULL);

This does work:

        string = g_strdup_printf ("giosrc location=\"%s\" ! decodebin !
audioconvert ! lame ! appsink name=\"sink\"", uri);
        stream->priv->pipeline = gst_parse_launch (string, NULL);
        g_free (string);

I do not understand why they would be different.

Mike





More information about the gstreamer-devel mailing list