about-to-finish signal, error when setting uri

Rossana Guerra guerra.rossana at gmail.com
Thu Jan 5 21:35:44 PST 2012


I respond to myself but it could help anyone else. Now it works.
I modified the about-to-finish event, setting the pipeline to ready, once
the uri was set, I change the pipeline state to PLAY again

void about_to_finish_cb (GstElement * element, gpointer * uri)
{
    gst_element_set_state (play, GST_STATE_READY);
    gchar* uri2 = (gchar*)uri;

    g_object_set (G_OBJECT (element), "uri",uri2, NULL);
    gst_element_set_state (play, GST_STATE_PLAYING);
}

Any suggestion are welcome, I don't know if I am doing the right thing.
According to some examples change the pipeline state it woudln't necessary,
but it didn't work for me.

Thanks,

Rossana


2012/1/5 Rossana Guerra <guerra.rossana at gmail.com>

> The code is very simple, a playbin2, with an uri, and the next uri is set
> in the about-to-finish signal.
>
> void about_to_finish_cb (GstElement * element, gpointer * uri)
> {
>     gchar* uri2 = (gchar*)uri;
>     g_object_set (G_OBJECT (element), "uri",uri2, NULL);
> }
>
> I tested it by hardcoding also: g_object_set (G_OBJECT (element),
> "uri","file:///home/videos/video1.avi", NULL); It didn't work either.
>
> Here is the code where I do the callback in the main, the whole code is
> very straight forward, so I think the problem is how I call the
> about-to-finish event.
>
> char uri_next[] = "file:///home/videos/video11.avi";
> g_signal_connect (play, "about-to-finish", G_CALLBACK
> (about_to_finish_cb),uri_next);
> gst_element_set_state (play, GST_STATE_PLAYING);
>
> The error appears in the about_to_finish_cb function, when I try to set
> the new uri: GLib-GObject-CRITICAL **: g_object_set: assertion `G_IS_OBJECT
> (object)' failed
>
> I checked the mailing list but none of the examples suits mine.
>
> Thank you.
>
> Rossana
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120106/04c21368/attachment.html>


More information about the gstreamer-devel mailing list