aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorKővágó, Zoltán <dirty.ice.hu@gmail.com>2019-08-19 01:06:48 +0200
committerGerd Hoffmann <kraxel@redhat.com>2019-08-21 09:13:37 +0200
commitf0b9f36d71a373d469da9feb133c91546d37643c (patch)
tree3fa26cf176b85afd36571865936610c27f2c4f75 /ui
parentecd97e9592fefc5083f0d70fefadd42a1742a65f (diff)
downloadqemu-f0b9f36d71a373d469da9feb133c91546d37643c.zip
qemu-f0b9f36d71a373d469da9feb133c91546d37643c.tar.gz
qemu-f0b9f36d71a373d469da9feb133c91546d37643c.tar.bz2
audio: add audiodev property to vnc and wav_capture
Signed-off-by: Kővágó, Zoltán <DirtY.iCE.hu@gmail.com> Message-id: 8cbc9e865bbf40850c14340fc0549e6ac2d5fe9c.1566168923.git.DirtY.iCE.hu@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/vnc.c15
-rw-r--r--ui/vnc.h2
2 files changed, 16 insertions, 1 deletions
diff --git a/ui/vnc.c b/ui/vnc.c
index ed5e8aa..649ce93 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -1224,7 +1224,7 @@ static void audio_add(VncState *vs)
ops.destroy = audio_capture_destroy;
ops.capture = audio_capture;
- vs->audio_cap = AUD_add_capture(NULL, &vs->as, &ops, vs);
+ vs->audio_cap = AUD_add_capture(vs->vd->audio_state, &vs->as, &ops, vs);
if (!vs->audio_cap) {
error_report("Failed to add audio capture");
}
@@ -3371,6 +3371,9 @@ static QemuOptsList qemu_vnc_opts = {
},{
.name = "non-adaptive",
.type = QEMU_OPT_BOOL,
+ },{
+ .name = "audiodev",
+ .type = QEMU_OPT_STRING,
},
{ /* end of list */ }
},
@@ -3808,6 +3811,7 @@ void vnc_display_open(const char *id, Error **errp)
const char *saslauthz;
int lock_key_sync = 1;
int key_delay_ms;
+ const char *audiodev;
if (!vd) {
error_setg(errp, "VNC display not active");
@@ -3993,6 +3997,15 @@ void vnc_display_open(const char *id, Error **errp)
}
vd->ledstate = 0;
+ audiodev = qemu_opt_get(opts, "audiodev");
+ if (audiodev) {
+ vd->audio_state = audio_state_by_name(audiodev);
+ if (!vd->audio_state) {
+ error_setg(errp, "Audiodev '%s' not found", audiodev);
+ goto fail;
+ }
+ }
+
device_id = qemu_opt_get(opts, "display");
if (device_id) {
int head = qemu_opt_get_number(opts, "head", 0);
diff --git a/ui/vnc.h b/ui/vnc.h
index 18f1b1d..8643860 100644
--- a/ui/vnc.h
+++ b/ui/vnc.h
@@ -182,6 +182,8 @@ struct VncDisplay
#ifdef CONFIG_VNC_SASL
VncDisplaySASL sasl;
#endif
+
+ AudioState *audio_state;
};
typedef struct VncTight {