harmony: meson: enable OHAudio backend on OHOS
This commit is contained in:
1 parent
7021f883cb
commit
9941ad1da9
6 files changed
+26
-3
No files matched your search
@@ -55,6 +55,7 @@ extern const struct ao_driver audio_out_pcm;
|
||||
extern const struct ao_driver audio_out_lavc;
|
||||
extern const struct ao_driver audio_out_sdl;
|
||||
extern const struct ao_driver audio_out_aaudio;
|
||||
extern const struct ao_driver audio_out_harmony;
|
||||
|
||||
static const struct ao_driver * const audio_out_drivers[] = {
|
||||
// native:
|
||||
@@ -64,6 +65,9 @@ static const struct ao_driver * const audio_out_drivers[] = {
|
||||
#if HAVE_AAUDIO
|
||||
&audio_out_aaudio,
|
||||
#endif
|
||||
#if HAVE_HARMONY_AUDIO
|
||||
&audio_out_harmony,
|
||||
#endif
|
||||
#if HAVE_AUDIOUNIT
|
||||
&audio_out_audiounit,
|
||||
#endif
|
||||
|
||||
+17
@@ -72,6 +72,7 @@ sources = files(
|
||||
'audio/fmt-conversion.c',
|
||||
'audio/format.c',
|
||||
'audio/out/ao.c',
|
||||
'audio/out/ao_harmony.c',
|
||||
'audio/out/ao_lavc.c',
|
||||
'audio/out/ao_null.c',
|
||||
'audio/out/ao_pcm.c',
|
||||
@@ -915,6 +916,21 @@ if features['aaudio']
|
||||
sources += files('audio/out/ao_aaudio.c')
|
||||
endif
|
||||
|
||||
harmony_audio_opt = get_option('harmony-audio').require(
|
||||
ohos,
|
||||
error_message: 'HarmonyOS OHAudio is only available on OHOS targets!',
|
||||
)
|
||||
harmony_audio = cc.find_library('ohaudio', required: harmony_audio_opt)
|
||||
harmony_audio_headers = cc.has_header('ohaudio/native_audiostreambuilder.h',
|
||||
required: harmony_audio_opt)
|
||||
features += {'harmony-audio': harmony_audio.found() and harmony_audio_headers}
|
||||
if harmony_audio_opt.enabled() and not features['harmony-audio']
|
||||
error('HarmonyOS OHAudio headers or libohaudio.so were not found')
|
||||
endif
|
||||
if features['harmony-audio']
|
||||
dependencies += harmony_audio
|
||||
endif
|
||||
|
||||
opensles = cc.find_library('OpenSLES', required: get_option('opensles'))
|
||||
features += {'opensles': opensles.found()}
|
||||
if features['opensles']
|
||||
@@ -1950,6 +1966,7 @@ summary({'cocoa': features['cocoa'] and features['swift'],
|
||||
'curl': features['libcurl'],
|
||||
'd3d11': features['d3d11'],
|
||||
'drm': features['drm'],
|
||||
'harmony-audio': features['harmony-audio'],
|
||||
'javascript': features['javascript'],
|
||||
'libmpv': get_option('libmpv'),
|
||||
'lua': features['lua'],
|
||||
|
||||
@@ -50,6 +50,7 @@ option('jack', type: 'feature', value: 'auto', description: 'JACK audio output')
|
||||
option('openal', type: 'feature', value: 'disabled', description: 'OpenAL audio output')
|
||||
option('audiotrack', type: 'feature', value: 'auto', description: 'Android AudioTrack audio output')
|
||||
option('aaudio', type: 'feature', value: 'auto', description: 'Android AAudio audio output')
|
||||
option('harmony-audio', type: 'feature', value: 'auto', description: 'HarmonyOS OHAudio output')
|
||||
option('opensles', type: 'feature', value: 'auto', description: 'OpenSL ES audio output')
|
||||
option('oss-audio', type: 'feature', value: 'auto', description: 'OSSv4 audio output')
|
||||
option('pipewire', type: 'feature', value: 'auto', description: 'PipeWire audio output')
|
||||
|
||||
@@ -22,7 +22,7 @@ if ! meson setup "$BUILD" "$PROJECT_ROOT" $setup_mode \
|
||||
-Ddefault_library=shared -Dauto_features=disabled \
|
||||
-Dcplayer=false -Dlibmpv=true -Dtests=false -Dfuzzers=false \
|
||||
-Dgpl=true -Dbuild-date=false -Dplain-gl=enabled -Dgl=enabled \
|
||||
-Dzlib=enabled -Dvector=enabled -Dlua=disabled > "$LOG" 2>&1; then
|
||||
-Dzlib=enabled -Dvector=enabled -Dlua=disabled -Dharmony-audio=enabled > "$LOG" 2>&1; then
|
||||
tail -n 180 "$LOG" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -16,7 +16,8 @@ for symbol in \
|
||||
mpv_render_context_create \
|
||||
mpv_render_context_render \
|
||||
mpv_render_context_set_update_callback \
|
||||
mpv_render_context_free; do
|
||||
mpv_render_context_free \
|
||||
mpv_harmony_audio_get_stats; do
|
||||
printf '%s\n' "$SYMBOLS" | grep -Eq "[[:space:]]${symbol}$" || {
|
||||
printf 'Missing libmpv symbol: %s\n' "$symbol" >&2
|
||||
exit 1
|
||||
|
||||
@@ -35,7 +35,7 @@ fi
|
||||
needed=$($READELF -d "$LIBMPV" | sed -n 's/.*Shared library: \[\([^]]*\)\].*/\1/p')
|
||||
for library in $needed; do
|
||||
case "$library" in
|
||||
libc.so|libz.so|libnative_media_vdec.so|libnative_media_venc.so|libnative_media_codecbase.so|libnative_media_core.so|libnative_window.so) ;;
|
||||
libc.so|libz.so|libnative_media_vdec.so|libnative_media_venc.so|libnative_media_codecbase.so|libnative_media_core.so|libnative_window.so|libohaudio.so) ;;
|
||||
*) printf 'Unexpected dynamic dependency: %s\n' "$library" >&2; exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
Reference in new issue
Block a user