Repository navigation
Expand file tree
/
Copy pathmeson.build
More file actions
98 lines (91 loc) · 3.26 KB
/
Copy pathmeson.build
File metadata and controls
98 lines (91 loc) · 3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
project(
'libva-v4l2', 'cpp', 'c',
version: '1.0.0',
meson_version: '>=0.61.0',
license: 'MIT',
default_options: ['cpp_std=c++17', 'warning_level=2'],
)
va = dependency('libva', version: '>=1.10')
drm = dependency('libdrm')
threads = dependency('threads')
gpu_copy_option = get_option('gpu_copy')
egl = dependency('egl', required: gpu_copy_option)
gles = dependency('glesv2', version: '>=3.2', required: gpu_copy_option)
gbm = dependency('gbm', required: gpu_copy_option)
have_gpu_copy = egl.found() and gles.found() and gbm.found()
copy_dependencies = []
copy_source = files('src/cpu-copy.cpp')
if have_gpu_copy
copy_dependencies = [egl, gles, gbm]
copy_source = files('src/gpu-copy.cpp')
endif
summary('GPU surface copy', have_gpu_copy)
cpp = meson.get_compiler('cpp')
fastcv_option = get_option('fastcv')
fastcv = cpp.find_library('fastcvopt', required: fastcv_option)
cdsprpc = cpp.find_library('cdsprpc', required: fastcv_option)
have_fastcv = false
if not fastcv_option.disabled() and fastcv.found() and cdsprpc.found()
have_fastcv = cpp.links('''
#include <fastcv/fastcv.h>
#include <fastcv/fastcvExt.h>
extern "C" void remote_register_buf(void *, int, int);
int main() {
fcvSetOperationModeExt(FASTCV_OP_EXT_QDSP);
fcvMemInit();
remote_register_buf(nullptr, 0, -1);
fcvScaleDownMNu8(nullptr, 0, 0, 0, nullptr, 0, 0, 0);
fcvScaleDownMNInterleaveu8(nullptr, 0, 0, 0, nullptr, 0, 0, 0);
fcvScaleUpPolyu8(nullptr, 0, 0, 0, nullptr, 0, 0, 0);
fcvScaleUpPolyInterleaveu8(nullptr, 0, 0, 0, nullptr, 0, 0, 0);
fcvMemDeInit();
fcvCleanUp();
}
''', dependencies: [fastcv, cdsprpc], name: 'FastCV CDSP scaling')
endif
if fastcv_option.enabled() and not have_fastcv
error('FastCV headers, scaling functions and libcdsprpc are required')
endif
vpp_dependencies = []
if have_fastcv
add_project_arguments('-DHAVE_FASTCV=1', language: 'cpp')
# FastCV/FastRPC are probed above, but loaded with dlopen at runtime.
vpp_dependencies = [cpp.find_library('dl', required: false)]
endif
summary('FastCV CDSP VPP', have_fastcv)
sources = files(
'src/backend.cpp',
'src/decoder.cpp',
'src/encoder.cpp',
'src/h264.cpp',
'src/hevc.cpp',
'src/msm.c',
'src/surface-copy.cpp',
'src/vp9.cpp',
'src/vpp.cpp',
)
headers = files('src/internal.hpp')
driver_install_dir = get_option('libdir') / 'dri'
shared_library(
'v4l2_drv_video',
sources + copy_source,
dependencies: [va, drm, threads] + copy_dependencies + vpp_dependencies,
name_prefix: '',
install: true,
install_dir: driver_install_dir,
)
# libva falls back to the DRM driver name on Qualcomm MSM devices.
install_symlink(
'msm_drv_video.so',
pointing_to: 'v4l2_drv_video.so',
install_dir: driver_install_dir,
install_tag: 'runtime',
)
install_data('README.md', install_dir: get_option('datadir') / 'doc' / meson.project_name())
install_data('LICENSE', install_dir: get_option('datadir') / 'licenses' / meson.project_name())
formatter = find_program('clang-format', required: false)
if formatter.found()
sources += files('src/cpu-copy.cpp', 'src/gpu-copy.cpp')
run_target('format', command: [formatter, '-i', '--style=file', sources, headers])
run_target('format-check', command: [formatter, '--dry-run', '--Werror', '--style=file', sources, headers])
endif