mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
d3d11: Use std::call_once()
g_once_init_enter() always takes global mutex for non-GCC build. Use C++ once call implementation Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2843>
This commit is contained in:
parent
b7e662f400
commit
74f56632c3
12 changed files with 117 additions and 157 deletions
|
@ -145,6 +145,8 @@ gboolean gst_d3d11_color_primaries_matrix_unorm (const GstVideoColorPrima
|
|||
G_END_DECLS
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <mutex>
|
||||
|
||||
class GstD3D11DeviceLockGuard
|
||||
{
|
||||
public:
|
||||
|
@ -162,6 +164,13 @@ public:
|
|||
GstD3D11DeviceLockGuard& operator=(const GstD3D11DeviceLockGuard&) = delete;
|
||||
|
||||
private:
|
||||
GstD3D11Device *device_;
|
||||
GstD3D11Device *device_;
|
||||
};
|
||||
#endif
|
||||
|
||||
#define GST_D3D11_CALL_ONCE_BEGIN \
|
||||
static std::once_flag __once_flag; \
|
||||
std::call_once (__once_flag, [&]()
|
||||
|
||||
#define GST_D3D11_CALL_ONCE_END )
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "gstd3d11compile.h"
|
||||
#include "gstd3d11device.h"
|
||||
#include "gstd3d11utils.h"
|
||||
#include "gstd3d11_private.h"
|
||||
#include <gmodule.h>
|
||||
#include <wrl.h>
|
||||
#include <string.h>
|
||||
|
@ -37,18 +38,13 @@ using namespace Microsoft::WRL;
|
|||
static GstDebugCategory *
|
||||
ensure_debug_category (void)
|
||||
{
|
||||
static gsize cat_gonce = 0;
|
||||
static GstDebugCategory *cat = nullptr;
|
||||
|
||||
if (g_once_init_enter (&cat_gonce)) {
|
||||
gsize cat_done;
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
cat = _gst_debug_category_new ("d3d11compile", 0, "d3d11compile");
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
|
||||
cat_done = (gsize) _gst_debug_category_new ("d3d11compile", 0,
|
||||
"d3d11compile");
|
||||
|
||||
g_once_init_leave (&cat_gonce, cat_done);
|
||||
}
|
||||
|
||||
return (GstDebugCategory *) cat_gonce;
|
||||
return cat;
|
||||
}
|
||||
#else
|
||||
#define ensure_debug_category() /* NOOP */
|
||||
|
@ -67,9 +63,7 @@ static pD3DCompile GstD3DCompileFunc = nullptr;
|
|||
gboolean
|
||||
gst_d3d11_compile_init (void)
|
||||
{
|
||||
static gsize init_once = 0;
|
||||
|
||||
if (g_once_init_enter (&init_once)) {
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
#if GST_D3D11_WINAPI_ONLY_APP
|
||||
/* Assuming that d3d compiler library is available */
|
||||
GstD3DCompileFunc = D3DCompile;
|
||||
|
@ -103,9 +97,8 @@ gst_d3d11_compile_init (void)
|
|||
if (!GstD3DCompileFunc)
|
||||
GST_WARNING ("D3D11 compiler library is unavailable");
|
||||
#endif
|
||||
|
||||
g_once_init_leave (&init_once, 1);
|
||||
}
|
||||
GST_D3D11_CALL_ONCE_END;
|
||||
|
||||
if (!GstD3DCompileFunc)
|
||||
return FALSE;
|
||||
|
|
|
@ -42,7 +42,7 @@ DEFINE_ENUM_FLAG_OPERATORS (GstD3D11ConverterBackend);
|
|||
GType
|
||||
gst_d3d11_converter_backend_get_type (void)
|
||||
{
|
||||
static gsize type = 0;
|
||||
static GType type = 0;
|
||||
static const GFlagsValue values[] = {
|
||||
{GST_D3D11_CONVERTER_BACKEND_SHADER, "GST_D3D11_CONVERTER_BACKEND_SHADER",
|
||||
"shader"},
|
||||
|
@ -51,12 +51,11 @@ gst_d3d11_converter_backend_get_type (void)
|
|||
{0, nullptr, nullptr}
|
||||
};
|
||||
|
||||
if (g_once_init_enter (&type)) {
|
||||
GType tmp = g_flags_register_static ("GstD3D11ConverterBackend", values);
|
||||
g_once_init_leave (&type, tmp);
|
||||
}
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
type = g_flags_register_static ("GstD3D11ConverterBackend", values);
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
|
||||
return (GType) type;
|
||||
return type;
|
||||
}
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
|
|
|
@ -54,7 +54,6 @@ using namespace Microsoft::WRL;
|
|||
|
||||
#if HAVE_D3D11SDKLAYERS_H
|
||||
#include <d3d11sdklayers.h>
|
||||
static GModule *d3d11_debug_module = NULL;
|
||||
|
||||
/* mingw header does not define D3D11_RLDO_IGNORE_INTERNAL
|
||||
* D3D11_RLDO_SUMMARY = 0x1,
|
||||
|
@ -68,8 +67,7 @@ static GModule *d3d11_debug_module = NULL;
|
|||
#include <dxgidebug.h>
|
||||
typedef HRESULT (WINAPI * DXGIGetDebugInterface_t) (REFIID riid,
|
||||
void **ppDebug);
|
||||
static GModule *dxgi_debug_module = NULL;
|
||||
static DXGIGetDebugInterface_t GstDXGIGetDebugInterface = NULL;
|
||||
static DXGIGetDebugInterface_t GstDXGIGetDebugInterface = nullptr;
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -134,17 +132,14 @@ struct _GstD3D11DevicePrivate
|
|||
static void
|
||||
debug_init_once (void)
|
||||
{
|
||||
static gsize init_once = 0;
|
||||
|
||||
if (g_once_init_enter (&init_once)) {
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
GST_DEBUG_CATEGORY_INIT (gst_d3d11_device_debug,
|
||||
"d3d11device", 0, "d3d11 device object");
|
||||
#if defined(HAVE_D3D11SDKLAYERS_H) || defined(HAVE_DXGIDEBUG_H)
|
||||
GST_DEBUG_CATEGORY_INIT (gst_d3d11_debug_layer_debug,
|
||||
"d3d11debuglayer", 0, "native d3d11 and dxgi debug");
|
||||
#endif
|
||||
g_once_init_leave (&init_once, 1);
|
||||
}
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
}
|
||||
|
||||
#define gst_d3d11_device_parent_class parent_class
|
||||
|
@ -160,26 +155,24 @@ static void gst_d3d11_device_finalize (GObject * object);
|
|||
static gboolean
|
||||
gst_d3d11_device_enable_d3d11_debug (void)
|
||||
{
|
||||
static gsize _init = 0;
|
||||
|
||||
static GModule *d3d11_debug_module = nullptr;
|
||||
/* If all below libraries are unavailable, d3d11 device would fail with
|
||||
* D3D11_CREATE_DEVICE_DEBUG flag */
|
||||
if (g_once_init_enter (&_init)) {
|
||||
d3d11_debug_module =
|
||||
g_module_open ("d3d11sdklayers.dll", G_MODULE_BIND_LAZY);
|
||||
static const gchar *sdk_dll_names[] = {
|
||||
"d3d11sdklayers.dll",
|
||||
"d3d11_1sdklayers.dll",
|
||||
"d3d11_2sdklayers.dll",
|
||||
"d3d11_3sdklayers.dll",
|
||||
};
|
||||
|
||||
if (!d3d11_debug_module)
|
||||
d3d11_debug_module =
|
||||
g_module_open ("d3d11_1sdklayers.dll", G_MODULE_BIND_LAZY);
|
||||
if (!d3d11_debug_module)
|
||||
d3d11_debug_module =
|
||||
g_module_open ("d3d11_2sdklayers.dll", G_MODULE_BIND_LAZY);
|
||||
if (!d3d11_debug_module)
|
||||
d3d11_debug_module =
|
||||
g_module_open ("d3d11_3sdklayers.dll", G_MODULE_BIND_LAZY);
|
||||
|
||||
g_once_init_leave (&_init, 1);
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
for (guint i = 0; i < G_N_ELEMENTS (sdk_dll_names); i++) {
|
||||
d3d11_debug_module = g_module_open (sdk_dll_names[i], G_MODULE_BIND_LAZY);
|
||||
if (d3d11_debug_module)
|
||||
return;
|
||||
}
|
||||
}
|
||||
GST_D3D11_CALL_ONCE_END;
|
||||
|
||||
if (d3d11_debug_module)
|
||||
return TRUE;
|
||||
|
@ -265,27 +258,24 @@ gst_d3d11_device_d3d11_debug (GstD3D11Device * device,
|
|||
static gboolean
|
||||
gst_d3d11_device_enable_dxgi_debug (void)
|
||||
{
|
||||
static gsize _init = 0;
|
||||
gboolean ret = FALSE;
|
||||
static GModule *dxgi_debug_module = nullptr;
|
||||
|
||||
/* If all below libraries are unavailable, d3d11 device would fail with
|
||||
* D3D11_CREATE_DEVICE_DEBUG flag */
|
||||
if (g_once_init_enter (&_init)) {
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
#if (!GST_D3D11_WINAPI_ONLY_APP)
|
||||
dxgi_debug_module = g_module_open ("dxgidebug.dll", G_MODULE_BIND_LAZY);
|
||||
|
||||
if (dxgi_debug_module)
|
||||
g_module_symbol (dxgi_debug_module,
|
||||
"DXGIGetDebugInterface", (gpointer *) & GstDXGIGetDebugInterface);
|
||||
if (GstDXGIGetDebugInterface)
|
||||
ret = TRUE;
|
||||
#else
|
||||
ret = TRUE;
|
||||
GstDXGIGetDebugInterface = DXGIGetDebugInterface1;
|
||||
#endif
|
||||
g_once_init_leave (&_init, 1);
|
||||
}
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
|
||||
return ret;
|
||||
if (!GstDXGIGetDebugInterface)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static HRESULT
|
||||
|
@ -429,19 +419,16 @@ gst_d3d11_device_init (GstD3D11Device * self)
|
|||
static gboolean
|
||||
is_windows_8_or_greater (void)
|
||||
{
|
||||
static gsize version_once = 0;
|
||||
static gboolean ret = FALSE;
|
||||
|
||||
if (g_once_init_enter (&version_once)) {
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
#if (!GST_D3D11_WINAPI_ONLY_APP)
|
||||
if (IsWindows8OrGreater ())
|
||||
ret = TRUE;
|
||||
#else
|
||||
ret = TRUE;
|
||||
#endif
|
||||
|
||||
g_once_init_leave (&version_once, 1);
|
||||
}
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -34,18 +34,13 @@
|
|||
static GstDebugCategory *
|
||||
ensure_debug_category (void)
|
||||
{
|
||||
static gsize cat_gonce = 0;
|
||||
static GstDebugCategory *cat = nullptr;
|
||||
|
||||
if (g_once_init_enter (&cat_gonce)) {
|
||||
gsize cat_done;
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
cat = _gst_debug_category_new ("d3d11format", 0, "d3d11 specific formats");
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
|
||||
cat_done = (gsize) _gst_debug_category_new ("d3d11format", 0,
|
||||
"d3d11 specific formats");
|
||||
|
||||
g_once_init_leave (&cat_gonce, cat_done);
|
||||
}
|
||||
|
||||
return (GstDebugCategory *) cat_gonce;
|
||||
return cat;
|
||||
}
|
||||
#else
|
||||
#define ensure_debug_category() /* NOOP */
|
||||
|
@ -54,7 +49,7 @@ ensure_debug_category (void)
|
|||
GType
|
||||
gst_d3d11_format_support_get_type (void)
|
||||
{
|
||||
static gsize support_type = 0;
|
||||
static GType support_type = 0;
|
||||
static const GFlagsValue support_values[] = {
|
||||
{D3D11_FORMAT_SUPPORT_BUFFER, "BUFFER", "buffer"},
|
||||
{D3D11_FORMAT_SUPPORT_IA_VERTEX_BUFFER, "IA_VERTEX_BUFFER",
|
||||
|
@ -103,13 +98,12 @@ gst_d3d11_format_support_get_type (void)
|
|||
{0, nullptr, nullptr}
|
||||
};
|
||||
|
||||
if (g_once_init_enter (&support_type)) {
|
||||
GType tmp = g_flags_register_static ("GstD3D11FormatSupport",
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
support_type = g_flags_register_static ("GstD3D11FormatSupport",
|
||||
support_values);
|
||||
g_once_init_leave (&support_type, tmp);
|
||||
}
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
|
||||
return (GType) support_type;
|
||||
return support_type;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -36,7 +36,7 @@ static GstAllocator *_d3d11_memory_allocator;
|
|||
GType
|
||||
gst_d3d11_allocation_flags_get_type (void)
|
||||
{
|
||||
static gsize type = 0;
|
||||
static GType type = 0;
|
||||
static const GFlagsValue values[] = {
|
||||
{GST_D3D11_ALLOCATION_FLAG_DEFAULT, "GST_D3D11_ALLOCATION_FLAG_DEFAULT",
|
||||
"default"},
|
||||
|
@ -45,18 +45,17 @@ gst_d3d11_allocation_flags_get_type (void)
|
|||
{0, nullptr, nullptr}
|
||||
};
|
||||
|
||||
if (g_once_init_enter (&type)) {
|
||||
GType tmp = g_flags_register_static ("GstD3D11AllocationFlags", values);
|
||||
g_once_init_leave (&type, tmp);
|
||||
}
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
type = g_flags_register_static ("GstD3D11AllocationFlags", values);
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
|
||||
return (GType) type;
|
||||
return type;
|
||||
}
|
||||
|
||||
GType
|
||||
gst_d3d11_memory_transfer_get_type (void)
|
||||
{
|
||||
static gsize type = 0;
|
||||
static GType type = 0;
|
||||
static const GFlagsValue values[] = {
|
||||
{GST_D3D11_MEMORY_TRANSFER_NEED_DOWNLOAD,
|
||||
"GST_D3D11_MEMORY_TRANSFER_NEED_DOWNLOAD", "need-download"},
|
||||
|
@ -65,18 +64,17 @@ gst_d3d11_memory_transfer_get_type (void)
|
|||
{0, nullptr, nullptr}
|
||||
};
|
||||
|
||||
if (g_once_init_enter (&type)) {
|
||||
GType tmp = g_flags_register_static ("GstD3D11MemoryTransfer", values);
|
||||
g_once_init_leave (&type, tmp);
|
||||
}
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
type = g_flags_register_static ("GstD3D11MemoryTransfer", values);
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
|
||||
return (GType) type;
|
||||
return type;
|
||||
}
|
||||
|
||||
GType
|
||||
gst_d3d11_memory_native_type_get_type (void)
|
||||
{
|
||||
static gsize type = 0;
|
||||
static GType type = 0;
|
||||
static const GEnumValue values[] = {
|
||||
{GST_D3D11_MEMORY_NATIVE_TYPE_INVALID,
|
||||
"GST_D3D11_MEMORY_NATIVE_TYPE_INVALID", "invalid"},
|
||||
|
@ -87,12 +85,11 @@ gst_d3d11_memory_native_type_get_type (void)
|
|||
{0, nullptr, nullptr}
|
||||
};
|
||||
|
||||
if (g_once_init_enter (&type)) {
|
||||
GType tmp = g_enum_register_static ("GstD3D11MemoryNativeType", values);
|
||||
g_once_init_leave (&type, tmp);
|
||||
}
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
type = g_enum_register_static ("GstD3D11MemoryNativeType", values);
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
|
||||
return (GType) type;
|
||||
return type;
|
||||
}
|
||||
|
||||
/* GstD3D11AllocationParams */
|
||||
|
@ -650,10 +647,7 @@ gst_d3d11_memory_get_native_type (GstD3D11Memory * mem)
|
|||
void
|
||||
gst_d3d11_memory_init_once (void)
|
||||
{
|
||||
static gsize _init = 0;
|
||||
|
||||
if (g_once_init_enter (&_init)) {
|
||||
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
GST_DEBUG_CATEGORY_INIT (gst_d3d11_allocator_debug, "d3d11allocator", 0,
|
||||
"Direct3D11 Texture Allocator");
|
||||
|
||||
|
@ -662,8 +656,7 @@ gst_d3d11_memory_init_once (void)
|
|||
gst_object_ref_sink (_d3d11_memory_allocator);
|
||||
|
||||
gst_allocator_register (GST_D3D11_MEMORY_NAME, _d3d11_memory_allocator);
|
||||
g_once_init_leave (&_init, 1);
|
||||
}
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -39,18 +39,13 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_CONTEXT);
|
|||
static GstDebugCategory *
|
||||
ensure_debug_category (void)
|
||||
{
|
||||
static gsize cat_gonce = 0;
|
||||
static GstDebugCategory *cat = nullptr;
|
||||
|
||||
if (g_once_init_enter (&cat_gonce)) {
|
||||
gsize cat_done;
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
cat = _gst_debug_category_new ("d3d11utils", 0, "d3d11 utility functions");
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
|
||||
cat_done = (gsize) _gst_debug_category_new ("d3d11utils", 0,
|
||||
"d3d11 utility functions");
|
||||
|
||||
g_once_init_leave (&cat_gonce, cat_done);
|
||||
}
|
||||
|
||||
return (GstDebugCategory *) cat_gonce;
|
||||
return cat;
|
||||
}
|
||||
#else
|
||||
#define ensure_debug_category() /* NOOP */
|
||||
|
@ -59,12 +54,9 @@ ensure_debug_category (void)
|
|||
static void
|
||||
_init_context_debug (void)
|
||||
{
|
||||
static gsize _init = 0;
|
||||
|
||||
if (g_once_init_enter (&_init)) {
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
GST_DEBUG_CATEGORY_GET (GST_CAT_CONTEXT, "GST_CONTEXT");
|
||||
g_once_init_leave (&_init, 1);
|
||||
}
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -387,14 +387,13 @@ gst_d3d11_decoder_is_configured (GstD3D11Decoder * decoder)
|
|||
static GQuark
|
||||
gst_d3d11_decoder_view_id_quark (void)
|
||||
{
|
||||
static gsize id_quark = 0;
|
||||
static GQuark id_quark = 0;
|
||||
|
||||
if (g_once_init_enter (&id_quark)) {
|
||||
GQuark quark = g_quark_from_string ("GstD3D11DecoderViewId");
|
||||
g_once_init_leave (&id_quark, quark);
|
||||
}
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
id_quark = g_quark_from_string ("GstD3D11DecoderViewId");
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
|
||||
return (GQuark) id_quark;
|
||||
return id_quark;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
@ -106,9 +106,9 @@ typedef enum
|
|||
static GType
|
||||
gst_d3d11_deinterlace_method_type (void)
|
||||
{
|
||||
static gsize method_type = 0;
|
||||
static GType method_type = 0;
|
||||
|
||||
if (g_once_init_enter (&method_type)) {
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
static const GFlagsValue method_types[] = {
|
||||
{GST_D3D11_DEINTERLACE_METHOD_BLEND,
|
||||
"Blend: Blending top/bottom field pictures into one frame. "
|
||||
|
@ -123,14 +123,14 @@ gst_d3d11_deinterlace_method_type (void)
|
|||
{GST_D3D11_DEINTERLACE_METHOD_MOTION_COMPENSATION,
|
||||
"Motion Compensation: Recreating missing lines by using motion vector. "
|
||||
"Framerate will be doubled (e,g, 60i -> 60p)", "mocomp"},
|
||||
{0, NULL, NULL},
|
||||
{0, nullptr, nullptr},
|
||||
};
|
||||
GType tmp = g_flags_register_static ("GstD3D11DeinterlaceMethod",
|
||||
method_types);
|
||||
g_once_init_leave (&method_type, tmp);
|
||||
}
|
||||
|
||||
return (GType) method_type;
|
||||
method_type = g_flags_register_static ("GstD3D11DeinterlaceMethod",
|
||||
method_types);
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
|
||||
return method_type;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
|
|
|
@ -36,9 +36,7 @@ static guint _gst_d3d11_texture_max_dimension = 16384;
|
|||
void
|
||||
gst_d3d11_plugin_utils_init (D3D_FEATURE_LEVEL feature_level)
|
||||
{
|
||||
static gsize _init_once = 0;
|
||||
|
||||
if (g_once_init_enter (&_init_once)) {
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
/* https://docs.microsoft.com/en-us/windows/win32/direct3d11/overviews-direct3d-11-devices-downlevel-intro */
|
||||
if (feature_level >= D3D_FEATURE_LEVEL_11_0)
|
||||
_gst_d3d11_texture_max_dimension = 16384;
|
||||
|
@ -46,9 +44,8 @@ gst_d3d11_plugin_utils_init (D3D_FEATURE_LEVEL feature_level)
|
|||
_gst_d3d11_texture_max_dimension = 8192;
|
||||
else
|
||||
_gst_d3d11_texture_max_dimension = 4096;
|
||||
|
||||
g_once_init_leave (&_init_once, 1);
|
||||
}
|
||||
GST_D3D11_CALL_ONCE_END;
|
||||
}
|
||||
|
||||
GstCaps *
|
||||
|
@ -75,19 +72,16 @@ gst_d3d11_get_updated_template_caps (GstStaticCaps * template_caps)
|
|||
gboolean
|
||||
gst_d3d11_is_windows_8_or_greater (void)
|
||||
{
|
||||
static gsize version_once = 0;
|
||||
static gboolean ret = FALSE;
|
||||
|
||||
if (g_once_init_enter (&version_once)) {
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
#if (!GST_D3D11_WINAPI_ONLY_APP)
|
||||
if (IsWindows8OrGreater ())
|
||||
ret = TRUE;
|
||||
#else
|
||||
ret = TRUE;
|
||||
#endif
|
||||
|
||||
g_once_init_leave (&version_once, 1);
|
||||
}
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -72,9 +72,9 @@ typedef enum
|
|||
static GType
|
||||
gst_d3d11_test_src_pattern_get_type (void)
|
||||
{
|
||||
static gsize pattern_type = 0;
|
||||
static GType pattern_type = 0;
|
||||
|
||||
if (g_once_init_enter (&pattern_type)) {
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
static const GEnumValue pattern_types[] = {
|
||||
{GST_D3D11_TEST_SRC_SMPTE, "SMPTE 100% color bars", "smpte"},
|
||||
{GST_D3D11_TEST_SRC_SNOW, "Random (television snow)", "snow"},
|
||||
|
@ -89,12 +89,12 @@ gst_d3d11_test_src_pattern_get_type (void)
|
|||
{GST_D3D11_TEST_SRC_CHECKERS8, "Checkers 8px", "checkers-8"},
|
||||
{0, nullptr, nullptr},
|
||||
};
|
||||
GType tmp = g_enum_register_static ("GstD3D11TestSrcPattern",
|
||||
pattern_types);
|
||||
g_once_init_leave (&pattern_type, tmp);
|
||||
}
|
||||
|
||||
return (GType) pattern_type;
|
||||
pattern_type = g_enum_register_static ("GstD3D11TestSrcPattern",
|
||||
pattern_types);
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
|
||||
return pattern_type;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
|
|
|
@ -74,9 +74,9 @@ static guint d3d11_window_signals[SIGNAL_LAST] = { 0, };
|
|||
GType
|
||||
gst_d3d11_window_fullscreen_toggle_mode_type (void)
|
||||
{
|
||||
static gsize mode_type = 0;
|
||||
static GType mode_type = 0;
|
||||
|
||||
if (g_once_init_enter (&mode_type)) {
|
||||
GST_D3D11_CALL_ONCE_BEGIN {
|
||||
static const GFlagsValue mode_types[] = {
|
||||
{GST_D3D11_WINDOW_FULLSCREEN_TOGGLE_MODE_NONE,
|
||||
"GST_D3D11_WINDOW_FULLSCREEN_TOGGLE_MODE_NONE", "none"},
|
||||
|
@ -84,14 +84,14 @@ gst_d3d11_window_fullscreen_toggle_mode_type (void)
|
|||
"GST_D3D11_WINDOW_FULLSCREEN_TOGGLE_MODE_ALT_ENTER", "alt-enter"},
|
||||
{GST_D3D11_WINDOW_FULLSCREEN_TOGGLE_MODE_PROPERTY,
|
||||
"GST_D3D11_WINDOW_FULLSCREEN_TOGGLE_MODE_PROPERTY", "property"},
|
||||
{0, NULL, NULL},
|
||||
{0, nullptr, nullptr},
|
||||
};
|
||||
GType tmp = g_flags_register_static ("GstD3D11WindowFullscreenToggleMode",
|
||||
mode_types);
|
||||
g_once_init_leave (&mode_type, tmp);
|
||||
}
|
||||
|
||||
return (GType) mode_type;
|
||||
mode_type = g_flags_register_static ("GstD3D11WindowFullscreenToggleMode",
|
||||
mode_types);
|
||||
} GST_D3D11_CALL_ONCE_END;
|
||||
|
||||
return mode_type;
|
||||
}
|
||||
|
||||
#define gst_d3d11_window_parent_class parent_class
|
||||
|
|
Loading…
Reference in a new issue