GNOME Bugzilla – Bug 760979
tracers: Allow adding tracers programatically without defining environment variables
Last modified: 2016-02-22 12:31:12 UTC
It allows us to use GstValidateRunner as a GstTracer in an application, and not only through the GST_TRACER_PLUGINS mechanism.
Created attachment 319544 [details] [review] gst: Concider gst as not initialized after deinit is called Otherwise calling gst_init again will concider Gst is still initialized and do nothing, which is wrong. Also make sure to properly deinitialize GstValue on deinit().
Created attachment 319545 [details] [review] tracer: Initialize GstTracer _priv_tracers and quarks unconditionnally Some people might use tracer hooks even if GST_TRACER_PLUGINS is not set.
Created attachment 319547 [details] [review] gst: Concider gst as not initialized after deinit is called Otherwise calling gst_init again will concider Gst is still initialized and do nothing, which is wrong. Also make sure to properly deinitialize GstValue on deinit().
Comment on attachment 319547 [details] [review] gst: Concider gst as not initialized after deinit is called After discussing it on IRC it looks like this is not handled on purpose (mainly not to have to handle all the corner cases it implies).
Review of attachment 319545 [details] [review]: I'd like to understand your usecase first, so that we don#t break some assumtions in the code.
Review of attachment 319545 [details] [review]: I don't like that with this change we unconditionally initialize the tracing. It was meant to be guarded by the env-var. Would it work if you do g_setenv("GST_TRACERS", "", TRUE); before calling gst_init().
Created attachment 319552 [details] [review] tracer: Initialize GstTracer _priv_tracers and quarks unconditionnally Some people might use tracer hooks even if GST_TRACER_PLUGINS is not set.
@Stefan, Are we good with that last patch? I think we agreed it was all right on IRC.
Ping?
(I am waiting for that to push my GstTracer based GstValidate branch)
The change makes sense to me at least. It allows to enable and add tracers independent of the environment variables via API. Just like we allow with the debugging system.
Note that adding tracers at a later time (when multiple threads are doing GStreamer things already) is racy and can easily cause crashes. That must be mentioned in the documentation. See e.g. GST_TRACER_DISPATCH() accessing the hash table.
Let's get this in then so that the tracer enabled gst-validate can be merged and tested properly for a long enough time before 1.8.0?
Add the documentation improvements before pushing though.
Attachment 319552 [details] pushed as 7e5a892 - tracer: Initialize GstTracer _priv_tracers and quarks unconditionnally
(In reply to Sebastian Dröge (slomo) from comment #14) > Add the documentation improvements before pushing though. Did that.