uridecodebin - creating bin and adding to pipeline

Michael Smith msmith at xiph.org
Thu Oct 20 11:05:48 PDT 2011


On Mon, Oct 3, 2011 at 4:33 AM, Stuart Gray <stuart68 at gmail.com> wrote:
> Hi,
>
> Can someone help me get this right. I want to create a bin which uses
> uridecodebin and then add it to my pipeline. I have certain signal and
> properties I wish to set on uridecodebin, here is the code:
>
>         pipeline = gst_pipeline_new("");
>
>         GstElement* uriDecodebin = gst_bin_new("uridecodebin");

You're creating an (empty) bin called 'uridecodebin'.

You wanted to create an instance of the 'uridecodebin' element (which
you may also have wanted to call 'uridecodebin', but that doesn't
really matter):

   GstElement *uriDecodebin = gst_element_factory_make("uridecodebin", NULL);


>         gst_bin_add(GST_BIN(pipeline), uriDecodebin);
>
>         g_signal_connect(uriDecodebin, "pad-added",
> G_CALLBACK(callbackPadAdded), this);
>         g_signal_connect(uriDecodebin, "drained",
> G_CALLBACK(sourceDrainedCallback), this);
>
>         bool useBuffering = false;
>         g_object_set(G_OBJECT(uriDecodebin),
>                         "buffer-size", 150000,
>                         "download", "false",
>                         "use-buffering", useBuffering,
>                         NULL);

And 'download' is a boolean property - pass a gboolean, not a string, for that.

Mike


More information about the gstreamer-devel mailing list