cuda: Enable x86 NVMM support again
It was broken since memory copy helper function was moved to gst-libs. Also, adding "cuda-nvmm" and "cuda-nvmm-include-path" build options to en/disable NVMM support in gstcuda library Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6978>
This commit is contained in:
parent
6fb0c7b928
commit
afb62e98c7
@ -20,15 +20,16 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <gst/video/video.h>
|
#include <gst/cuda/cuda-prelude.h>
|
||||||
#include <nvbufsurface.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define GST_CAPS_FEATURE_MEMORY_CUDA_NVMM_MEMORY "memory:NVMM"
|
#define GST_CAPS_FEATURE_MEMORY_CUDA_NVMM_MEMORY "memory:NVMM"
|
||||||
|
|
||||||
|
GST_CUDA_API
|
||||||
gboolean gst_cuda_nvmm_init_once (void);
|
gboolean gst_cuda_nvmm_init_once (void);
|
||||||
|
|
||||||
|
GST_CUDA_API
|
||||||
GstBufferPool * gst_cuda_nvmm_buffer_pool_new (void);
|
GstBufferPool * gst_cuda_nvmm_buffer_pool_new (void);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
@ -21,16 +21,29 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gstcudanvmm.h"
|
#include "gstcudanvmm-private.h"
|
||||||
#include <gmodule.h>
|
#include <gmodule.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "gstcuda-private.h"
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (gst_cuda_nvmm_debug);
|
#ifndef GST_DISABLE_GST_DEBUG
|
||||||
#define GST_CAT_DEFAULT gst_cuda_nvmm_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 ("cudanvmm", 0, "cudanvmm");
|
||||||
|
} GST_CUDA_CALL_ONCE_END;
|
||||||
|
|
||||||
|
return cat;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#define LOAD_SYMBOL(name) G_STMT_START { \
|
#define LOAD_SYMBOL(name) G_STMT_START { \
|
||||||
if (!g_module_symbol (module, G_STRINGIFY (name), (gpointer *) &vtable->name)) { \
|
if (!g_module_symbol (module, G_STRINGIFY (name), (gpointer *) &vtable->name)) { \
|
||||||
GST_ERROR ("Failed to load symbol '%s', %s", G_STRINGIFY (name), g_module_error()); \
|
GST_INFO ("Failed to load symbol '%s', %s", G_STRINGIFY (name), g_module_error()); \
|
||||||
goto error; \
|
goto error; \
|
||||||
} \
|
} \
|
||||||
} G_STMT_END;
|
} G_STMT_END;
|
||||||
@ -79,12 +92,10 @@ gboolean
|
|||||||
gst_cuda_nvmm_init_once (void)
|
gst_cuda_nvmm_init_once (void)
|
||||||
{
|
{
|
||||||
static gboolean loaded = FALSE;
|
static gboolean loaded = FALSE;
|
||||||
static gsize load_once = 0;
|
|
||||||
|
|
||||||
if (g_once_init_enter (&load_once)) {
|
GST_CUDA_CALL_ONCE_BEGIN {
|
||||||
loaded = gst_cuda_nvmm_load_library ();
|
loaded = gst_cuda_nvmm_load_library ();
|
||||||
g_once_init_leave (&load_once, 1);
|
} GST_CUDA_CALL_ONCE_END;
|
||||||
}
|
|
||||||
|
|
||||||
return loaded;
|
return loaded;
|
||||||
}
|
}
|
@ -39,8 +39,9 @@
|
|||||||
#include <sddl.h>
|
#include <sddl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#ifdef HAVE_CUDA_NVMM
|
||||||
#include "gstcudanvmm.h"
|
#include "gstcudanvmm-private.h"
|
||||||
|
#include <nvbufsurface.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gstcudamemory.h"
|
#include "gstcudamemory.h"
|
||||||
@ -784,7 +785,7 @@ map_buffer_and_fill_copy2d (GstBuffer * buf, const GstVideoInfo * info,
|
|||||||
gboolean buffer_mapped = FALSE;
|
gboolean buffer_mapped = FALSE;
|
||||||
guint i;
|
guint i;
|
||||||
|
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#ifdef HAVE_CUDA_NVMM
|
||||||
if (copy_type == GST_CUDA_BUFFER_COPY_NVMM) {
|
if (copy_type == GST_CUDA_BUFFER_COPY_NVMM) {
|
||||||
NvBufSurface *surface;
|
NvBufSurface *surface;
|
||||||
NvBufSurfaceParams *surface_params;
|
NvBufSurfaceParams *surface_params;
|
||||||
|
@ -3,6 +3,7 @@ cuda_sources = files([
|
|||||||
'gstcudacontext.cpp',
|
'gstcudacontext.cpp',
|
||||||
'gstcudaloader.cpp',
|
'gstcudaloader.cpp',
|
||||||
'gstcudamemory.cpp',
|
'gstcudamemory.cpp',
|
||||||
|
'gstcudanvmm.cpp',
|
||||||
'gstcudanvrtc.cpp',
|
'gstcudanvrtc.cpp',
|
||||||
'gstcudastream.cpp',
|
'gstcudastream.cpp',
|
||||||
'gstcudautils.cpp',
|
'gstcudautils.cpp',
|
||||||
@ -26,6 +27,9 @@ gstcuda_stub_dep = declare_dependency(
|
|||||||
include_directories: cuda_stubinc
|
include_directories: cuda_stubinc
|
||||||
)
|
)
|
||||||
|
|
||||||
|
have_nvbufsurface_h = false
|
||||||
|
gstcuda_nvmm_inc = []
|
||||||
|
|
||||||
gstcuda_platform_dep = []
|
gstcuda_platform_dep = []
|
||||||
if host_system not in ['windows', 'linux']
|
if host_system not in ['windows', 'linux']
|
||||||
subdir_done()
|
subdir_done()
|
||||||
@ -80,6 +84,21 @@ if host_system == 'windows'
|
|||||||
'-Wno-redundant-decls',
|
'-Wno-redundant-decls',
|
||||||
])
|
])
|
||||||
endif
|
endif
|
||||||
|
else
|
||||||
|
nvmm_opt = get_option('cuda-nvmm')
|
||||||
|
if not nvmm_opt.disabled()
|
||||||
|
nvmm_inc_opt = get_option('cuda-nvmm-include-path')
|
||||||
|
if nvmm_inc_opt != ''
|
||||||
|
gstcuda_nvmm_inc = [include_directories(nvmm_inc_opt)]
|
||||||
|
endif
|
||||||
|
|
||||||
|
have_nvbufsurface_h = cc.has_header('nvbufsurface.h',
|
||||||
|
include_directories: gstcuda_nvmm_inc,
|
||||||
|
required: nvmm_opt)
|
||||||
|
endif
|
||||||
|
if have_nvbufsurface_h
|
||||||
|
extra_args += ['-DHAVE_CUDA_NVMM']
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
pkg_name = 'gstreamer-cuda-' + api_version
|
pkg_name = 'gstreamer-cuda-' + api_version
|
||||||
@ -87,7 +106,7 @@ gstcuda= library('gstcuda-' + api_version,
|
|||||||
cuda_sources,
|
cuda_sources,
|
||||||
c_args : gst_plugins_bad_args + extra_args,
|
c_args : gst_plugins_bad_args + extra_args,
|
||||||
cpp_args : gst_plugins_bad_args + extra_args,
|
cpp_args : gst_plugins_bad_args + extra_args,
|
||||||
include_directories : [configinc, libsinc, cuda_stubinc],
|
include_directories : [configinc, libsinc, cuda_stubinc] + gstcuda_nvmm_inc,
|
||||||
version : libversion,
|
version : libversion,
|
||||||
soversion : soversion,
|
soversion : soversion,
|
||||||
install : true,
|
install : true,
|
||||||
|
@ -213,6 +213,10 @@ option('aja-include-dir', type : 'string', value : '',
|
|||||||
option('aja-lib-dir', type : 'string', value : '',
|
option('aja-lib-dir', type : 'string', value : '',
|
||||||
description : 'Directory where AJA NTV2 library is located')
|
description : 'Directory where AJA NTV2 library is located')
|
||||||
|
|
||||||
|
# CUDA library options
|
||||||
|
option('cuda-nvmm', type : 'feature', value : 'auto', description : 'Enable NVMM support in cuda library')
|
||||||
|
option('cuda-nvmm-include-path', type : 'string', value : '', description : 'Include path for NVMM support in cuda library')
|
||||||
|
|
||||||
# D3D11/D3D12 HLSL library options
|
# D3D11/D3D12 HLSL library options
|
||||||
option('d3d-hlsl-precompile', type : 'feature', value : 'auto', description : 'Enable buildtime HLSL compile for d3d11/d3d12 library/plugin')
|
option('d3d-hlsl-precompile', type : 'feature', value : 'auto', description : 'Enable buildtime HLSL compile for d3d11/d3d12 library/plugin')
|
||||||
|
|
||||||
|
@ -42,8 +42,9 @@
|
|||||||
#include "gstcudamemorycopy.h"
|
#include "gstcudamemorycopy.h"
|
||||||
#include "gstcudaformat.h"
|
#include "gstcudaformat.h"
|
||||||
#include <gst/cuda/gstcuda-private.h>
|
#include <gst/cuda/gstcuda-private.h>
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#ifdef HAVE_CUDA_NVMM
|
||||||
#include "gstcudanvmm.h"
|
#include <gst/cuda/gstcudanvmm-private.h>
|
||||||
|
#include <nvbufsurface.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CUDA_GST_GL
|
#ifdef HAVE_CUDA_GST_GL
|
||||||
@ -272,7 +273,7 @@ create_transform_caps (GstCaps * caps, gboolean to_cuda)
|
|||||||
/* SRC -> SINK of cudadownload or SINK -> SRC of cudaupload */
|
/* SRC -> SINK of cudadownload or SINK -> SRC of cudaupload */
|
||||||
ret = gst_caps_copy (caps);
|
ret = gst_caps_copy (caps);
|
||||||
|
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#ifdef HAVE_CUDA_NVMM
|
||||||
if (gst_cuda_nvmm_init_once ()) {
|
if (gst_cuda_nvmm_init_once ()) {
|
||||||
new_caps = _set_caps_features (caps,
|
new_caps = _set_caps_features (caps,
|
||||||
GST_CAPS_FEATURE_MEMORY_CUDA_NVMM_MEMORY);
|
GST_CAPS_FEATURE_MEMORY_CUDA_NVMM_MEMORY);
|
||||||
@ -289,7 +290,7 @@ create_transform_caps (GstCaps * caps, gboolean to_cuda)
|
|||||||
/* SINK -> SRC of cudadownload or SRC -> SINK of cudaupload */
|
/* SINK -> SRC of cudadownload or SRC -> SINK of cudaupload */
|
||||||
ret = gst_caps_ref (caps);
|
ret = gst_caps_ref (caps);
|
||||||
|
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#ifdef HAVE_CUDA_NVMM
|
||||||
if (gst_cuda_nvmm_init_once ()) {
|
if (gst_cuda_nvmm_init_once ()) {
|
||||||
new_caps = _set_caps_features (caps,
|
new_caps = _set_caps_features (caps,
|
||||||
GST_CAPS_FEATURE_MEMORY_CUDA_NVMM_MEMORY);
|
GST_CAPS_FEATURE_MEMORY_CUDA_NVMM_MEMORY);
|
||||||
@ -529,7 +530,7 @@ gst_cuda_memory_copy_propose_allocation (GstBaseTransform * trans,
|
|||||||
|
|
||||||
pool = gst_d3d11_buffer_pool_new (self->d3d11_device);
|
pool = gst_d3d11_buffer_pool_new (self->d3d11_device);
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#ifdef HAVE_CUDA_NVMM
|
||||||
} else if (features && gst_caps_features_contains (features,
|
} else if (features && gst_caps_features_contains (features,
|
||||||
GST_CAPS_FEATURE_MEMORY_CUDA_NVMM_MEMORY) &&
|
GST_CAPS_FEATURE_MEMORY_CUDA_NVMM_MEMORY) &&
|
||||||
gst_cuda_nvmm_init_once ()) {
|
gst_cuda_nvmm_init_once ()) {
|
||||||
@ -618,7 +619,7 @@ gst_cuda_memory_copy_decide_allocation (GstBaseTransform * trans,
|
|||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
gboolean need_d3d11 = FALSE;
|
gboolean need_d3d11 = FALSE;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#ifdef HAVE_CUDA_NVMM
|
||||||
gboolean need_nvmm = FALSE;
|
gboolean need_nvmm = FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -652,7 +653,7 @@ gst_cuda_memory_copy_decide_allocation (GstBaseTransform * trans,
|
|||||||
need_d3d11 = TRUE;
|
need_d3d11 = TRUE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#ifdef HAVE_CUDA_NVMM
|
||||||
else if (features && gst_caps_features_contains (features,
|
else if (features && gst_caps_features_contains (features,
|
||||||
GST_CAPS_FEATURE_MEMORY_CUDA_NVMM_MEMORY) &&
|
GST_CAPS_FEATURE_MEMORY_CUDA_NVMM_MEMORY) &&
|
||||||
gst_cuda_nvmm_init_once ()) {
|
gst_cuda_nvmm_init_once ()) {
|
||||||
@ -673,7 +674,7 @@ gst_cuda_memory_copy_decide_allocation (GstBaseTransform * trans,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#ifdef HAVE_CUDA_NVMM
|
||||||
if (need_nvmm) {
|
if (need_nvmm) {
|
||||||
/* XXX: Always create new pool to set config option */
|
/* XXX: Always create new pool to set config option */
|
||||||
gst_clear_object (&pool);
|
gst_clear_object (&pool);
|
||||||
@ -705,7 +706,7 @@ gst_cuda_memory_copy_decide_allocation (GstBaseTransform * trans,
|
|||||||
pool = gst_d3d11_buffer_pool_new (self->d3d11_device);
|
pool = gst_d3d11_buffer_pool_new (self->d3d11_device);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#ifdef HAVE_CUDA_NVMM
|
||||||
else if (need_nvmm) {
|
else if (need_nvmm) {
|
||||||
guint gpu_id = 0;
|
guint gpu_id = 0;
|
||||||
GST_DEBUG_OBJECT (self, "create nvmm pool");
|
GST_DEBUG_OBJECT (self, "create nvmm pool");
|
||||||
@ -859,7 +860,7 @@ gst_cuda_memory_copy_set_info (GstCudaBaseTransform * btrans,
|
|||||||
gst_clear_object (&self->d3d11_device);
|
gst_clear_object (&self->d3d11_device);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#ifdef HAVE_CUDA_NVMM
|
||||||
if (gst_cuda_nvmm_init_once ()) {
|
if (gst_cuda_nvmm_init_once ()) {
|
||||||
if (in_features && gst_caps_features_contains (in_features,
|
if (in_features && gst_caps_features_contains (in_features,
|
||||||
GST_CAPS_FEATURE_MEMORY_CUDA_NVMM_MEMORY)) {
|
GST_CAPS_FEATURE_MEMORY_CUDA_NVMM_MEMORY)) {
|
||||||
@ -1160,7 +1161,7 @@ gst_cuda_memory_copy_register (GstPlugin * plugin, guint rank)
|
|||||||
};
|
};
|
||||||
GstCaps *sys_caps;
|
GstCaps *sys_caps;
|
||||||
GstCaps *cuda_caps;
|
GstCaps *cuda_caps;
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#ifdef HAVE_CUDA_NVMM
|
||||||
GstCaps *nvmm_caps = NULL;
|
GstCaps *nvmm_caps = NULL;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_CUDA_GST_GL
|
#ifdef HAVE_CUDA_GST_GL
|
||||||
@ -1183,7 +1184,7 @@ gst_cuda_memory_copy_register (GstPlugin * plugin, guint rank)
|
|||||||
cuda_caps =
|
cuda_caps =
|
||||||
gst_caps_from_string (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
|
gst_caps_from_string (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
|
||||||
(GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY, GST_CUDA_FORMATS));
|
(GST_CAPS_FEATURE_MEMORY_CUDA_MEMORY, GST_CUDA_FORMATS));
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#ifdef HAVE_CUDA_NVMM
|
||||||
if (gst_cuda_nvmm_init_once ()) {
|
if (gst_cuda_nvmm_init_once ()) {
|
||||||
nvmm_caps =
|
nvmm_caps =
|
||||||
gst_caps_from_string (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
|
gst_caps_from_string (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
|
||||||
@ -1209,7 +1210,7 @@ gst_cuda_memory_copy_register (GstPlugin * plugin, guint rank)
|
|||||||
upload_sink_caps =
|
upload_sink_caps =
|
||||||
gst_caps_merge (upload_sink_caps, gst_caps_copy (d3d11_caps));
|
gst_caps_merge (upload_sink_caps, gst_caps_copy (d3d11_caps));
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#ifdef HAVE_CUDA_NVMM
|
||||||
if (nvmm_caps) {
|
if (nvmm_caps) {
|
||||||
upload_sink_caps = gst_caps_merge (upload_sink_caps,
|
upload_sink_caps = gst_caps_merge (upload_sink_caps,
|
||||||
gst_caps_copy (nvmm_caps));
|
gst_caps_copy (nvmm_caps));
|
||||||
@ -1219,7 +1220,7 @@ gst_cuda_memory_copy_register (GstPlugin * plugin, guint rank)
|
|||||||
gst_caps_merge (upload_sink_caps, gst_caps_copy (cuda_caps));
|
gst_caps_merge (upload_sink_caps, gst_caps_copy (cuda_caps));
|
||||||
|
|
||||||
upload_src_caps = gst_caps_copy (cuda_caps);
|
upload_src_caps = gst_caps_copy (cuda_caps);
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#ifdef HAVE_CUDA_NVMM
|
||||||
if (nvmm_caps) {
|
if (nvmm_caps) {
|
||||||
upload_src_caps = gst_caps_merge (upload_src_caps,
|
upload_src_caps = gst_caps_merge (upload_src_caps,
|
||||||
gst_caps_copy (nvmm_caps));
|
gst_caps_copy (nvmm_caps));
|
||||||
@ -1228,7 +1229,7 @@ gst_cuda_memory_copy_register (GstPlugin * plugin, guint rank)
|
|||||||
upload_src_caps = gst_caps_merge (upload_src_caps, gst_caps_copy (sys_caps));
|
upload_src_caps = gst_caps_merge (upload_src_caps, gst_caps_copy (sys_caps));
|
||||||
|
|
||||||
download_sink_caps = gst_caps_copy (cuda_caps);
|
download_sink_caps = gst_caps_copy (cuda_caps);
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#ifdef HAVE_CUDA_NVMM
|
||||||
if (nvmm_caps) {
|
if (nvmm_caps) {
|
||||||
download_sink_caps = gst_caps_merge (download_sink_caps,
|
download_sink_caps = gst_caps_merge (download_sink_caps,
|
||||||
gst_caps_copy (nvmm_caps));
|
gst_caps_copy (nvmm_caps));
|
||||||
@ -1244,7 +1245,7 @@ gst_cuda_memory_copy_register (GstPlugin * plugin, guint rank)
|
|||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
download_src_caps = gst_caps_merge (download_src_caps, d3d11_caps);
|
download_src_caps = gst_caps_merge (download_src_caps, d3d11_caps);
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#ifdef HAVE_CUDA_NVMM
|
||||||
if (nvmm_caps) {
|
if (nvmm_caps) {
|
||||||
download_src_caps = gst_caps_merge (download_src_caps, nvmm_caps);
|
download_src_caps = gst_caps_merge (download_src_caps, nvmm_caps);
|
||||||
}
|
}
|
||||||
|
@ -27,10 +27,6 @@ nvcodec_sources = [
|
|||||||
'plugin.c',
|
'plugin.c',
|
||||||
]
|
]
|
||||||
|
|
||||||
nvmm_sources = [
|
|
||||||
'gstcudanvmm.c',
|
|
||||||
]
|
|
||||||
|
|
||||||
nvcodec_win32_sources = [
|
nvcodec_win32_sources = [
|
||||||
'gstcudaipcclient_win32.cpp',
|
'gstcudaipcclient_win32.cpp',
|
||||||
'gstcudaipcserver_win32.cpp',
|
'gstcudaipcserver_win32.cpp',
|
||||||
@ -61,18 +57,9 @@ if gstgl_dep.found()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
if host_system == 'linux'
|
if host_system == 'linux'
|
||||||
have_nvmm = false
|
if have_nvbufsurface_h
|
||||||
if cc.has_header('nvbufsurface.h')
|
extra_args += ['-DHAVE_CUDA_NVMM']
|
||||||
have_nvmm = true
|
plugin_incdirs += gstcuda_nvmm_inc
|
||||||
elif cc.has_header('/opt/nvidia/deepstream/deepstream/sources/includes/nvbufsurface.h')
|
|
||||||
# XXX: Should add an option for SDK path??
|
|
||||||
have_nvmm = true
|
|
||||||
plugin_incdirs += [include_directories('/opt/nvidia/deepstream/deepstream/sources/includes')]
|
|
||||||
endif
|
|
||||||
|
|
||||||
if have_nvmm
|
|
||||||
extra_args += ['-DHAVE_NVCODEC_NVMM']
|
|
||||||
nvcodec_sources += nvmm_sources
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
gio_unix_dep = dependency('gio-unix-2.0', required : get_option('nvcodec'))
|
gio_unix_dep = dependency('gio-unix-2.0', required : get_option('nvcodec'))
|
||||||
|
@ -40,9 +40,7 @@
|
|||||||
#include "gstnvdecoder.h"
|
#include "gstnvdecoder.h"
|
||||||
#include "gstcudamemorycopy.h"
|
#include "gstcudamemorycopy.h"
|
||||||
#include "gstcudaconvertscale.h"
|
#include "gstcudaconvertscale.h"
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
#include <gst/cuda/gstcudanvmm-private.h>
|
||||||
#include "gstcudanvmm.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
#include <gst/d3d11/gstd3d11.h>
|
#include <gst/d3d11/gstd3d11.h>
|
||||||
@ -62,10 +60,6 @@ GST_DEBUG_CATEGORY (gst_nvdec_debug);
|
|||||||
GST_DEBUG_CATEGORY (gst_nvenc_debug);
|
GST_DEBUG_CATEGORY (gst_nvenc_debug);
|
||||||
GST_DEBUG_CATEGORY (gst_nv_decoder_debug);
|
GST_DEBUG_CATEGORY (gst_nv_decoder_debug);
|
||||||
|
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
|
||||||
GST_DEBUG_CATEGORY (gst_cuda_nvmm_debug);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define GST_CAT_DEFAULT gst_nvcodec_debug
|
#define GST_CAT_DEFAULT gst_nvcodec_debug
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
@ -135,10 +129,6 @@ plugin_init (GstPlugin * plugin)
|
|||||||
GST_DEBUG_CATEGORY_INIT (gst_nvenc_debug, "nvenc", 0, "nvenc");
|
GST_DEBUG_CATEGORY_INIT (gst_nvenc_debug, "nvenc", 0, "nvenc");
|
||||||
GST_DEBUG_CATEGORY_INIT (gst_nv_decoder_debug, "nvdecoder", 0, "nvdecoder");
|
GST_DEBUG_CATEGORY_INIT (gst_nv_decoder_debug, "nvdecoder", 0, "nvdecoder");
|
||||||
|
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
|
||||||
GST_DEBUG_CATEGORY_INIT (gst_cuda_nvmm_debug, "cudanvmm", 0, "cudanvmm");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!gst_cuda_load_library ()) {
|
if (!gst_cuda_load_library ()) {
|
||||||
gst_plugin_add_status_warning (plugin,
|
gst_plugin_add_status_warning (plugin,
|
||||||
"CUDA library \"" CUDA_LIBNAME "\" was not found.");
|
"CUDA library \"" CUDA_LIBNAME "\" was not found.");
|
||||||
@ -354,12 +344,8 @@ plugin_init (GstPlugin * plugin)
|
|||||||
"cudaipcsrc", GST_RANK_NONE, GST_TYPE_CUDA_IPC_SRC);
|
"cudaipcsrc", GST_RANK_NONE, GST_TYPE_CUDA_IPC_SRC);
|
||||||
|
|
||||||
gst_cuda_memory_init_once ();
|
gst_cuda_memory_init_once ();
|
||||||
|
if (gst_cuda_nvmm_init_once ())
|
||||||
#ifdef HAVE_NVCODEC_NVMM
|
|
||||||
if (gst_cuda_nvmm_init_once ()) {
|
|
||||||
GST_INFO ("Enable NVMM support");
|
GST_INFO ("Enable NVMM support");
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
g_object_set_data_full (G_OBJECT (plugin),
|
g_object_set_data_full (G_OBJECT (plugin),
|
||||||
"plugin-nvcodec-shutdown", (gpointer) "shutdown-data",
|
"plugin-nvcodec-shutdown", (gpointer) "shutdown-data",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user