2021-10-03 08:17:00 +00:00
|
|
|
va_sources = files(
|
2022-02-23 07:40:19 +00:00
|
|
|
'gstvaallocator.c',
|
2021-05-06 10:23:23 +00:00
|
|
|
'gstvadisplay.c',
|
|
|
|
'gstvadisplay_wrapped.c',
|
2022-02-23 07:40:19 +00:00
|
|
|
'gstvapool.c',
|
2021-10-07 06:31:28 +00:00
|
|
|
'gstvautils.c',
|
2022-02-07 16:34:57 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
va_sources_priv = files(
|
|
|
|
'gstvasurfacecopy.c',
|
2022-02-23 07:25:08 +00:00
|
|
|
'gstvavideoformat.c',
|
2022-02-23 07:40:19 +00:00
|
|
|
'vasurfaceimage.c',
|
2021-10-03 08:17:00 +00:00
|
|
|
)
|
2021-05-06 10:23:23 +00:00
|
|
|
|
2021-10-03 08:17:00 +00:00
|
|
|
va_headers = files(
|
2021-10-27 03:08:39 +00:00
|
|
|
'gstva.h',
|
2022-02-23 07:40:19 +00:00
|
|
|
'gstvaallocator.h',
|
2021-05-06 10:23:23 +00:00
|
|
|
'gstvadisplay.h',
|
|
|
|
'gstvadisplay_wrapped.h',
|
2022-02-23 07:40:19 +00:00
|
|
|
'gstvapool.h',
|
2021-10-07 06:31:28 +00:00
|
|
|
'gstvautils.h',
|
2021-05-06 10:23:23 +00:00
|
|
|
'va-prelude.h',
|
2022-02-23 07:40:19 +00:00
|
|
|
'va_fwd.h',
|
2021-10-03 08:17:00 +00:00
|
|
|
)
|
2021-05-06 10:23:23 +00:00
|
|
|
|
2023-03-03 19:12:13 +00:00
|
|
|
va_linux_sources = files(
|
|
|
|
'gstvadisplay_drm.c',
|
|
|
|
)
|
|
|
|
|
|
|
|
va_linux_headers = files(
|
|
|
|
'gstvadisplay_drm.h',
|
|
|
|
)
|
|
|
|
|
|
|
|
va_win32_sources = files(
|
|
|
|
'gstvadisplay_win32.cpp',
|
|
|
|
)
|
|
|
|
|
|
|
|
va_win32_headers = files(
|
|
|
|
'gstvadisplay_win32.h',
|
|
|
|
)
|
|
|
|
|
2021-05-06 10:23:23 +00:00
|
|
|
gstva_dep = dependency('', required : false)
|
2023-03-03 19:12:13 +00:00
|
|
|
platform_deps = []
|
|
|
|
extra_args = ['-DGST_USE_UNSTABLE_API',
|
|
|
|
'-DBUILDING_GST_VA',
|
|
|
|
'-DG_LOG_DOMAIN="GStreamer-VA"']
|
2021-05-06 10:23:23 +00:00
|
|
|
|
2023-03-03 19:12:13 +00:00
|
|
|
if host_system not in ['linux', 'windows']
|
2021-05-06 10:23:23 +00:00
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2023-04-14 07:48:52 +00:00
|
|
|
va_opt = get_option('va')
|
2023-04-14 10:41:55 +00:00
|
|
|
if host_system == 'linux'
|
|
|
|
msdk_opt = get_option('msdk')
|
|
|
|
qsv_opt = get_option('qsv')
|
|
|
|
if va_opt.disabled() and msdk_opt.disabled() and qsv_opt.disabled()
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
va_required = va_opt.enabled() or msdk_opt.enabled() or qsv_opt.enabled()
|
|
|
|
else
|
|
|
|
if va_opt.disabled()
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
va_required = va_opt
|
2023-04-14 07:48:52 +00:00
|
|
|
endif
|
|
|
|
|
2023-06-06 11:26:12 +00:00
|
|
|
libva_req = ['>= 1.12']
|
2023-03-03 19:12:13 +00:00
|
|
|
if host_system == 'windows'
|
|
|
|
libva_req = ['>= 1.18']
|
|
|
|
endif
|
|
|
|
|
2023-04-14 07:48:52 +00:00
|
|
|
libva_dep = dependency('libva', version: libva_req, required: va_required,
|
2021-09-30 15:42:19 +00:00
|
|
|
fallback: ['libva', 'libva_dep'])
|
2023-03-03 19:12:13 +00:00
|
|
|
if not libva_dep.found()
|
2021-05-06 10:23:23 +00:00
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2023-03-03 19:12:13 +00:00
|
|
|
if host_system == 'linux'
|
2023-04-14 07:48:52 +00:00
|
|
|
libva_drm_dep = dependency('libva-drm', version: libva_req, required: va_required,
|
2023-03-03 19:12:13 +00:00
|
|
|
fallback: ['libva', 'libva_drm_dep'])
|
|
|
|
if not libva_drm_dep.found()
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
platform_deps += [libva_drm_dep]
|
|
|
|
|
2023-04-14 10:41:55 +00:00
|
|
|
libdrm_dep = dependency('libdrm', version: '>=2.4', required: get_option('drm'))
|
2023-03-03 19:12:13 +00:00
|
|
|
if libdrm_dep.found()
|
|
|
|
platform_deps += [libdrm_dep]
|
|
|
|
extra_args += ['-DHAVE_LIBDRM']
|
|
|
|
endif
|
|
|
|
|
|
|
|
va_sources += va_linux_sources
|
|
|
|
va_headers += va_linux_headers
|
|
|
|
else
|
2023-04-14 07:48:52 +00:00
|
|
|
libva_win32_dep = dependency('libva-win32', version: libva_req, required: va_required,
|
2023-03-03 19:12:13 +00:00
|
|
|
fallback: ['libva', 'libva_win32_dep'])
|
|
|
|
if not libva_win32_dep.found()
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2023-04-14 07:48:52 +00:00
|
|
|
dxgi_lib = cc.find_library('dxgi', required: va_required)
|
2023-03-03 19:12:13 +00:00
|
|
|
if not dxgi_lib.found()
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
|
|
|
platform_deps += [libva_win32_dep, dxgi_lib]
|
|
|
|
|
|
|
|
va_sources += va_win32_sources
|
|
|
|
va_headers += va_win32_headers
|
|
|
|
endif
|
2021-05-06 10:23:23 +00:00
|
|
|
|
2022-03-29 12:52:33 +00:00
|
|
|
va_enums = gnome.mkenums_simple('va-enumtypes',
|
|
|
|
sources: ['gstva.h'],
|
|
|
|
decorator: 'GST_VA_API',
|
|
|
|
header_prefix: '#include <gst/va/va-prelude.h>',
|
|
|
|
body_prefix: '#ifdef HAVE_CONFIG_H\n#include "config.h"\n#endif',
|
2021-10-03 08:17:00 +00:00
|
|
|
install_header: true,
|
|
|
|
install_dir : join_paths(get_option('includedir'), 'gstreamer-1.0/gst/va'),
|
|
|
|
)
|
2022-03-29 12:52:33 +00:00
|
|
|
|
2022-04-01 20:09:10 +00:00
|
|
|
va_enumtypes_h = va_enums[1]
|
2021-10-03 08:17:00 +00:00
|
|
|
va_gen_sources = [va_enumtypes_h]
|
2022-04-01 20:09:10 +00:00
|
|
|
|
2021-05-06 10:23:23 +00:00
|
|
|
gstva = library('gstva-' + api_version,
|
2022-02-07 16:34:57 +00:00
|
|
|
va_sources, va_sources_priv, va_enums,
|
2023-03-03 19:12:13 +00:00
|
|
|
c_args : gst_plugins_bad_args + extra_args,
|
|
|
|
cpp_args : gst_plugins_bad_args + extra_args,
|
2021-05-06 10:23:23 +00:00
|
|
|
include_directories : [configinc, libsinc],
|
|
|
|
version : libversion,
|
|
|
|
soversion : soversion,
|
|
|
|
install : true,
|
2023-03-03 19:12:13 +00:00
|
|
|
dependencies : [gst_dep, gstbase_dep, gstvideo_dep, gstallocators_dep, libva_dep] + platform_deps,
|
2021-05-06 10:23:23 +00:00
|
|
|
)
|
|
|
|
|
2021-10-03 08:17:00 +00:00
|
|
|
library_def = {'lib': gstva}
|
2022-02-07 11:34:53 +00:00
|
|
|
pkg_name = 'gstreamer-va-' + api_version
|
2021-10-03 08:17:00 +00:00
|
|
|
|
|
|
|
pkgconfig.generate(gstva,
|
|
|
|
libraries : [gst_dep, gstvideo_dep],
|
|
|
|
variables : pkgconfig_variables,
|
|
|
|
subdirs : pkgconfig_subdirs,
|
|
|
|
name : pkg_name,
|
|
|
|
description : 'GStreamer VA support',
|
|
|
|
)
|
|
|
|
|
|
|
|
if build_gir
|
|
|
|
gir = {
|
|
|
|
'sources' : [va_sources, va_headers, va_enums],
|
|
|
|
'namespace' : 'GstVa',
|
|
|
|
'nsversion' : api_version,
|
|
|
|
'identifier_prefix' : 'Gst',
|
|
|
|
'symbol_prefix' : 'gst',
|
|
|
|
'export_packages' : pkg_name,
|
|
|
|
'includes' : ['Gst-1.0', 'GstBase-1.0', 'GstVideo-1.0'],
|
|
|
|
'install' : true,
|
|
|
|
'extra_args' : gir_init_section + ['-DGST_USE_UNSTABLE_API'],
|
2023-03-03 19:12:13 +00:00
|
|
|
'dependencies' : [gst_dep, gstbase_dep, gstvideo_dep, gstallocators_dep, libva_dep] + platform_deps
|
2021-10-03 08:17:00 +00:00
|
|
|
}
|
|
|
|
library_def = {'lib': library_def['lib'], 'gir': [gir]}
|
|
|
|
if not static_build
|
|
|
|
va_gir = gnome.generate_gir(gstva, kwargs: gir)
|
2023-04-23 14:05:17 +00:00
|
|
|
library_def += {'gir_targets': library_def.get('gir_targets', []) + [va_gir]}
|
2021-10-03 08:17:00 +00:00
|
|
|
va_gen_sources += va_gir
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
gst_libraries += [[pkg_name, library_def]]
|
|
|
|
|
|
|
|
install_headers(va_headers, subdir : 'gstreamer-1.0/gst/va/')
|
2021-05-06 10:23:23 +00:00
|
|
|
|
|
|
|
gstva_dep = declare_dependency(link_with : gstva,
|
|
|
|
include_directories : [libsinc],
|
2023-03-03 19:12:13 +00:00
|
|
|
dependencies : [gst_dep, gstvideo_dep, gstallocators_dep, libva_dep] + platform_deps,
|
2021-10-03 08:17:00 +00:00
|
|
|
sources : va_gen_sources)
|
2022-04-01 20:09:10 +00:00
|
|
|
|
2020-06-27 04:39:00 +00:00
|
|
|
meson.override_dependency(pkg_name, gstva_dep)
|