spice: add audio
PATCH v2 1/1 spice: add audio
Add support for the spice audio interface. With this patch applied audio can be forwarded over the network from/to the spice client. Both recording and playback is supported.
The driver is first in the driver list, but the can_be_default flag is set only in case spice is active. So if you have the spice protocol enabled the spice audio driver is the default one, otherwise whatever comes first after spice in the list. Overriding the default using QEMU_AUDIO_DRV works in any case.
[ v2: audio codestyle: add spaces before open parenthesis ] [ v2: add const to silence array ]
Signed-off-by Gerd Hoffmann <[email protected]>
Cc malc <[email protected]>
--- Makefile.objs | 1 + audio/audio.c | 3 + audio/audio_int.h | 1 + audio/spiceaudio.c | 327 ++++++++++++++++++++++++++++++++++++++++++++++++++++ ui/qemu-spice.h | 1 + ui/spice-core.c | 1 + 6 files changed, 334 insertions(+), 0 deletions(-) create mode 100644 audio/spiceaudio.c
Makefile.objs +1 -0
@@ -102,6 +102,7 @@ common-obj-$(CONFIG_SPICE) += ui/spice-core.o ui/spice-input.o ui/spice-display. audio-obj-y = audio.o noaudio.o wavaudio.o mixeng.o audio-obj-$(CONFIG_SDL) += sdlaudio.o audio-obj-$(CONFIG_OSS) += ossaudio.o +audio-obj-$(CONFIG_SPICE) += spiceaudio.o audio-obj-$(CONFIG_COREAUDIO) += coreaudio.o audio-obj-$(CONFIG_ALSA) += alsaaudio.o audio-obj-$(CONFIG_DSOUND) += dsoundaudio.o
audio/audio.c +3 -0
@@ -44,6 +44,9 @@that we generate the list. */ static struct audio_driver *drvtab[] = { +#ifdef CONFIG_SPICE + &spice_audio_driver, +#endifCONFIG_AUDIO_DRIVERS &no_audio_driver, &wav_audio_driver
audio/audio_int.h +1 -0
@@ -209,6 +209,7 @@ extern struct audio_driver coreaudio_audio_driver;extern struct audio_driver dsound_audio_driver;extern struct audio_driver esd_audio_driver;extern struct audio_driver pa_audio_driver; +extern struct audio_driver spice_audio_driver;extern struct audio_driver winwave_audio_driver;extern struct mixeng_volume nominal_volume;
audio/spiceaudio.c new file +327 -0
327 lines not on this page · raw message
ui/qemu-spice.h +1 -0
@@ -29,6 +29,7 @@ extern int using_spice;void qemu_spice_init (void );void qemu_spice_input_init (void ); +void qemu_spice_audio_init (void );void qemu_spice_display_init (DisplayState *ds);int qemu_spice_add_interface (SpiceBaseInstance *sin);
ui/spice-core.c +1 -0
@@ -361,6 +361,7 @@ void qemu_spice_init(void) using_spice =1 ;qemu_spice_input_init (); +qemu_spice_audio_init ();qemu_free (x509_key_file);qemu_free (x509_cert_file);
Signature · 1 line
1.7.1