Implement audio forwarding

Use Android Open Accessory 2 to redirect the device audio output to the
computer, creating a new audio input source.

Record this new source and play it to the default output.

<https://source.android.com/devices/accessories/aoa2#audio-support>
This commit is contained in:
Romain Vimont
2018-03-22 11:47:24 +01:00
committed by Romain Vimont
parent 36a94137b5
commit 2bbf650758
10 changed files with 551 additions and 20 deletions

View File

@@ -18,6 +18,13 @@ src = [
'src/tinyxpm.c',
]
if get_option('audio_support')
src += [
'src/aoa.c',
'src/audio.c'
]
endif
dependencies = [
dependency('libavformat'),
dependency('libavcodec'),
@@ -25,6 +32,10 @@ dependencies = [
dependency('sdl2'),
]
if get_option('audio_support')
dependencies += dependency('libusb-1.0')
endif
cc = meson.get_compiler('c')
if host_machine.system() == 'windows'
@@ -83,6 +94,9 @@ conf.set('SKIP_FRAMES', get_option('skip_frames'))
# enable High DPI support
conf.set('HIDPI_SUPPORT', get_option('hidpi_support'))
# enable audio support (enable audio forwarding with --forward-audio)
conf.set('AUDIO_SUPPORT', get_option('audio_support'))
configure_file(configuration: conf, output: 'config.h')
src_dir = include_directories('src')