Close a pipeline with g_main_loop_quit() fonction

Rom6 thibault.dumoulin at
Tue Sep 18 16:29:21 UTC 2018

I finaly find how to do, but this solution is particular to my code.

in fact the code just in the post before should be wrote like that : 

    main_loop = g_main_loop_new (NULL, FALSE);
    data.loop = main_loop;
    data.pipeline = pipeline;

    gst_bus_add_signal_watch (bus);
    g_signal_connect (bus, "message", G_CALLBACK (cb_message), &data);

    g_main_loop_run (main_loop);

    /* Free resources */
    g_main_loop_unref (main_loop);
    gst_object_unref (bus);
    gst_element_set_state (pipeline, GST_STATE_NULL);
    gst_object_unref (pipeline);


By putting pthread_exit(NULL) at this place i go out of the streaming
function and go back to the infinty loop in another function wish have for
work to disptach the differents options of the program, and i still in the
stream main loop so i have the streaming in front of me + i can execute all
others options of my software.That's what i wanted to do.

Thanks, bye

Sent from:

More information about the gstreamer-devel mailing list