From b6c72808685709dca8e82ac42e30c373c6087c5b Mon Sep 17 00:00:00 2001 From: Philippe Normand Date: Thu, 10 Oct 2024 15:51:36 -0400 Subject: [PATCH] sdp: Add debug categories for message and mikey modules Part-of: --- .../gst-libs/gst/sdp/gstmikey.c | 21 +++++++++++++++++++ .../gst-libs/gst/sdp/gstsdpmessage.c | 21 +++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstmikey.c b/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstmikey.c index e71117c067..c23dc2e135 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstmikey.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstmikey.c @@ -37,6 +37,27 @@ #include "gstmikey.h" +#ifndef GST_DISABLE_GST_DEBUG +#define GST_CAT_DEFAULT ensure_debug_category() +static GstDebugCategory * +ensure_debug_category (void) +{ + static gsize cat_gonce = 0; + + if (g_once_init_enter (&cat_gonce)) { + gsize cat_done; + + cat_done = (gsize) _gst_debug_category_new ("sdpmikey", 0, "SDP mikey"); + + g_once_init_leave (&cat_gonce, cat_done); + } + + return (GstDebugCategory *) cat_gonce; +} +#else +#define ensure_debug_category() /* NOOP */ +#endif /* GST_DISABLE_GST_DEBUG */ + GST_DEFINE_MINI_OBJECT_TYPE (GstMIKEYPayload, gst_mikey_payload); GST_DEFINE_MINI_OBJECT_TYPE (GstMIKEYMessage, gst_mikey_message); diff --git a/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.c b/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.c index 2b958fd489..96ed5fd5a2 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/sdp/gstsdpmessage.c @@ -64,6 +64,27 @@ #include #include "gstsdpmessage.h" +#ifndef GST_DISABLE_GST_DEBUG +#define GST_CAT_DEFAULT ensure_debug_category() +static GstDebugCategory * +ensure_debug_category (void) +{ + static gsize cat_gonce = 0; + + if (g_once_init_enter (&cat_gonce)) { + gsize cat_done; + + cat_done = (gsize) _gst_debug_category_new ("sdpmessage", 0, "SDP message"); + + g_once_init_leave (&cat_gonce, cat_done); + } + + return (GstDebugCategory *) cat_gonce; +} +#else +#define ensure_debug_category() /* NOOP */ +#endif /* GST_DISABLE_GST_DEBUG */ + #define FREE_STRING(field) g_free (field); (field) = NULL #define REPLACE_STRING(field, val) FREE_STRING(field); (field) = g_strdup (val)