New API: Use GST_DEBUG_CATEGORY_LAZY_INIT() across the libraries

This removes a lot of code duplication, and also gives some
micro-speedup, since ensure_debug_category() is slower then
_gst_atomic_pointer_get()
This commit is contained in:
Alexander Slobodeniuk 2024-05-13 18:55:36 +02:00
parent aaa832ed4b
commit 909baf5e19
41 changed files with 115 additions and 796 deletions

View file

@ -129,24 +129,10 @@
#include <gst/gst.h>
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
{

View file

@ -35,31 +35,9 @@
#include <gst/base/gstbytereader.h>
#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

View file

@ -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;\

View file

@ -40,32 +40,9 @@
#include <gst/base/gstbitreader.h>
#include <string.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_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 */

View file

@ -69,27 +69,9 @@
#include "gstvp9statefulparser.h"
#include <string.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_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)) { \

View file

@ -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)

View file

@ -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:

View file

@ -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)

View file

@ -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)

View file

@ -44,20 +44,9 @@
#include <atomic>
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;

View file

@ -25,20 +25,9 @@
#include "gstd3d12-private.h"
#include <string.h>
#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)

View file

@ -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:

View file

@ -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;

View file

@ -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)

View file

@ -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;

View file

@ -37,20 +37,9 @@
#include <algorithm>
#include <atomic>
#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
{

View file

@ -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)

View file

@ -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

View file

@ -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,

View file

@ -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;

View file

@ -27,28 +27,9 @@
#include <gst/gststructure.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-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:

View file

@ -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:

View file

@ -24,26 +24,8 @@
#include <string.h>
#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,

View file

@ -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"

View file

@ -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

View file

@ -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,

View file

@ -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));

View file

@ -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

View file

@ -28,27 +28,9 @@
#include <gst/gl/gstglmemory.h>
#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)

View file

@ -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)

View file

@ -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
{

View file

@ -32,32 +32,9 @@
#include <string.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-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);

View file

@ -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
{

View file

@ -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
{

View file

@ -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);

View file

@ -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)

View file

@ -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:

View file

@ -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)

View file

@ -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

View file

@ -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))

View file

@ -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 */