stop pipeline into a callback funtion.
Alejandro Vázquez
vazlup at gmail.com
Thu Sep 17 01:57:58 PDT 2015
Hi all.
No need to shut down the pipeline but there is there any way to pause
or stop the dataflow immediately from the callback ?
I am trying to detect a situation that triggers a bug in a videosink.
When I detect this I must make sure that the dataflow is stopped
immediately so that the bug is not triggered.
Cheers
2015-09-17 10:27 GMT+02:00 Tim Müller <tim at centricular.com>:
> On Thu, 2015-09-17 at 09:55 +0200, Guillermo Rodriguez Garcia wrote:
>
>
>
> > 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?
>
> Most signal callbacks on GStreamer objects (other than GstBus::message)
> will be emitted from a streaming thread. The notify::caps callback is
> one of those that gets emitted from a streaming thread. You can't shut
> down the pipeline or change global pipeline state from that callback.
>
> What are you trying to do (big picture)?
>
> Cheers
> -Tim
>
> --
> Tim Müller, Centricular Ltd - http://www.centricular.com
>
> Join us at the GStreamer Conference: 8-9 October 2015 in Dublin, Ireland
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150917/63c8a511/attachment.html>
More information about the gstreamer-devel
mailing list