1nvenc_sources = [
2  'gstnvbaseenc.c',
3  'gstnvenc.c',
4  'gstnvh264enc.c',
5  'gstnvh265enc.c',
6]
7
8use_nvenc_gl = false
9extra_c_args = []
10
11nvenc_option = get_option('nvenc')
12if nvenc_option.disabled()
13  subdir_done()
14endif
15
16if cuda_dep.type_name() == 'internal'
17  if cc.has_header('cuda_gl_interop.h', args: '-I' + cuda_incdir)
18    use_nvenc_gl = true
19  endif
20else
21  if cc.has_header('cuda_gl_interop.h', dependencies: cuda_dep)
22    use_nvenc_gl = true
23  endif
24endif
25
26if use_nvenc_gl
27  nvenc_gl_dep = gstgl_dep
28  extra_c_args += ['-DHAVE_NVENC_GST_GL=1']
29endif
30
31gstnvenc = library('gstnvenc',
32  nvenc_sources,
33  c_args : gst_plugins_bad_args + extra_c_args,
34  include_directories : [configinc],
35  dependencies : [gstbase_dep, gstvideo_dep, gstpbutils_dep, nvenc_gl_dep, cuda_dep, cudart_dep, gmodule_dep],
36  install : true,
37  install_dir : plugins_install_dir,
38)
39pkgconfig.generate(gstnvenc, install_dir : plugins_pkgconfig_install_dir)
40
41