• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1winscreencap_sources = [
2  'gstdx9screencapsrc.c',
3  'gstgdiscreencapsrc.c',
4  'gstwinscreencap.c',
5]
6
7have_dxgi = false
8dxgi_c_args = []
9dxgiscreencap_sources = []
10dxgi_dep = []
11
12if host_system != 'windows' or get_option('winscreencap').disabled()
13  subdir_done()
14endif
15
16d3d_dep = cc.find_library('d3d9', required : get_option('winscreencap'))
17gdi_dep = cc.find_library('gdi32', required : get_option('winscreencap'))
18d3d11_dep = cc.find_library('d3d11', required : false)
19dxgi_lib_dep = cc.find_library('dxgi', required : false)
20windowscodecs_dep = cc.find_library('windowscodecs',  required : false)
21dxguid_dep = cc.find_library('dxguid',  required : false)
22
23have_d3d11_h = cc.has_header('d3d11.h')
24have_dxgi_h = cc.has_header('dxgi1_2.h')
25have_d3dcompiler_h = cc.has_header('d3dcompiler.h')
26have_versionhelpers_h = cc.has_header('versionhelpers.h')
27
28have_d3d9_h = cc.has_header('d3d9.h')
29if not have_d3d9_h and get_option('winscreencap').enabled()
30  error('winscreencap plugin enabled but d3d9.h not found')
31endif
32
33have_dxgi = d3d11_dep.found() and dxgi_lib_dep.found() and windowscodecs_dep.found() and dxguid_dep.found() and have_d3d11_h and have_dxgi_h and have_d3dcompiler_h and have_versionhelpers_h
34
35if have_dxgi
36  dxgi_c_args += ['-DHAVE_DXGI_CAP']
37  dxgiscreencap_sources += ['dxgicapture.c', 'gstdxgiscreencapsrc.c']
38  dxgi_dep += [gmodule_dep, d3d11_dep, dxgi_lib_dep, windowscodecs_dep, dxguid_dep]
39endif
40
41if d3d_dep.found() and gdi_dep.found() and have_d3d9_h
42  gstwinscreencap = library('gstwinscreencap',
43    winscreencap_sources + dxgiscreencap_sources,
44    c_args : gst_plugins_bad_args + dxgi_c_args,
45    include_directories : [configinc],
46    dependencies : [gstbase_dep, gstvideo_dep, d3d_dep, gdi_dep] + dxgi_dep,
47    install : true,
48    install_dir : plugins_install_dir,
49  )
50  pkgconfig.generate(gstwinscreencap, install_dir : plugins_pkgconfig_install_dir)
51  plugins += [gstwinscreencap]
52endif
53