nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
nvcodec_sources = [
|
2022-11-09 12:31:01 +00:00
|
|
|
'gstcudabasetransform.c',
|
2022-11-11 19:06:32 +00:00
|
|
|
'gstcudaconverter.c',
|
2022-11-09 12:31:01 +00:00
|
|
|
'gstcudaconvertscale.c',
|
2023-04-18 16:56:20 +00:00
|
|
|
'gstcudaipc.cpp',
|
|
|
|
'gstcudaipcclient.cpp',
|
|
|
|
'gstcudaipcserver.cpp',
|
|
|
|
'gstcudaipcsink.cpp',
|
|
|
|
'gstcudaipcsrc.cpp',
|
2022-11-09 12:31:01 +00:00
|
|
|
'gstcudamemorycopy.c',
|
|
|
|
'gstcuvidloader.c',
|
2023-02-07 16:42:55 +00:00
|
|
|
'gstnvav1dec.cpp',
|
2024-04-28 09:26:43 +00:00
|
|
|
'gstnvav1encoder.cpp',
|
2022-11-09 12:31:01 +00:00
|
|
|
'gstnvdec.c',
|
2023-02-07 17:25:35 +00:00
|
|
|
'gstnvdecobject.cpp',
|
2023-02-07 16:42:55 +00:00
|
|
|
'gstnvdecoder.cpp',
|
2022-11-09 12:31:01 +00:00
|
|
|
'gstnvenc.c',
|
2023-02-05 14:12:47 +00:00
|
|
|
'gstnvencobject.cpp',
|
2022-03-15 19:58:16 +00:00
|
|
|
'gstnvencoder.cpp',
|
2023-02-07 16:42:55 +00:00
|
|
|
'gstnvh264dec.cpp',
|
2022-03-15 19:58:16 +00:00
|
|
|
'gstnvh264encoder.cpp',
|
2023-02-07 16:42:55 +00:00
|
|
|
'gstnvh265dec.cpp',
|
2022-03-15 19:58:16 +00:00
|
|
|
'gstnvh265encoder.cpp',
|
2024-01-29 17:58:03 +00:00
|
|
|
'gstnvjpegenc.cpp',
|
2023-02-07 16:42:55 +00:00
|
|
|
'gstnvvp8dec.cpp',
|
|
|
|
'gstnvvp9dec.cpp',
|
2022-11-09 12:31:01 +00:00
|
|
|
'plugin.c',
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
]
|
|
|
|
|
2022-03-04 17:30:24 +00:00
|
|
|
nvmm_sources = [
|
|
|
|
'gstcudanvmm.c',
|
|
|
|
]
|
|
|
|
|
2023-04-18 16:56:20 +00:00
|
|
|
nvcodec_win32_sources = [
|
|
|
|
'gstcudaipcclient_win32.cpp',
|
|
|
|
'gstcudaipcserver_win32.cpp',
|
|
|
|
]
|
|
|
|
|
|
|
|
nvcodec_unix_sources = [
|
|
|
|
'gstcudaipcclient_unix.cpp',
|
|
|
|
'gstcudaipcserver_unix.cpp',
|
|
|
|
]
|
|
|
|
|
2019-07-23 00:40:24 +00:00
|
|
|
if get_option('nvcodec').disabled()
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2022-04-23 15:37:40 +00:00
|
|
|
if not gstcuda_dep.found()
|
|
|
|
if get_option('nvcodec').enabled()
|
|
|
|
error('The nvcodec was enabled explicitly, but required gstcuda dependency is not found')
|
|
|
|
endif
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2021-12-08 11:48:08 +00:00
|
|
|
plugin_incdirs = [configinc, cuda_stubinc]
|
2022-03-15 19:58:16 +00:00
|
|
|
extra_args = ['-DGST_USE_UNSTABLE_API']
|
2023-04-18 16:56:20 +00:00
|
|
|
extra_deps = []
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
|
|
|
|
if gstgl_dep.found()
|
2023-02-17 15:36:29 +00:00
|
|
|
extra_args += ['-DHAVE_CUDA_GST_GL']
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
endif
|
|
|
|
|
2022-03-04 17:30:24 +00:00
|
|
|
if host_system == 'linux'
|
|
|
|
have_nvmm = false
|
|
|
|
if cc.has_header('nvbufsurface.h')
|
|
|
|
have_nvmm = true
|
|
|
|
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
|
2022-03-15 19:58:16 +00:00
|
|
|
extra_args += ['-DHAVE_NVCODEC_NVMM']
|
2022-03-04 17:30:24 +00:00
|
|
|
nvcodec_sources += nvmm_sources
|
|
|
|
endif
|
2023-04-18 16:56:20 +00:00
|
|
|
|
|
|
|
gio_unix_dep = dependency('gio-unix-2.0', required : get_option('nvcodec'))
|
|
|
|
extra_deps += [gio_dep, gio_unix_dep]
|
|
|
|
|
|
|
|
nvcodec_sources += nvcodec_unix_sources
|
|
|
|
else
|
|
|
|
nvcodec_sources += nvcodec_win32_sources
|
2022-03-04 17:30:24 +00:00
|
|
|
endif
|
|
|
|
|
2022-05-03 16:03:37 +00:00
|
|
|
if cc.get_id() != 'msvc'
|
|
|
|
if host_system == 'windows'
|
|
|
|
# MinGW 32bits compiler seems to be complaining about redundant-decls
|
|
|
|
# when ComPtr is in use. Let's just disable the warning
|
2022-03-15 19:58:16 +00:00
|
|
|
extra_args += cc.get_supported_arguments([
|
|
|
|
'-Wno-redundant-decls',
|
|
|
|
])
|
|
|
|
endif
|
2022-05-03 16:03:37 +00:00
|
|
|
|
|
|
|
# Allow deprecated decls since it's part of SDK header
|
|
|
|
extra_args += cc.get_supported_arguments([
|
|
|
|
'-Wno-deprecated-declarations',
|
|
|
|
])
|
2022-03-15 19:58:16 +00:00
|
|
|
endif
|
|
|
|
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
gstnvcodec = library('gstnvcodec',
|
|
|
|
nvcodec_sources,
|
2022-03-15 19:58:16 +00:00
|
|
|
c_args : gst_plugins_bad_args + extra_args,
|
|
|
|
cpp_args : gst_plugins_bad_args + extra_args,
|
2019-07-23 00:40:24 +00:00
|
|
|
include_directories : plugin_incdirs,
|
2023-04-18 16:56:20 +00:00
|
|
|
dependencies : [gstbase_dep, gstvideo_dep, gstpbutils_dep, gstgl_dep,
|
|
|
|
gstglproto_dep, gmodule_dep, gstcodecs_dep,
|
|
|
|
gstd3d11_dep, gstcuda_dep] + extra_deps,
|
2023-02-05 14:12:47 +00:00
|
|
|
override_options : ['cpp_std=c++14'],
|
nvdec,nvenc: Port to dynamic library loading
... and put them into new nvcodec plugin.
* nvcodec plugin
Now each nvenc and nvdec element is moved to be a part of nvcodec plugin
for better interoperability.
Additionally, cuda runtime API header dependencies
(i.e., cuda_runtime_api.h and cuda_gl_interop.h) are removed.
Note that cuda runtime APIs have prefix "cuda". Since 1.16 release with
Windows support, only "cuda.h" and "cudaGL.h" dependent symbols have
been used except for some defined types. However, those types could be
replaced with other types which were defined by "cuda.h".
* dynamic library loading
CUDA library will be opened with g_module_open() instead of build-time linking.
On Windows, nvcuda.dll is installed to system path by CUDA Toolkit
installer, and on *nix, user should ensure that libcuda.so.1 can be
loadable (i.e., via LD_LIBRARY_PATH or default dlopen path)
Therefore, NVIDIA_VIDEO_CODEC_SDK_PATH env build time dependency for Windows
is removed.
2019-05-17 13:27:50 +00:00
|
|
|
install : true,
|
|
|
|
install_dir : plugins_install_dir,
|
|
|
|
)
|
|
|
|
plugins += [gstnvcodec]
|
|
|
|
|