| 1 |
x264_opt = get_option('x264').require(gpl_allowed, error_message: ''' |
| 2 |
Plugin x264 explicitly required via options but GPL-licensed plugins disabled via options. |
| 3 |
Pass option -Dgpl=enabled to Meson to allow GPL-licensed plugins to be built. |
| 4 |
''') |
| 5 |
|
| 6 |
x264_sources = [ |
| 7 |
'gstx264enc.c', |
| 8 |
'gstencoderbitrateprofilemanager.c', |
| 9 |
] |
| 10 |
|
| 11 |
x264_headers = [ |
| 12 |
'gstx264enc.h', |
| 13 |
'gstencoderbitrateprofilemanager.h', |
| 14 |
] |
| 15 |
|
| 16 |
doc_sources = [] |
| 17 |
foreach s: x264_sources + x264_headers |
| 18 |
doc_sources += meson.current_source_dir() / s |
| 19 |
endforeach |
| 20 |
|
| 21 |
plugin_sources += { |
| 22 |
'x264': pathsep.join(doc_sources) |
| 23 |
} |
| 24 |
|
| 25 |
x264_dep = dependency('x264', version : '>=0.156', required : x264_opt, |
| 26 |
allow_fallback: true) |
| 27 |
|
| 28 |
if x264_dep.found() |
| 29 |
x264_libraries = get_option('x264_libraries') |
| 30 |
x264_args = [] |
| 31 |
if x264_libraries != '' |
| 32 |
x264_args += ['-DHAVE_X264_ADDITIONAL_LIBRARIES="@0@"'.format(x264_libraries)] |
| 33 |
extra_gmodule_dep = [gmodule_dep] |
| 34 |
else |
| 35 |
extra_gmodule_dep = [] |
| 36 |
endif |
| 37 |
|
| 38 |
gstx264 = library('gstx264', |
| 39 |
x264_sources, |
| 40 |
c_args : ugly_args + x264_args, |
| 41 |
include_directories : [configinc], |
| 42 |
dependencies : [gstbase_dep, gstvideo_dep, gstpbutils_dep, x264_dep] + extra_gmodule_dep, |
| 43 |
install : true, |
| 44 |
install_dir : plugins_install_dir, |
| 45 |
) |
| 46 |
plugins += [gstx264] |
| 47 |
|
| 48 |
install_data(sources: 'GstX264Enc.prs', install_dir: presetdir) |
| 49 |
env = environment() |
| 50 |
env.prepend('GST_PRESET_PATH', meson.current_source_dir()) |
| 51 |
meson.add_devenv(env) |
| 52 |
endif |