codecparsers: add debug categories to bitwriters
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Fri, 11 Oct 2024 16:07:27 +0000 (12:07 -0400)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 17 Oct 2024 12:55:05 +0000 (12:55 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7667>

subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gstav1bitwriter.c
subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth264bitwriter.c
subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gsth265bitwriter.c

index 4fe133f44ecca660efeb84dec207efe51e3b1e1f..f54181d77a80742ff8a490e57caa67235235c15b 100644 (file)
 #include "gstav1bitwriter.h"
 #include <gst/base/gstbitwriter.h>
 
+#ifndef GST_DISABLE_GST_DEBUG
+#define GST_CAT_DEFAULT gst_av1_debug_category_get()
+static GstDebugCategory *
+gst_av1_debug_category_get (void)
+{
+  static gsize cat_gonce = 0;
+
+  if (g_once_init_enter (&cat_gonce)) {
+    GstDebugCategory *cat = NULL;
+
+    GST_DEBUG_CATEGORY_INIT (cat, "bitwriter_av1", 0, "av1 bitwriter library");
+
+    g_once_init_leave (&cat_gonce, (gsize) cat);
+  }
+
+  return (GstDebugCategory *) cat_gonce;
+}
+#endif /* GST_DISABLE_GST_DEBUG */
+
 #define WRITE_BITS_UNCHECK(bw, val, nbits)                                    \
   (nbits <= 8 ? gst_bit_writer_put_bits_uint8 (bw, val, nbits) :              \
    (nbits <= 16 ? gst_bit_writer_put_bits_uint16 (bw, val, nbits) :           \
index 543a37a1b550f225ae39fc2b3d4551990b0102c7..9eff9146fecb8b61598ac026dceb8a2586616843 100644 (file)
 #include <gst/codecparsers/nalutils.h>
 #include <gst/base/gstbitwriter.h>
 
+#ifndef GST_DISABLE_GST_DEBUG
+#define GST_CAT_DEFAULT gst_h264_debug_category_get()
+static GstDebugCategory *
+gst_h264_debug_category_get (void)
+{
+  static gsize cat_gonce = 0;
+
+  if (g_once_init_enter (&cat_gonce)) {
+    GstDebugCategory *cat = NULL;
+
+    GST_DEBUG_CATEGORY_INIT (cat, "bitwriter_h264", 0,
+        "h264 bitwriter library");
+
+    g_once_init_leave (&cat_gonce, (gsize) cat);
+  }
+
+  return (GstDebugCategory *) cat_gonce;
+}
+#endif /* GST_DISABLE_GST_DEBUG */
+
 /********************************  Utils ********************************/
 #define SIGNED(val)    (2 * ABS(val) - ((val) > 0))
 
index a175a9c2b2dcdadebf5c45f6deff0908544edb62..78a2d58a2b0b8ce6c55697a93331b2c053552f23 100644 (file)
 #include <gst/base/gstbitwriter.h>
 #include <math.h>
 
+#ifndef GST_DISABLE_GST_DEBUG
+#define GST_CAT_DEFAULT gst_h265_debug_category_get()
+static GstDebugCategory *
+gst_h265_debug_category_get (void)
+{
+  static gsize cat_gonce = 0;
+
+  if (g_once_init_enter (&cat_gonce)) {
+    GstDebugCategory *cat = NULL;
+
+    GST_DEBUG_CATEGORY_INIT (cat, "bitwriter_h265", 0,
+        "h265 bitwriter library");
+
+    g_once_init_leave (&cat_gonce, (gsize) cat);
+  }
+
+  return (GstDebugCategory *) cat_gonce;
+}
+#endif /* GST_DISABLE_GST_DEBUG */
+
 /********************************  Utils ********************************/
 #define SIGNED(val)    (2 * ABS(val) - ((val) > 0))