2022-02-11 20:35:54 +00:00
|
|
|
lame_dep = dependency('', required: false)
|
2018-07-25 02:05:28 +00:00
|
|
|
lame_option = get_option('lame')
|
2016-08-12 15:55:34 +00:00
|
|
|
|
2022-02-11 20:35:54 +00:00
|
|
|
if lame_option.disabled()
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2021-10-05 14:38:33 +00:00
|
|
|
lame_extra_c_args = []
|
2021-10-17 04:59:35 +00:00
|
|
|
lame_dep = cc.find_library('mp3lame', required: false)
|
|
|
|
have_lame = cc.has_header_symbol('lame/lame.h', 'lame_init')
|
|
|
|
if have_lame
|
2016-08-12 15:55:34 +00:00
|
|
|
if cc.has_header_symbol('lame/lame.h', 'lame_set_VBR_quality')
|
|
|
|
lame_extra_c_args += ['-DHAVE_LAME_SET_VBR_QUALITY']
|
|
|
|
endif
|
|
|
|
if cc.has_header_symbol('lame/lame.h', 'MEDIUM')
|
|
|
|
lame_extra_c_args += ['-DGSTLAME_PRESET']
|
|
|
|
endif
|
2021-10-05 14:38:33 +00:00
|
|
|
else
|
2021-10-17 04:59:35 +00:00
|
|
|
lame_dep = dependency('mp3lame', fallback: ['lame', 'lame_dep'], required: lame_option)
|
|
|
|
have_lame = lame_dep.found()
|
2021-10-05 14:38:33 +00:00
|
|
|
lame_extra_c_args += ['-DHAVE_LAME_SET_VBR_QUALITY', '-DGSTLAME_PRESET', '-DLAME_SUBPROJECT']
|
2016-08-12 15:55:34 +00:00
|
|
|
endif
|
2021-10-05 14:38:33 +00:00
|
|
|
|
|
|
|
if not have_lame
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
|
|
|
lame = library('gstlame',
|
|
|
|
['gstlamemp3enc.c', 'plugin.c'],
|
|
|
|
c_args : gst_plugins_good_args + lame_extra_c_args,
|
|
|
|
include_directories : [configinc, libsinc],
|
|
|
|
dependencies : [gstaudio_dep, lame_dep],
|
|
|
|
install : true,
|
|
|
|
install_dir : plugins_install_dir,
|
|
|
|
)
|
|
|
|
|
|
|
|
pkgconfig.generate(lame, install_dir : plugins_pkgconfig_install_dir)
|
|
|
|
plugins += [lame]
|