stop pipeline into a callback funtion.

Guillermo Rodriguez Garcia guille.rodriguez at gmail.com
Thu Sep 17 00:55:24 PDT 2015


Hi Alejandro,

2015-09-16 12:15 GMT+02:00 Alejandro Vázquez <vazlup at gmail.com>:
>> I want to know if it is right to modify the status of a pipeline within a
> callback.
> The application works but I'm not sure if it can cause a problem in the
> future.
>
> e.g.
>
> ...
> GstPad *pad = gst_element_get_static_pad(videoScr, "src");
> g_signal_connect(pad, "notify::caps", G_CALLBACK(video_changed), NULL);
> ...
>
> video_changed
> {
> ...
> gst_element_set_state(GST_ELEMENT(pipeline), GST_STATE_PAUSED);
> ...
> }

The documentation
(http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-dataaccess.html)
says the following regarding "data probes":

"Data probes run in pipeline streaming thread context, so callbacks
should try to not block and generally not do any weird stuff, since
this could have a negative impact on pipeline performance or, in case
of bugs, cause deadlocks or crashes. More precisely, one should
usually not call any GUI-related functions from within a probe
callback, nor try to change the state of the pipeline [...]"

Now what you are using is not a data probe but I do not know if the
same constrains apply. I couldn't find any information on what can and
can't be done from a callback that was registered with
g_signal_connect..

Can anyone shed some light here?

Guillermo


More information about the gstreamer-devel mailing list