diff --git a/subprojects/gst-editing-services/ges/ges-asset.c b/subprojects/gst-editing-services/ges/ges-asset.c index 1a9b2a33b0..9abe4095ca 100644 --- a/subprojects/gst-editing-services/ges/ges-asset.c +++ b/subprojects/gst-editing-services/ges/ges-asset.c @@ -129,24 +129,10 @@ #include +GST_DEBUG_CATEGORY_DEFINE_STATIC (ges_asset_dbg, "ges-asset", + GST_DEBUG_FG_BLUE | GST_DEBUG_BOLD, "GES Asset"); #undef GST_CAT_DEFAULT - -#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 = (gsize) _gst_debug_category_new ("ges-asset", - GST_DEBUG_FG_BLUE | GST_DEBUG_BOLD, "GES Asset"); - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#endif /* GST_DISABLE_GST_DEBUG */ +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (ges_asset_dbg) enum { diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gstjpegparser.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gstjpegparser.c index 64110763f2..b33428ca8c 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gstjpegparser.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gstjpegparser.c @@ -35,31 +35,9 @@ #include #include "gstjpegparser.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 ("codecparsers_jpeg", 0, - "GstJpegCodecParser"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else - -#define ensure_debug_category() /* NOOP */ - -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (codecparsers_jpeg_dbg, "codecparsers_jpeg", 0, + "GstJpegCodecParser"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (codecparsers_jpeg_dbg) #define DEBUG_PRINT_COMMENT 0 diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gstmpeg4parser.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gstmpeg4parser.c index 3ee48f4dc9..4f845ed23a 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gstmpeg4parser.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gstmpeg4parser.c @@ -40,32 +40,9 @@ #include "gstmpeg4parser.h" #include "parserutils.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 ("codecparsers_mpeg4", 0, - "GstMpeg4 codec parsing library"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} - -#else - -#define ensure_debug_category() /* NOOP */ - -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (codecparsers_mpeg4_dbg, + "codecparsers_mpeg4", 0, "GstMpeg4 codec parsing library"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (codecparsers_mpeg4_dbg) #define CHECK_MARKER(br) G_STMT_START { \ guint8 marker;\ diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gstvc1parser.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gstvc1parser.c index f9af175a9b..1510b9ea20 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gstvc1parser.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecparsers/gstvc1parser.c @@ -40,32 +40,9 @@ #include #include -#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 ("codecparsers_vc1", 0, - "VC1 codec parsing library"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} - -#else - -#define ensure_debug_category() /* NOOP */ - -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (codecparsers_vc1_dbg, + "codecparsers_vc1", 0, "VC1 codec parsing library"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (codecparsers_vc1_dbg) static const guint8 vc1_pquant_table[3][32] = { { /* Implicit quantizer */ diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9statefulparser.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9statefulparser.c index 950d3e2900..a5f265ba65 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9statefulparser.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9statefulparser.c @@ -69,27 +69,9 @@ #include "gstvp9statefulparser.h" #include -#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 ("codecparsers_vp9stateful", 0, - "VP9 parser library"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else -#define ensure_debug_category() -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (codecparsers_vp9stateful_dbg, + "codecparsers_vp9stateful", 0, "VP9 parser library"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (codecparsers_vp9stateful_dbg) #define VP9_READ_UINT8(val,nbits) G_STMT_START { \ if (!gst_bit_reader_get_bits_uint8 (br, &val, nbits)) { \ diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/cuda/gstcudastream.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/cuda/gstcudastream.cpp index 452977e9a8..ae3a5fb551 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/cuda/gstcudastream.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/cuda/gstcudastream.cpp @@ -26,22 +26,9 @@ #include "gstcudautils.h" #include "gstcuda-private.h" -#ifndef GST_DISABLE_GST_DEBUG -#define GST_CAT_DEFAULT ensure_debug_category() -static GstDebugCategory * -ensure_debug_category (void) -{ - static GstDebugCategory *cat = nullptr; - - GST_CUDA_CALL_ONCE_BEGIN { - cat = _gst_debug_category_new ("cudastream", 0, "cudastream"); - } GST_CUDA_CALL_ONCE_END; - - return cat; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (cudastream_dbg, "cudastream", 0, + "cudastream"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (cudastream_dbg) static gint gst_cuda_stream_compare_func (const GstCudaStream * a, const GstCudaStream * b) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11compile.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11compile.cpp index b412847806..9751b0b849 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11compile.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11compile.cpp @@ -43,22 +43,9 @@ using namespace Microsoft::WRL; /* *INDENT-ON* */ -#ifndef GST_DISABLE_GST_DEBUG -#define GST_CAT_DEFAULT ensure_debug_category() -static GstDebugCategory * -ensure_debug_category (void) -{ - static GstDebugCategory *cat = nullptr; - - GST_D3D11_CALL_ONCE_BEGIN { - cat = _gst_debug_category_new ("d3d11compile", 0, "d3d11compile"); - } GST_D3D11_CALL_ONCE_END; - - return cat; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (d3d11_compile_dbg, + "d3d11compile", 0, "d3d11compile"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (d3d11_compile_dbg) /** * gst_d3d11_compile_init: diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11format.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11format.cpp index b001e3ad06..4c6a27714b 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11format.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11format.cpp @@ -37,22 +37,9 @@ * Since: 1.22 */ -#ifndef GST_DISABLE_GST_DEBUG -#define GST_CAT_DEFAULT ensure_debug_category() -static GstDebugCategory * -ensure_debug_category (void) -{ - static GstDebugCategory *cat = nullptr; - - GST_D3D11_CALL_ONCE_BEGIN { - cat = _gst_debug_category_new ("d3d11format", 0, "d3d11 specific formats"); - } GST_D3D11_CALL_ONCE_END; - - return cat; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (d3d11_format_dbg, + "d3d11format", 0, "d3d11 specific formats"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (d3d11_format_dbg) GType gst_d3d11_format_support_get_type (void) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11utils.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11utils.cpp index e9239c1fdd..d8951e31f4 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11utils.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11utils.cpp @@ -44,22 +44,9 @@ static std::recursive_mutex _context_lock; /* *INDENT-ON* */ GST_DEBUG_CATEGORY_STATIC (GST_CAT_CONTEXT); -#ifndef GST_DISABLE_GST_DEBUG -#define GST_CAT_DEFAULT ensure_debug_category() -static GstDebugCategory * -ensure_debug_category (void) -{ - static GstDebugCategory *cat = nullptr; - - GST_D3D11_CALL_ONCE_BEGIN { - cat = _gst_debug_category_new ("d3d11utils", 0, "d3d11 utility functions"); - } GST_D3D11_CALL_ONCE_END; - - return cat; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (d3d11_utils_dbg, + "d3d11utils", 0, "d3d11 utility functions"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (d3d11_utils_dbg) static void _init_context_debug (void) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12device.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12device.cpp index 2b82e490c7..4bf5b08746 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12device.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12device.cpp @@ -44,20 +44,9 @@ #include GST_DEBUG_CATEGORY_STATIC (gst_d3d12_sdk_debug); - -#ifndef GST_DISABLE_GST_DEBUG -#define GST_CAT_DEFAULT ensure_debug_category() -static GstDebugCategory * -ensure_debug_category (void) -{ - static GstDebugCategory *cat = nullptr; - GST_D3D12_CALL_ONCE_BEGIN { - cat = _gst_debug_category_new ("d3d12device", 0, "d3d12device"); - } GST_D3D12_CALL_ONCE_END; - - return cat; -} -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (d3d12_device_dbg, + "d3d12device", 0, "d3d12device"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (d3d12_device_dbg) static PFN_D3D11ON12_CREATE_DEVICE GstD3D11On12CreateDevice = nullptr; diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12format.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12format.cpp index 9e835ed65c..1e5b554c95 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12format.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12format.cpp @@ -25,20 +25,9 @@ #include "gstd3d12-private.h" #include -#ifndef GST_DISABLE_GST_DEBUG -#define GST_CAT_DEFAULT ensure_debug_category() -static GstDebugCategory * -ensure_debug_category (void) -{ - static GstDebugCategory *cat = nullptr; - - GST_D3D12_CALL_ONCE_BEGIN { - cat = _gst_debug_category_new ("d3d12format", 0, "d3d12format"); - } GST_D3D12_CALL_ONCE_END; - - return cat; -} -#endif +GST_DEBUG_CATEGORY_DEFINE_STATIC (d3d12_format_dbg, + "d3d12format", 0, "d3d12format"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (d3d12_format_dbg) GstVideoFormat gst_d3d12_dxgi_format_to_gst (DXGI_FORMAT format) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12frame.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12frame.cpp index 6a8fc06bd9..a547f87586 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12frame.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12frame.cpp @@ -34,20 +34,9 @@ using namespace Microsoft::WRL; /* *INDENT-ON* */ -#ifndef GST_DISABLE_GST_DEBUG -#define GST_CAT_DEFAULT ensure_debug_category() -static GstDebugCategory * -ensure_debug_category (void) -{ - static GstDebugCategory *cat = nullptr; - - GST_D3D12_CALL_ONCE_BEGIN { - cat = _gst_debug_category_new ("d3d12frame", 0, "d3d12frame"); - } GST_D3D12_CALL_ONCE_END; - - return cat; -} -#endif +GST_DEBUG_CATEGORY_DEFINE_STATIC (d3d12_frame_dbg, + "d3d12frame", 0, "d3d12frame"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (d3d12_frame_dbg) /** * gst_d3d12_frame_map: diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12memory.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12memory.cpp index 3144645a32..4e4ea57ef2 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12memory.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12memory.cpp @@ -41,20 +41,9 @@ using namespace Microsoft::WRL; /* *INDENT-ON* */ -#ifndef GST_DISABLE_GST_DEBUG -#define GST_CAT_DEFAULT ensure_debug_category() -static GstDebugCategory * -ensure_debug_category (void) -{ - static GstDebugCategory *cat = nullptr; - - GST_D3D12_CALL_ONCE_BEGIN { - cat = _gst_debug_category_new ("d3d12allocator", 0, "d3d12allocator"); - } GST_D3D12_CALL_ONCE_END; - - return cat; -} -#endif +GST_DEBUG_CATEGORY_DEFINE (d3d12_allocator_dbg, "d3d12allocator", 0, + "d3d12allocator"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (d3d12_allocator_dbg) static GstD3D12Allocator *_d3d12_memory_allocator = nullptr; diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12utils.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12utils.cpp index 40fea6e643..723be50738 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12utils.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/d3d12/gstd3d12utils.cpp @@ -31,21 +31,8 @@ static std::recursive_mutex context_lock_; /* *INDENT-ON* */ GST_DEBUG_CATEGORY_STATIC (GST_CAT_CONTEXT); - -#ifndef GST_DISABLE_GST_DEBUG -#define GST_CAT_DEFAULT ensure_debug_category() -static GstDebugCategory * -ensure_debug_category (void) -{ - static GstDebugCategory *cat = nullptr; - - GST_D3D12_CALL_ONCE_BEGIN { - cat = _gst_debug_category_new ("d3d12allocator", 0, "d3d12allocator"); - } GST_D3D12_CALL_ONCE_END; - - return cat; -} -#endif +GST_DEBUG_CATEGORY_EXTERN (d3d12_allocator_dbg); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (d3d12_allocator_dbg) static void init_context_debug (void) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/d3dshader/gstd3dcompile.cpp b/subprojects/gst-plugins-bad/gst-libs/gst/d3dshader/gstd3dcompile.cpp index d47f8dc33c..194eb2f091 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/d3dshader/gstd3dcompile.cpp +++ b/subprojects/gst-plugins-bad/gst-libs/gst/d3dshader/gstd3dcompile.cpp @@ -35,21 +35,8 @@ * Since: 1.26 */ -#ifndef GST_DISABLE_GST_DEBUG -#define GST_CAT_DEFAULT ensure_debug_category() -static GstDebugCategory * -ensure_debug_category (void) -{ - static GstDebugCategory *cat = nullptr; - static std::once_flag cat_once; - - std::call_once (cat_once, [&]() { - cat = _gst_debug_category_new ("d3dcompile", 0, "d3dcompile"); - }); - - return cat; -} -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (d3d_compile_dbg, "d3dcompile", 0, "d3dcompile"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (d3d_compile_dbg) static GModule *d3d_compiler_module = nullptr; static pD3DCompile GstD3DCompileFunc = nullptr; diff --git a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12decoder.cpp b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12decoder.cpp index dd058ddaa6..155da64ea2 100644 --- a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12decoder.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12decoder.cpp @@ -37,20 +37,9 @@ #include #include -#ifndef GST_DISABLE_GST_DEBUG -#define GST_CAT_DEFAULT ensure_debug_category() -static GstDebugCategory * -ensure_debug_category (void) -{ - static GstDebugCategory *cat = nullptr; - - GST_D3D12_CALL_ONCE_BEGIN { - cat = _gst_debug_category_new ("d3d12decoder", 0, "d3d12decoder"); - } GST_D3D12_CALL_ONCE_END; - - return cat; -} -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (d3d12_decoder_dbg, + "d3d12decoder", 0, "d3d12decoder"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (d3d12_decoder_dbg) struct DecoderFormat { diff --git a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12pluginutils.cpp b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12pluginutils.cpp index b0ad739845..b50df00b54 100644 --- a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12pluginutils.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12pluginutils.cpp @@ -32,20 +32,9 @@ using namespace DirectX; /* *INDENT-ON* */ -#ifndef GST_DISABLE_GST_DEBUG -#define GST_CAT_DEFAULT ensure_debug_category() -static GstDebugCategory * -ensure_debug_category (void) -{ - static GstDebugCategory *cat = nullptr; - - GST_D3D12_CALL_ONCE_BEGIN { - cat = _gst_debug_category_new ("d3d12pluginutils", 0, "d3d12pluginutils"); - } GST_D3D12_CALL_ONCE_END; - - return cat; -} -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (d3d12_plugin_utils_dbg, + "d3d12pluginutils", 0, "d3d12pluginutils"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (d3d12_plugin_utils_dbg) GType gst_d3d12_sampling_method_get_type (void) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channel-mixer.c b/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channel-mixer.c index 2359eae3b6..2d7ffe4ce2 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channel-mixer.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channel-mixer.c @@ -29,28 +29,9 @@ #include "audio-channel-mixer.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 ("audio-channel-mixer", 0, - "audio-channel-mixer object"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ - +GST_DEBUG_CATEGORY_DEFINE_STATIC (audio_channel_mixer_dbg, + "audio-channel-mixer", 0, "audio-channel-mixer object"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (audio_channel_mixer_dbg) #define PRECISION_INT 10 diff --git a/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channels.c b/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channels.c index ea1b533c7f..888019b497 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channels.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-channels.c @@ -32,28 +32,9 @@ #include "audio-channels.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 ("audio-channels", 0, - "audio-channels object"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ - +GST_DEBUG_CATEGORY_DEFINE_STATIC (audio_channels_dbg, "audio-channels", 0, + "audio-channels object"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (audio_channels_dbg) static const GstAudioChannelPosition default_channel_order[64] = { GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT, diff --git a/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-converter.c b/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-converter.c index 13d8e5511f..ae9fca4cd1 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-converter.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-converter.c @@ -46,27 +46,9 @@ * */ -#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 ("audio-converter", 0, - "audio-converter object"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (audio_converter_dbg, "audio-converter", 0, + "audio-converter object"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (audio_converter_dbg) typedef struct _AudioChain AudioChain; diff --git a/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-info.c b/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-info.c index 13bbb4b979..c0d7805414 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-info.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/audio/audio-info.c @@ -27,28 +27,9 @@ #include -#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 ("audio-info", 0, - "audio-info object"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ - +GST_DEBUG_CATEGORY_DEFINE_STATIC (audio_info_dbg, "audio-info", 0, + "audio-info object"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (audio_info_dbg) /** * gst_audio_info_copy: diff --git a/subprojects/gst-plugins-base/gst-libs/gst/audio/audio.c b/subprojects/gst-plugins-base/gst-libs/gst/audio/audio.c index 1180326c92..0121c4de50 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/audio/audio.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/audio/audio.c @@ -33,27 +33,8 @@ #include "audio.h" #include "audio-enumtypes.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 ("audio", 0, "audio library"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ - +GST_DEBUG_CATEGORY_DEFINE_STATIC (audio_dbg, "audio", 0, "audio library"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (audio_dbg) /** * gst_audio_buffer_clip: diff --git a/subprojects/gst-plugins-base/gst-libs/gst/audio/gstdsd.c b/subprojects/gst-plugins-base/gst-libs/gst/audio/gstdsd.c index 9b17509006..9638bdd2f9 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/audio/gstdsd.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/audio/gstdsd.c @@ -24,26 +24,8 @@ #include #include "gstdsd.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 ("gst-dsd", 0, "GStreamer DSD"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (gst_dsd_dbg, "gst-dsd", 0, "GStreamer DSD"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (gst_dsd_dbg) static const guint8 byte_bit_reversal_table[256] = { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, diff --git a/subprojects/gst-plugins-base/gst-libs/gst/tag/gstid3tag.c b/subprojects/gst-plugins-base/gst-libs/gst/tag/gstid3tag.c index d845114d5b..80a38bc2f6 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/tag/gstid3tag.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/tag/gstid3tag.c @@ -41,9 +41,8 @@ #include "id3v2.h" -#ifndef GST_DISABLE_GST_DEBUG -#define GST_CAT_DEFAULT id3v2_ensure_debug_category() -#endif +GST_DEBUG_CATEGORY_EXTERN (id3v2_dbg); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (id3v2_dbg) static const gchar genres[] = "Blues\000Classic Rock\000Country\000Dance\000Disco\000Funk\000Grunge\000" diff --git a/subprojects/gst-plugins-base/gst-libs/gst/tag/id3v2.c b/subprojects/gst-plugins-base/gst-libs/gst/tag/id3v2.c index 7db2cb7e12..5b52f8ddf2 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/tag/id3v2.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/tag/id3v2.c @@ -31,27 +31,8 @@ static gboolean id3v2_frames_to_tag_list (ID3TagsWorking * work, guint size); -#ifndef GST_DISABLE_GST_DEBUG - -#define GST_CAT_DEFAULT id3v2_ensure_debug_category() - -GstDebugCategory * -id3v2_ensure_debug_category (void) -{ - static gsize cat_gonce = 0; - - if (g_once_init_enter (&cat_gonce)) { - gsize cat; - - cat = (gsize) _gst_debug_category_new ("id3v2", 0, "ID3v2 tag parsing"); - - g_once_init_leave (&cat_gonce, cat); - } - - return (GstDebugCategory *) cat_gonce; -} - -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE (id3v2_dbg, "id3v2", 0, "ID3v2 tag parsing"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (id3v2_dbg) /* Synch safe uints have 28 bits (256MB max) available. */ guint diff --git a/subprojects/gst-plugins-base/gst-libs/gst/tag/id3v2frames.c b/subprojects/gst-plugins-base/gst-libs/gst/tag/id3v2frames.c index f39659bf7c..a28d304a45 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/tag/id3v2frames.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/tag/id3v2frames.c @@ -35,9 +35,8 @@ #include "id3v2.h" -#ifndef GST_DISABLE_GST_DEBUG -#define GST_CAT_DEFAULT id3v2_ensure_debug_category() -#endif +GST_DEBUG_CATEGORY_EXTERN (id3v2_dbg); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (id3v2_dbg) static gboolean parse_comment_frame (ID3TagsWorking * work); static gchar *parse_url_link_frame (ID3TagsWorking * work, diff --git a/subprojects/gst-plugins-base/gst-libs/gst/tag/lang.c b/subprojects/gst-plugins-base/gst-libs/gst/tag/lang.c index 50ed53faba..2f9d6588a2 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/tag/lang.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/tag/lang.c @@ -47,32 +47,9 @@ #include "tag.h" #include "lang-tables.dat" -#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 ("tag-langcodes", 0, - "GstTag language codes and names"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} - -#else - -#define ensure_debug_category() /* NOOP */ - -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (tag_langcodes_dbg, "tag-langcodes", 0, + "GstTag language codes and names"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (tag_langcodes_dbg) /* ------------------------------------------------------------------------- */ @@ -276,8 +253,6 @@ gst_tag_get_language_codes (void) gchar **codes; int i; - ensure_debug_category (); - ht = gst_tag_get_iso_639_ht (); /* we have at least two keys for each language (-1 code and -2 code) */ @@ -325,8 +300,6 @@ gst_tag_get_language_name (const gchar * language_code) g_return_val_if_fail (language_code != NULL, NULL); - ensure_debug_category (); - ht = gst_tag_get_iso_639_ht (); lang_name = g_hash_table_lookup (ht, (gpointer) language_code); @@ -357,8 +330,6 @@ gst_tag_get_language_code_iso_639_1 (const gchar * lang_code) g_return_val_if_fail (lang_code != NULL, NULL); - ensure_debug_category (); - /* FIXME: we are being a bit inconsistent here in the sense that will only * map the language codes from our static table. Theoretically the iso-codes * XML file might have had additional codes that are now in the hash table. @@ -440,8 +411,6 @@ gst_tag_get_language_code_iso_639_2T (const gchar * lang_code) g_return_val_if_fail (lang_code != NULL, NULL); - ensure_debug_category (); - c = gst_tag_get_language_code_iso_639_2X (lang_code, ISO_639_FLAG_2T); GST_LOG ("%s -> %s", lang_code, GST_STR_NULL (c)); @@ -474,8 +443,6 @@ gst_tag_get_language_code_iso_639_2B (const gchar * lang_code) g_return_val_if_fail (lang_code != NULL, NULL); - ensure_debug_category (); - c = gst_tag_get_language_code_iso_639_2X (lang_code, ISO_639_FLAG_2B); GST_LOG ("%s -> %s", lang_code, GST_STR_NULL (c)); diff --git a/subprojects/gst-plugins-base/gst-libs/gst/tag/licenses.c b/subprojects/gst-plugins-base/gst-libs/gst/tag/licenses.c index d0eea1e859..fdd2baddc2 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/tag/licenses.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/tag/licenses.c @@ -43,32 +43,9 @@ #include "tag.h" #include "licenses-tables.dat" -#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 ("tag-licenses", 0, - "GstTag licenses"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} - -#else - -#define ensure_debug_category() /* NOOP */ - -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (tag_licenses_dbg, "tag-licenses", 0, + "GstTag licenses"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (tag_licenses_dbg) /* ------------------------------------------------------------------------- * Translations diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/convertframe.c b/subprojects/gst-plugins-base/gst-libs/gst/video/convertframe.c index fd14c6b4f4..771393d79f 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/convertframe.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/convertframe.c @@ -28,27 +28,9 @@ #include #endif -#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 ("video-frame-converter", 0, - "video-frame-converter object"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (video_frame_converter_dbg, + "video-frame-converter", 0, "video-frame-converter object"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (video_frame_converter_dbg) static gboolean caps_are_raw (const GstCaps * caps) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideometa.c b/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideometa.c index f191820818..0c550b7bf4 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideometa.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/gstvideometa.c @@ -38,26 +38,8 @@ default_map (GstVideoMeta * meta, guint plane, GstMapInfo * info, static gboolean default_unmap (GstVideoMeta * meta, guint plane, GstMapInfo * info); -#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 ("videometa", 0, "videometa"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (videometa_dbg, "videometa", 0, "videometa"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (videometa_dbg) static gboolean gst_video_meta_init (GstMeta * meta, gpointer params, GstBuffer * buffer) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-anc.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-anc.c index 2cce8359c5..9b6ebd9141 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-anc.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-anc.c @@ -40,27 +40,9 @@ * present in Vertical Blanking Interval as well as Closed Caption. */ -#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 ("video-anc", 0, - "Ancillary data, VBI and CC utilities"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (video_anc_dbg, "video-anc", 0, + "Ancillary data, VBI and CC utilities"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (video_anc_dbg) struct _GstVideoVBIParser { diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-blend.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-blend.c index 67e7b91ce5..a204ed6aa5 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-blend.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-blend.c @@ -32,32 +32,9 @@ #include -#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 ("video-blending", 0, - "video blending"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} - -#else - -#define ensure_debug_category() /* NOOP */ - -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (video_blending_dbg, "video-blending", 0, + "video blending"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (video_blending_dbg) static void matrix_identity (guint8 * tmpline, guint width) @@ -320,8 +297,6 @@ gst_video_blend (GstVideoFrame * dest, dest_width = GST_VIDEO_FRAME_WIDTH (dest); dest_height = GST_VIDEO_FRAME_HEIGHT (dest); - ensure_debug_category (); - GST_LOG ("blend src %dx%d onto dest %dx%d @ %d,%d", src_width, src_height, dest_width, dest_height, x, y); diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-chroma.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-chroma.c index aef70bc3cb..a1bfb59ba3 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-chroma.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-chroma.c @@ -41,27 +41,9 @@ * */ -#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 ("video-chroma", 0, - "video-chroma object"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (video_chroma_dbg, "video-chroma", 0, + "video-chroma object"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (video_chroma_dbg) typedef struct { diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-color.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-color.c index 90fa380b18..a8c17484f0 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-color.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-color.c @@ -29,27 +29,9 @@ #include "video-color.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 ("video-color", 0, - "video-color object"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (video_color_dbg, "video-color", 0, + "video-color object"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (video_color_dbg) typedef struct { diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-converter.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-converter.c index 57e84835bd..f86c60a7da 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-converter.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-converter.c @@ -94,27 +94,9 @@ * 10 : a -> b -> c -> d -> e* -> f* -> g* -> h -> i -> j -> k */ -#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 ("video-converter", 0, - "video-converter object"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (video_converter_dbg, "video-converter", 0, + "video-converter object"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (video_converter_dbg) typedef void (*GstParallelizedTaskFunc) (gpointer user_data); diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-info-dma.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-info-dma.c index c2d7d4848b..6e2fec5bb6 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-info-dma.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-info-dma.c @@ -151,28 +151,9 @@ */ #define DRM_FORMAT_MOD_INVALID 0xffffffffffffff - -#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 ("video-info-dma-drm", 0, - "video-info-dma-drm structure"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (video_info_dma_drm_dbg, "video-info-dma-drm", + 0, "video-info-dma-drm structure"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (video_info_dma_drm_dbg) static GstVideoInfoDmaDrm * gst_video_info_dma_drm_copy (const GstVideoInfoDmaDrm * drm_info) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c index 64ee0ff183..00f81e72b0 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-info.c @@ -35,27 +35,9 @@ #include "video-info.h" #include "video-tile.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 ("video-info", 0, - "video-info structure"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (video_info_dbg, "video-info", 0, + "video-info structure"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (video_info_dbg) /** * gst_video_info_copy: diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-overlay-composition.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-overlay-composition.c index c6cfc8b4c1..63562fd094 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-overlay-composition.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-overlay-composition.c @@ -144,32 +144,9 @@ struct _GstVideoOverlayRectangle /* --------------------------- utility functions --------------------------- */ -#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 ("video-composition", 0, - "video overlay composition"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} - -#else - -#define ensure_debug_category() /* NOOP */ - -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (video_composition_dbg, "video-composition", 0, + "video overlay composition"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (video_composition_dbg) static guint gst_video_overlay_get_seqnum (void) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-resampler.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-resampler.c index 119343f99d..538b67fb6b 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-resampler.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-resampler.c @@ -27,27 +27,9 @@ #include "video-resampler.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 ("video-resampler", 0, - "video-resampler object"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (video_resampler_dbg, "video-resampler", 0, + "video-resampler object"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (video_resampler_dbg) /** * SECTION:gstvideoresampler diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-scaler.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-scaler.c index d645087719..171c0479d2 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-scaler.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-scaler.c @@ -44,28 +44,9 @@ #include "video-orc.h" #include "video-scaler.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 ("video-scaler", 0, - "video-scaler object"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} - -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (video_scaler_dbg, "video-scaler", 0, + "video-scaler object"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (video_scaler_dbg) #define SCALE_U8 12 #define SCALE_U8_ROUND (1 << (SCALE_U8 -1)) diff --git a/subprojects/gst-plugins-base/gst-libs/gst/video/video-sei.c b/subprojects/gst-plugins-base/gst-libs/gst/video/video-sei.c index 0b981c4076..a4b8c4a7d3 100644 --- a/subprojects/gst-plugins-base/gst-libs/gst/video/video-sei.c +++ b/subprojects/gst-plugins-base/gst-libs/gst/video/video-sei.c @@ -37,27 +37,9 @@ * Since: 1.22 */ -#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 ("video-sei", 0, - "H.264 / H.265 SEI messages utilities"); - - g_once_init_leave (&cat_gonce, cat_done); - } - - return (GstDebugCategory *) cat_gonce; -} -#else -#define ensure_debug_category() /* NOOP */ -#endif /* GST_DISABLE_GST_DEBUG */ +GST_DEBUG_CATEGORY_DEFINE_STATIC (video_sei_dbg, "video-sei", 0, + "H.264 / H.265 SEI messages utilities"); +#define GST_CAT_DEFAULT GST_DEBUG_CATEGORY_LAZY_INIT (video_sei_dbg) /* SEI User Data Unregistered implementation */