Does "about-to-finish" signal work for video files?

Rossana Guerra guerra.rossana at gmail.com
Thu Feb 23 15:41:21 PST 2012


Hello everyone, I am trying to solve the gapless issue programming the
event triggered for that signal. I am handling video files (.avi)
The code is very straightforward andn simple, nonetheless it doesn't work.
It plays the first and for the second one it throws the following message:

(playbin:4324): GLib-GObject-CRITICAL **: g_object_set: assertion
`G_IS_OBJECT (object)' failed

Any suggestion? thansks

Rossana

Here is the code:


void about_to_finish_cb (GstElement * element, gpointer * uri)
{
   // uri has the name of the next avi file

    gchar* uri2 = (gchar*)uri;
    g_object_set (G_OBJECT (element), "uri",uri2, NULL);
    g_object_set (G_OBJECT (element),
"suburi","file:///home/rossana/video3.srt", NULL);

}

gint main (gint argc, gchar *argv[])
{
    GMainLoop *loop = 0;
    GstElement *play = 0;
    GstBus *bus = 0;


    /* set up */
    gst_init (&argc, &argv);

    loop = g_main_loop_new (NULL, FALSE);
    play = gst_element_factory_make ("playbin2", "play");

    g_object_set (G_OBJECT (play), "uri","file:///home/rossana/video1.avi",
NULL);

    bus = gst_pipeline_get_bus (GST_PIPELINE (play));
    gst_bus_add_watch (bus, bus_call, loop);
    gst_object_unref (bus);

    char uri_next[] = "file:///home/rossana/video3.avi";
    g_signal_connect (play, "about-to-finish", G_CALLBACK
(about_to_finish_cb),uri_next);
    gst_element_set_state (play, GST_STATE_PLAYING);

    /* now run */
    g_main_loop_run (loop);

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

    return 0;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120223/9649af15/attachment.html>


More information about the gstreamer-devel mailing list