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 = [
|
|
|
|
'plugin.c',
|
|
|
|
'gstnvenc.c',
|
|
|
|
'gstnvbaseenc.c',
|
|
|
|
'gstnvh264enc.c',
|
|
|
|
'gstnvh265enc.c',
|
|
|
|
'gstcudaloader.c',
|
|
|
|
'gstnvdec.c',
|
|
|
|
'gstcuvidloader.c',
|
2018-11-23 13:01:41 +00:00
|
|
|
'gstcudacontext.c',
|
|
|
|
'gstcudautils.c',
|
2020-04-16 14:27:31 +00:00
|
|
|
'gstnvdecoder.c',
|
|
|
|
'gstnvh264dec.c',
|
2020-06-19 20:57:59 +00:00
|
|
|
'gstnvh265dec.c',
|
2019-08-19 09:02:56 +00:00
|
|
|
'gstcudamemory.c',
|
|
|
|
'gstcudabufferpool.c',
|
2019-10-16 13:42:06 +00:00
|
|
|
'gstcudabasetransform.c',
|
2022-03-03 18:33:41 +00:00
|
|
|
'gstcudamemorycopy.c',
|
2019-10-16 13:42:24 +00:00
|
|
|
'gstcudanvrtc.c',
|
|
|
|
'gstnvrtcloader.c',
|
2019-10-16 13:42:39 +00:00
|
|
|
'cuda-converter.c',
|
2019-10-16 13:42:55 +00:00
|
|
|
'gstcudafilter.c',
|
|
|
|
'gstcudabasefilter.c',
|
|
|
|
'gstcudaconvert.c',
|
2019-10-16 13:43:09 +00:00
|
|
|
'gstcudascale.c',
|
2020-10-30 11:37:44 +00:00
|
|
|
'gstnvvp8dec.c',
|
2020-10-30 14:22:01 +00:00
|
|
|
'gstnvvp9dec.c',
|
2022-03-15 19:58:16 +00:00
|
|
|
'gstnvencoder.cpp',
|
|
|
|
'gstnvh264encoder.cpp',
|
|
|
|
'gstnvh265encoder.cpp',
|
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',
|
|
|
|
]
|
|
|
|
|
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
|
|
|
|
|
2019-07-23 00:40:24 +00:00
|
|
|
plugin_incdirs = [configinc, include_directories('./stub')]
|
2022-03-15 19:58:16 +00:00
|
|
|
extra_args = ['-DGST_USE_UNSTABLE_API']
|
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()
|
2022-03-15 19:58:16 +00:00
|
|
|
extra_args += ['-DHAVE_NVCODEC_GST_GL=1']
|
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-02-28 13:40:51 +00:00
|
|
|
if gstd3d11_dep.found()
|
2022-03-15 19:58:16 +00:00
|
|
|
extra_args += ['-DHAVE_NVCODEC_GST_D3D11=1', '-DCOBJMACROS']
|
2022-02-28 13:40:51 +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
|
|
|
|
endif
|
|
|
|
|
2022-03-15 19:58:16 +00:00
|
|
|
override_opt = []
|
|
|
|
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
|
|
|
|
if cc.get_id() != 'msvc'
|
|
|
|
extra_args += cc.get_supported_arguments([
|
|
|
|
'-Wno-redundant-decls',
|
|
|
|
])
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
override_opt += ['cpp_std=c++11']
|
|
|
|
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,
|
|
|
|
override_options: override_opt,
|
2019-07-23 00:40:24 +00:00
|
|
|
include_directories : plugin_incdirs,
|
2022-02-28 13:40:51 +00:00
|
|
|
dependencies : [gstbase_dep, gstvideo_dep, gstpbutils_dep, gstgl_dep, gstglproto_dep, gmodule_dep, gstcodecs_dep, gstd3d11_dep],
|
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,
|
|
|
|
)
|
|
|
|
pkgconfig.generate(gstnvcodec, install_dir : plugins_pkgconfig_install_dir)
|
|
|
|
plugins += [gstnvcodec]
|
|
|
|
|