mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
codecparsers: add debug categories to bitwriters
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7653>
This commit is contained in:
parent
15c990a8d8
commit
0e9634e17c
4 changed files with 78 additions and 0 deletions
|
@ -25,6 +25,25 @@
|
|||
#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) : \
|
||||
|
|
|
@ -26,6 +26,26 @@
|
|||
#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))
|
||||
|
||||
|
|
|
@ -27,6 +27,26 @@
|
|||
#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))
|
||||
|
||||
|
|
|
@ -25,6 +25,25 @@
|
|||
#include "gstvp9bitwriter.h"
|
||||
#include <gst/base/gstbitwriter.h>
|
||||
|
||||
#ifndef GST_DISABLE_GST_DEBUG
|
||||
#define GST_CAT_DEFAULT gst_vp9_debug_category_get()
|
||||
static GstDebugCategory *
|
||||
gst_vp9_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_vp9", 0, "vp9 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) : \
|
||||
|
|
Loading…
Reference in a new issue