aboutsummaryrefslogtreecommitdiff
path: root/audio/audio_int.h
diff options
context:
space:
mode:
authorKővágó, Zoltán <dirty.ice.hu@gmail.com>2019-03-08 23:34:15 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-03-11 10:29:27 +0100
commit71830221fb23388b32e6516c2fb7a698453a6c5a (patch)
treef10b78c8eac3ca884923a35406fd2be2105d531b /audio/audio_int.h
parentf0b3d8115298c3162d3a56f8f38e0a02e783b54b (diff)
audio: -audiodev command line option basic implementation
Audio drivers now get an Audiodev * as config paramters, instead of the global audio_option structs. There is some code in audio/audio_legacy.c that converts the old environment variables to audiodev options (this way backends do not have to worry about legacy options). It also contains a replacement of -audio-help, which prints out the equivalent -audiodev based config of the currently specified environment variables. Note that backends are not updated and still rely on environment variables. Also note that (due to moving try-poll from global to backend specific option) currently ALSA and OSS will always try poll mode, regardless of environment variables or -audiodev options. Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: e99a7cbdac0d13512743880660b2032024703e4c.1552083282.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'audio/audio_int.h')
-rw-r--r--audio/audio_int.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/audio/audio_int.h b/audio/audio_int.h
index 6c451b995c..7bf5dfc0b5 100644
--- a/audio/audio_int.h
+++ b/audio/audio_int.h
@@ -146,7 +146,7 @@ struct audio_driver {
const char *name;
const char *descr;
struct audio_option *options;
- void *(*init) (void);
+ void *(*init) (Audiodev *);
void (*fini) (void *);
struct audio_pcm_ops *pcm_ops;
int can_be_default;
@@ -193,6 +193,7 @@ struct SWVoiceCap {
typedef struct AudioState {
struct audio_driver *drv;
+ Audiodev *dev;
void *drv_opaque;
QEMUTimer *ts;
@@ -203,10 +204,13 @@ typedef struct AudioState {
int nb_hw_voices_out;
int nb_hw_voices_in;
int vm_running;
+ int64_t period_ticks;
} AudioState;
extern const struct mixeng_volume nominal_volume;
+extern const char *audio_prio_list[];
+
void audio_driver_register(audio_driver *drv);
audio_driver *audio_driver_lookup(const char *name);
@@ -248,4 +252,18 @@ static inline int audio_ring_dist (int dst, int src, int len)
#define AUDIO_STRINGIFY_(n) #n
#define AUDIO_STRINGIFY(n) AUDIO_STRINGIFY_(n)
+typedef struct AudiodevListEntry {
+ Audiodev *dev;
+ QSIMPLEQ_ENTRY(AudiodevListEntry) next;
+} AudiodevListEntry;
+
+typedef QSIMPLEQ_HEAD(, AudiodevListEntry) AudiodevListHead;
+AudiodevListHead audio_handle_legacy_opts(void);
+
+void audio_free_audiodev_list(AudiodevListHead *head);
+
+void audio_create_pdos(Audiodev *dev);
+AudiodevPerDirectionOptions *audio_get_pdo_in(Audiodev *dev);
+AudiodevPerDirectionOptions *audio_get_pdo_out(Audiodev *dev);
+
#endif /* QEMU_AUDIO_INT_H */