2016-08-12 15:42:30 +00:00
|
|
|
vpx_sources = [
|
|
|
|
'gstvp8dec.c',
|
|
|
|
'gstvp8enc.c',
|
|
|
|
'gstvp8utils.c',
|
|
|
|
'gstvp9dec.c',
|
|
|
|
'gstvp9enc.c',
|
|
|
|
'gstvpxdec.c',
|
|
|
|
'gstvpxenc.c',
|
2021-02-15 10:00:46 +00:00
|
|
|
'gstvpxelement.c',
|
2016-08-12 15:42:30 +00:00
|
|
|
'plugin.c',
|
|
|
|
]
|
|
|
|
|
|
|
|
vpx_features = [
|
|
|
|
[ 'vpx/vp8cx.h', 'vpx_codec_vp8_cx_algo', '-DHAVE_VP8_ENCODER', 'VP8 encoder' ],
|
|
|
|
[ 'vpx/vp8dx.h', 'vpx_codec_vp8_dx_algo', '-DHAVE_VP8_DECODER', 'VP8 decoder' ],
|
|
|
|
[ 'vpx/vp8cx.h', 'vpx_codec_vp9_cx_algo', '-DHAVE_VP9_ENCODER', 'VP9 encoder' ],
|
|
|
|
[ 'vpx/vp8dx.h', 'vpx_codec_vp9_dx_algo', '-DHAVE_VP9_DECODER', 'VP9 decoder' ],
|
|
|
|
]
|
|
|
|
|
2019-11-05 16:11:55 +00:00
|
|
|
vpx_option = get_option('vpx')
|
2023-08-08 01:22:14 +00:00
|
|
|
vpx_dep = dependency('vpx', version : '>=1.7.0', required : vpx_option, allow_fallback: true)
|
2016-08-12 15:42:30 +00:00
|
|
|
|
|
|
|
if vpx_dep.found()
|
|
|
|
vpx_args = []
|
|
|
|
foreach f : vpx_features
|
|
|
|
header = f.get(0)
|
|
|
|
codec_iface = f.get(1)
|
|
|
|
extra_define = f.get(2)
|
|
|
|
link_code = '''#include <@0@>
|
|
|
|
int main (int a, char ** g) {
|
|
|
|
const vpx_codec_iface_t *c = &@1@;
|
|
|
|
return c != 0;
|
|
|
|
}'''.format(header,codec_iface)
|
2023-08-08 01:22:14 +00:00
|
|
|
# Link-time checks are only compatible with externally supplied libraries
|
|
|
|
if vpx_dep.type_name() == 'internal'
|
|
|
|
vpx_codec = vpx_dep.get_variable(f.get(3).split(' ')[0].to_lower())
|
|
|
|
vpx_feature = vpx_dep.get_variable(f.get(3).to_lower().underscorify())
|
|
|
|
if vpx_feature == 'true' and vpx_codec == 'true'
|
|
|
|
vpx_args += extra_define
|
|
|
|
message('libvpx provides @0@ interface (@1@)'.format(f.get(3),f.get(1)))
|
|
|
|
have_vpx_feature = true
|
|
|
|
else
|
|
|
|
message('libvpx does not provide @0@ interface (@1@)'.format(f.get(3),f.get(1)))
|
|
|
|
have_vpx_feature = false
|
|
|
|
endif
|
2016-08-12 15:42:30 +00:00
|
|
|
else
|
2023-08-08 01:22:14 +00:00
|
|
|
if cc.links(link_code, dependencies : vpx_dep)
|
|
|
|
vpx_args += extra_define
|
|
|
|
message('libvpx provides @0@ interface (@1@)'.format(f.get(3),f.get(1)))
|
|
|
|
have_vpx_feature = true
|
|
|
|
else
|
|
|
|
message('libvpx does not provide @0@ interface (@1@)'.format(f.get(3),f.get(1)))
|
|
|
|
have_vpx_feature = false
|
|
|
|
endif
|
2016-08-12 15:42:30 +00:00
|
|
|
endif
|
2016-09-26 13:30:00 +00:00
|
|
|
set_variable('have_' + f.get(3).to_lower().underscorify(), have_vpx_feature)
|
2016-08-12 15:42:30 +00:00
|
|
|
endforeach
|
|
|
|
|
|
|
|
if vpx_args.length() == 0
|
2019-11-05 16:11:55 +00:00
|
|
|
msg = 'libvpx was built without any encoder or decoder features!'
|
|
|
|
# Error out if explicitly enabled, but continue with a warning if the
|
|
|
|
# plugin is in auto-detect mode to reduce build-time friction.
|
|
|
|
if vpx_option.enabled()
|
|
|
|
error(msg)
|
|
|
|
endif
|
|
|
|
warning(msg)
|
2016-08-12 15:42:30 +00:00
|
|
|
endif
|
|
|
|
|
2019-08-19 10:03:00 +00:00
|
|
|
if vpx_dep.version().version_compare('>= 1.8.0')
|
|
|
|
message('Found vpx >= 1.8.0')
|
2019-02-05 21:14:18 +00:00
|
|
|
vpx_args += '-DHAVE_VPX_1_8'
|
|
|
|
endif
|
|
|
|
|
2021-04-09 17:22:29 +00:00
|
|
|
gnome = import('gnome')
|
|
|
|
|
|
|
|
gstvpx_enums = gnome.mkenums_simple('gstvpx-enumtypes',
|
|
|
|
sources : ['gstvpxenums.h'],
|
|
|
|
decorator : 'G_GNUC_INTERNAL',
|
|
|
|
install_header: false)
|
|
|
|
|
2016-08-12 15:42:30 +00:00
|
|
|
gstvpx = library('gstvpx',
|
2021-04-09 17:22:29 +00:00
|
|
|
vpx_sources, gstvpx_enums,
|
2016-08-12 15:42:30 +00:00
|
|
|
c_args : gst_plugins_good_args + vpx_args,
|
|
|
|
include_directories : [configinc],
|
|
|
|
dependencies : [gstbase_dep, gsttag_dep, gstvideo_dep, vpx_dep],
|
|
|
|
install : true,
|
|
|
|
install_dir : plugins_install_dir,
|
|
|
|
)
|
2018-10-22 09:39:55 +00:00
|
|
|
plugins += [gstvpx]
|
2016-12-16 19:51:48 +00:00
|
|
|
|
|
|
|
install_data(sources: ['GstVP8Enc.prs'], install_dir: presetdir)
|
2022-02-21 16:37:26 +00:00
|
|
|
env = environment()
|
|
|
|
env.prepend('GST_PRESET_PATH', meson.current_source_dir())
|
|
|
|
meson.add_devenv(env)
|
2016-08-12 15:42:30 +00:00
|
|
|
endif
|