summaryrefslogtreecommitdiff
path: root/audio/audio_int.h
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2018-03-06 08:40:47 +0100
committerGerd Hoffmann <kraxel@redhat.com>2018-03-12 11:18:26 +0100
commitd3893a39eb0165809325071ab07984797d78e57a (patch)
treead48738682ee38a743635bc79a99c62515f3998b /audio/audio_int.h
parenta88afc649e53adc1cac00bb5803fbafdd4d99994 (diff)
downloadqemu-d3893a39eb0165809325071ab07984797d78e57a.tar.gz
audio: add driver registry
Add registry for audio drivers, using the existing audio_driver struct. Make all drivers register themself. The old list of audio_driver struct pointers is now a list of audio driver names, specifying the priority (aka probe order) in case no driver is explicitly asked for. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-id: 20180306074053.22856-2-kraxel@redhat.com
Diffstat (limited to 'audio/audio_int.h')
-rw-r--r--audio/audio_int.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/audio/audio_int.h b/audio/audio_int.h
index 700bd43143..244b454012 100644
--- a/audio/audio_int.h
+++ b/audio/audio_int.h
@@ -141,6 +141,7 @@ struct SWVoiceIn {
QLIST_ENTRY (SWVoiceIn) entries;
};
+typedef struct audio_driver audio_driver;
struct audio_driver {
const char *name;
const char *descr;
@@ -154,6 +155,7 @@ struct audio_driver {
int voice_size_out;
int voice_size_in;
int ctl_caps;
+ QLIST_ENTRY(audio_driver) next;
};
struct audio_pcm_ops {
@@ -203,17 +205,11 @@ struct AudioState {
int vm_running;
};
-extern struct audio_driver no_audio_driver;
-extern struct audio_driver oss_audio_driver;
-extern struct audio_driver sdl_audio_driver;
-extern struct audio_driver wav_audio_driver;
-extern struct audio_driver alsa_audio_driver;
-extern struct audio_driver coreaudio_audio_driver;
-extern struct audio_driver dsound_audio_driver;
-extern struct audio_driver pa_audio_driver;
-extern struct audio_driver spice_audio_driver;
extern const struct mixeng_volume nominal_volume;
+void audio_driver_register(audio_driver *drv);
+audio_driver *audio_driver_lookup(const char *name);
+
void audio_pcm_init_info (struct audio_pcm_info *info, struct audsettings *as);
void audio_pcm_info_clear_buf (struct audio_pcm_info *info, void *buf, int len);