Does "about-to-finish" signal work for video files?
Rossana Guerra
guerra.rossana at gmail.com
Sun Feb 26 13:07:26 PST 2012
thanks, I'll respond as soon as I try.
Cheers
Rossana
2012/2/26 Stefan Kost <ensonic at hora-obscura.de>:
> Am 24.02.2012 00:41, schrieb Rossana Guerra:
>> 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
>
> run your app as
> G_DEBUG="fatal_critials" gdb --args ./myapp <options>
>
> this will terminate the app on that error. WHen that happend type "bt" to get a
> backtrace and you see where the error happend.
>
> Stefan
>
>>
>> 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;
>> }
>>
>>
>>
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
More information about the gstreamer-devel
mailing list