streaming thread and gst_element_set_state in gstreamer

Wonchul Lee chul0812 at gmail.com
Wed Jul 9 17:02:49 PDT 2014


I can't make a proper answer but it might be helpful.

GStreamer thread
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-threads.html

and I got some hints the reason why don't allow to call
gst_element_set_state in streaming threads.

"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. An application
may post custom messages on the pipeline's bus though to communicate
with the main application thread and have it do things like stop the
pipeline."
(this is a part of pad-probe document.
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-dataaccess.html)

2014-07-09 17:11 GMT+09:00 Taeho Oh <ohhara at gmail.com>:
> Hello
>
> I am a newbie in gstreamer and have several questions about gstreamer. I am
> sorry if it is a silly question.
>
> According to
> http://lists.freedesktop.org/archives/gstreamer-devel/2006-July/012776.html
> ( gst_element_set_state hangs ? ), Mike said that
> "You are not - ever - allowed to call gst_element_set_state() from one of
> these streaming threads."
>
> And according to
> http://lists.freedesktop.org/archives/gstreamer-devel/2011-January/030114.html
> ( What is 'streaming thread'? ), 'streaming thread' is any thread not
> created by the application, but by GStreamer.
>
> Q1) In gstreamer user's point of view, where can I meet 'streaming thread'?
> Should I assume that all callback functions(ex. typefind have-type callback,
> pad-added callback, etc) run in 'streaming thread'? Are there any other
> 'streaming thread' cases other than the callback functions?
>
> Q2) Are there any allowed scenarios where gst_element_set_state() can be
> called in the streaming thread?
> I am a little bit confused, because according to
> http://debathena.mit.edu/trac/browser/trunk/third/gstreamer/docs/manual/helloworld2.xml?rev=21005,
> gst_element_set_state() is called in gst_play_have_type callback function.
>
> Q3) Are there any other gstreamer APIs not allowed to be called in the
> 'streaming thread'?
>
> Best regards,
> Taeho
> --
> Taeho Oh ( ohhara at postech.edu )
> http://ohhara.sarang.net
> Postech ( Pohang University of Science and Technology )
> http://www.postech.edu
> Alticast Corp.
> http://www.alticast.com
>
> _______________________________________________
> 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