about-to-finish signal, error when setting uri

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

about-to-finish signal, error when setting uri

rossana
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

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: about-to-finish signal, error when setting uri

rossana
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 <[hidden email]>
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


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel