docs: Initialize the debug category in class_init when possible

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9496>
This commit is contained in:
Nirbheek Chauhan 2025-08-06 17:54:47 +05:30
parent e8e12db5f4
commit 3f1e8835b8
2 changed files with 16 additions and 0 deletions

View File

@ -11880,6 +11880,14 @@ GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");
<doc xml:space="preserve" filename="../subprojects/gstreamer/gst/gstinfo.h">Initializes a new #GstDebugCategory with the given properties and set to
the default threshold.
If your element uses static features, this should be called in
`class_init()` for the feature, and not in `plugin_init()` since that will
not be called if a static feature is registered manually.
If you need to share the same category across multiple features, you can
move the call to a shared function and use #GOnce to make it re-entrant so
that the category is initialized exactly once.
&gt; This macro expands to nothing if debugging is disabled.
&gt;
&gt; When naming your category, please follow the following conventions to ensure

View File

@ -643,6 +643,14 @@ G_STMT_START{ \
* Initializes a new #GstDebugCategory with the given properties and set to
* the default threshold.
*
* If your element uses static features, this should be called in
* `class_init()` for the feature, and not in `plugin_init()` since that will
* not be called if a static feature is registered manually.
*
* If you need to share the same category across multiple features, you can
* move the call to a shared function and use #GOnce to make it re-entrant so
* that the category is initialized exactly once.
*
* > This macro expands to nothing if debugging is disabled.
* >
* > When naming your category, please follow the following conventions to ensure