Follow-up of https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1505
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1526>
#include <string.h>
-GST_DEBUG_CATEGORY_EXTERN (pbutils_debug);
-#define GST_CAT_DEFAULT pbutils_debug
+#ifndef GST_DISABLE_GST_DEBUG
+#define GST_CAT_DEFAULT gst_pb_utils_codec_utils_ensure_debug_category()
+
+static GstDebugCategory *
+gst_pb_utils_codec_utils_ensure_debug_category (void)
+{
+ static gsize cat_gonce = 0;
+
+ if (g_once_init_enter (&cat_gonce)) {
+ GstDebugCategory *cat = NULL;
+
+ GST_DEBUG_CATEGORY_INIT (cat, "codec-utils", 0,
+ "GstPbUtils codec helper functions");
+
+ g_once_init_leave (&cat_gonce, (gsize) cat);
+ }
+
+ return (GstDebugCategory *) cat_gonce;
+}
+#endif /* GST_DISABLE_GST_DEBUG */
#define GST_SIMPLE_CAPS_HAS_NAME(caps,name) \
gst_structure_has_name(gst_caps_get_structure((caps),0),(name))
#include <string.h>
-GST_DEBUG_CATEGORY_EXTERN (pbutils_debug);
-#define GST_CAT_DEFAULT pbutils_debug
+#ifndef GST_DISABLE_GST_DEBUG
+#define GST_CAT_DEFAULT gst_pb_utils_encoding_profile_ensure_debug_category()
+
+static GstDebugCategory *
+gst_pb_utils_encoding_profile_ensure_debug_category (void)
+{
+ static gsize cat_gonce = 0;
+
+ if (g_once_init_enter (&cat_gonce)) {
+ GstDebugCategory *cat = NULL;
+
+ GST_DEBUG_CATEGORY_INIT (cat, "encoding-profile", 0,
+ "GstPbUtils encoding profile");
+
+ g_once_init_leave (&cat_gonce, (gsize) cat);
+ }
+
+ return (GstDebugCategory *) cat_gonce;
+}
+#endif /* GST_DISABLE_GST_DEBUG */
/* GstEncodingProfile API */
#define PROFILE_LOCK(profile) (g_mutex_lock(&((GstEncodingProfile*)profile)->lock))
/* Documented in encoding-profile.c */
-GST_DEBUG_CATEGORY_EXTERN (pbutils_debug);
-#define GST_CAT_DEFAULT pbutils_debug
+#ifndef GST_DISABLE_GST_DEBUG
+#define GST_CAT_DEFAULT gst_pb_utils_encoding_target_ensure_debug_category()
+
+static GstDebugCategory *
+gst_pb_utils_encoding_target_ensure_debug_category (void)
+{
+ static gsize cat_gonce = 0;
+
+ if (g_once_init_enter (&cat_gonce)) {
+ GstDebugCategory *cat = NULL;
+
+ GST_DEBUG_CATEGORY_INIT (cat, "encoding-target", 0,
+ "GstPbUtils encoding target");
+
+ g_once_init_leave (&cat_gonce, (gsize) cat);
+ }
+
+ return (GstDebugCategory *) cat_gonce;
+}
+#endif /* GST_DISABLE_GST_DEBUG */
#define GST_ENCODING_TARGET_HEADER "GStreamer Encoding Target"
#define GST_ENCODING_TARGET_DIRECTORY "encoding-profiles"
#include <string.h>
+#ifndef GST_DISABLE_GST_DEBUG
+#define GST_CAT_DEFAULT gst_pb_utils_install_plugins_ensure_debug_category()
+
+static GstDebugCategory *
+gst_pb_utils_install_plugins_ensure_debug_category (void)
+{
+ static gsize cat_gonce = 0;
+
+ if (g_once_init_enter (&cat_gonce)) {
+ GstDebugCategory *cat = NULL;
+
+ GST_DEBUG_CATEGORY_INIT (cat, "install-plugins", 0,
+ "GstPbUtils plugins installation helper");
+
+ g_once_init_leave (&cat_gonce, (gsize) cat);
+ }
+
+ return (GstDebugCategory *) cat_gonce;
+}
+#endif /* GST_DISABLE_GST_DEBUG */
+
/* best effort to make things compile and possibly even work on win32 */
#ifndef WEXITSTATUS
# define WEXITSTATUS(status) ((((guint)(status)) & 0xff00) >> 8)
#include <string.h>
+#ifndef GST_DISABLE_GST_DEBUG
+#define GST_CAT_DEFAULT gst_pb_utils_missing_plugins_ensure_debug_category()
+
+static GstDebugCategory *
+gst_pb_utils_missing_plugins_ensure_debug_category (void)
+{
+ static gsize cat_gonce = 0;
+
+ if (g_once_init_enter (&cat_gonce)) {
+ GstDebugCategory *cat = NULL;
+
+ GST_DEBUG_CATEGORY_INIT (cat, "missing-plugins", 0,
+ "GstPbUtils missing plugins helper");
+
+ g_once_init_leave (&cat_gonce, (gsize) cat);
+ }
+
+ return (GstDebugCategory *) cat_gonce;
+}
+#endif /* GST_DISABLE_GST_DEBUG */
+
#define GST_DETAIL_STRING_MARKER "gstreamer"
typedef enum
#include "gst/gst-i18n-plugin.h"
-GST_DEBUG_CATEGORY (pbutils_debug);
-#define GST_CAT_DEFAULT pbutils_debug
+#ifndef GST_DISABLE_GST_DEBUG
+#define GST_CAT_DEFAULT gst_pb_utils_ensure_debug_category()
+
+static GstDebugCategory *
+gst_pb_utils_ensure_debug_category (void)
+{
+ static gsize cat_gonce = 0;
+
+ if (g_once_init_enter (&cat_gonce)) {
+ GstDebugCategory *cat = NULL;
+
+ GST_DEBUG_CATEGORY_INIT (cat, "pbutils", 0, "GStreamer Plugins Base utils");
+
+ g_once_init_leave (&cat_gonce, (gsize) cat);
+ }
+
+ return (GstDebugCategory *) cat_gonce;
+}
+#endif /* GST_DISABLE_GST_DEBUG */
static gpointer
_init_locale_text_domain (gpointer data)
GST_LOG ("already initialised");
return;
}
- GST_DEBUG_CATEGORY_INIT (pbutils_debug, "pbutils", 0,
- "GStreamer Plugins Base utils");
gst_pb_utils_init_locale_text_domain ();
inited = TRUE;