mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 04:46:13 +00:00
d3d11: Initialize debug categories of non-GstElement implementation in plugin init
That's the way to expose debug category to --gst-debug-help
This commit is contained in:
parent
71befc477f
commit
199caccc41
4 changed files with 14 additions and 51 deletions
|
@ -29,7 +29,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_CONTEXT);
|
GST_DEBUG_CATEGORY_STATIC (GST_CAT_CONTEXT);
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_d3d11_device_debug);
|
GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_device_debug);
|
||||||
#define GST_CAT_DEFAULT gst_d3d11_device_debug
|
#define GST_CAT_DEFAULT gst_d3d11_device_debug
|
||||||
|
|
||||||
#ifdef HAVE_D3D11SDKLAYER_H
|
#ifdef HAVE_D3D11SDKLAYER_H
|
||||||
|
@ -178,8 +178,6 @@ gst_d3d11_device_class_init (GstD3D11DeviceClass * klass)
|
||||||
"Human readable device description", NULL,
|
"Human readable device description", NULL,
|
||||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_INIT (gst_d3d11_device_debug,
|
|
||||||
"d3d11device", 0, "d3d11 device");
|
|
||||||
GST_DEBUG_CATEGORY_GET (GST_CAT_CONTEXT, "GST_CONTEXT");
|
GST_DEBUG_CATEGORY_GET (GST_CAT_CONTEXT, "GST_CONTEXT");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -542,13 +540,6 @@ gst_d3d11_device_new (guint adapter)
|
||||||
{
|
{
|
||||||
GstD3D11Device *device = NULL;
|
GstD3D11Device *device = NULL;
|
||||||
GstD3D11DevicePrivate *priv;
|
GstD3D11DevicePrivate *priv;
|
||||||
static volatile gsize _init = 0;
|
|
||||||
|
|
||||||
if (g_once_init_enter (&_init)) {
|
|
||||||
GST_DEBUG_CATEGORY_INIT (gst_d3d11_device_debug, "d3d11device", 0,
|
|
||||||
"d3d11 device");
|
|
||||||
g_once_init_leave (&_init, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
device = g_object_new (GST_TYPE_D3D11_DEVICE, "adapter", adapter, NULL);
|
device = g_object_new (GST_TYPE_D3D11_DEVICE, "adapter", adapter, NULL);
|
||||||
|
|
||||||
|
|
|
@ -26,27 +26,8 @@
|
||||||
#include "gstd3d11device.h"
|
#include "gstd3d11device.h"
|
||||||
#include "gstd3d11memory.h"
|
#include "gstd3d11memory.h"
|
||||||
|
|
||||||
#ifndef GST_DISABLE_GST_DEBUG
|
GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_format_debug);
|
||||||
#define GST_CAT_DEFAULT ensure_debug_category()
|
#define GST_CAT_DEFAULT gst_d3d11_format_debug
|
||||||
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 ("d3d11format", 0,
|
|
||||||
"Direct3D11 Format");
|
|
||||||
|
|
||||||
g_once_init_leave (&cat_gonce, cat_done);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (GstDebugCategory *) cat_gonce;
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
#define ensure_debug_category() /* NOOP */
|
|
||||||
#endif /* GST_DISABLE_GST_DEBUG */
|
|
||||||
|
|
||||||
/* Following formats were introduced since Windows 8
|
/* Following formats were introduced since Windows 8
|
||||||
* DXGI_FORMAT_AYUV
|
* DXGI_FORMAT_AYUV
|
||||||
|
|
|
@ -27,22 +27,9 @@
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <versionhelpers.h>
|
#include <versionhelpers.h>
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (gst_d3d11_utils_debug);
|
|
||||||
GST_DEBUG_CATEGORY_STATIC (GST_CAT_CONTEXT);
|
GST_DEBUG_CATEGORY_STATIC (GST_CAT_CONTEXT);
|
||||||
|
GST_DEBUG_CATEGORY_EXTERN (gst_d3d11_utils_debug);
|
||||||
static GstDebugCategory *
|
#define GST_CAT_DEFAULT gst_d3d11_utils_debug
|
||||||
_init_d3d11_utils_debug (void)
|
|
||||||
{
|
|
||||||
static volatile gsize _init = 0;
|
|
||||||
|
|
||||||
if (g_once_init_enter (&_init)) {
|
|
||||||
GST_DEBUG_CATEGORY_INIT (gst_d3d11_utils_debug, "d3d11utils", 0,
|
|
||||||
"Direct3D11 Utilities");
|
|
||||||
g_once_init_leave (&_init, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
return gst_d3d11_utils_debug;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_init_context_debug (void)
|
_init_context_debug (void)
|
||||||
|
@ -55,8 +42,6 @@ _init_context_debug (void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define GST_CAT_DEFAULT _init_d3d11_utils_debug()
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_d3d11_handle_set_context:
|
* gst_d3d11_handle_set_context:
|
||||||
* @element: a #GstElement
|
* @element: a #GstElement
|
||||||
|
@ -79,7 +64,6 @@ gst_d3d11_handle_set_context (GstElement * element, GstContext * context,
|
||||||
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
|
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
|
||||||
g_return_val_if_fail (device != NULL, FALSE);
|
g_return_val_if_fail (device != NULL, FALSE);
|
||||||
|
|
||||||
_init_d3d11_utils_debug ();
|
|
||||||
_init_context_debug ();
|
_init_context_debug ();
|
||||||
|
|
||||||
if (!context)
|
if (!context)
|
||||||
|
@ -153,7 +137,6 @@ gst_d3d11_handle_context_query (GstElement * element, GstQuery * query,
|
||||||
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
|
g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);
|
||||||
g_return_val_if_fail (GST_IS_QUERY (query), FALSE);
|
g_return_val_if_fail (GST_IS_QUERY (query), FALSE);
|
||||||
|
|
||||||
_init_d3d11_utils_debug ();
|
|
||||||
_init_context_debug ();
|
_init_context_debug ();
|
||||||
|
|
||||||
GST_LOG_OBJECT (element, "handle context query %" GST_PTR_FORMAT, query);
|
GST_LOG_OBJECT (element, "handle context query %" GST_PTR_FORMAT, query);
|
||||||
|
@ -298,7 +281,6 @@ gst_d3d11_ensure_element_data (GstElement * element, gint adapter,
|
||||||
g_return_val_if_fail (element != NULL, FALSE);
|
g_return_val_if_fail (element != NULL, FALSE);
|
||||||
g_return_val_if_fail (device != NULL, FALSE);
|
g_return_val_if_fail (device != NULL, FALSE);
|
||||||
|
|
||||||
_init_d3d11_utils_debug ();
|
|
||||||
_init_context_debug ();
|
_init_context_debug ();
|
||||||
|
|
||||||
if (*device) {
|
if (*device) {
|
||||||
|
|
|
@ -30,6 +30,9 @@
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY (gst_d3d11_shader_debug);
|
GST_DEBUG_CATEGORY (gst_d3d11_shader_debug);
|
||||||
GST_DEBUG_CATEGORY (gst_d3d11_colorconverter_debug);
|
GST_DEBUG_CATEGORY (gst_d3d11_colorconverter_debug);
|
||||||
|
GST_DEBUG_CATEGORY (gst_d3d11_utils_debug);
|
||||||
|
GST_DEBUG_CATEGORY (gst_d3d11_format_debug);
|
||||||
|
GST_DEBUG_CATEGORY (gst_d3d11_device_debug);
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
plugin_init (GstPlugin * plugin)
|
plugin_init (GstPlugin * plugin)
|
||||||
|
@ -38,6 +41,12 @@ plugin_init (GstPlugin * plugin)
|
||||||
"d3d11shader", 0, "d3d11shader");
|
"d3d11shader", 0, "d3d11shader");
|
||||||
GST_DEBUG_CATEGORY_INIT (gst_d3d11_colorconverter_debug,
|
GST_DEBUG_CATEGORY_INIT (gst_d3d11_colorconverter_debug,
|
||||||
"d3d11colorconverter", 0, "d3d11colorconverter");
|
"d3d11colorconverter", 0, "d3d11colorconverter");
|
||||||
|
GST_DEBUG_CATEGORY_INIT (gst_d3d11_utils_debug,
|
||||||
|
"d3d11utils", 0, "d3d11 utility functions");
|
||||||
|
GST_DEBUG_CATEGORY_INIT (gst_d3d11_format_debug,
|
||||||
|
"d3d11format", 0, "d3d11 specific formats");
|
||||||
|
GST_DEBUG_CATEGORY_INIT (gst_d3d11_device_debug,
|
||||||
|
"d3d11device", 0, "d3d11 device object");
|
||||||
|
|
||||||
gst_element_register (plugin,
|
gst_element_register (plugin,
|
||||||
"d3d11upload", GST_RANK_NONE, GST_TYPE_D3D11_UPLOAD);
|
"d3d11upload", GST_RANK_NONE, GST_TYPE_D3D11_UPLOAD);
|
||||||
|
|
Loading…
Reference in a new issue