[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 03/52] qapi: qapi for audio backends
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH v2 03/52] qapi: qapi for audio backends |
Date: |
Wed, 9 Jan 2019 20:49:40 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 |
On 12/23/18 2:51 PM, Kővágó, Zoltán wrote:
> This patch adds structures into qapi to replace the existing
> configuration structures used by audio backends currently. This qapi
> will be the base of the -audiodev command line parameter (that replaces
> the old environment variables based config).
>
> This is not a 1:1 translation of the old options, I've tried to make
> them much more consistent (e.g. almost every backend had an option to
> specify buffer size, but the name was different for every backend, and
> some backends required usecs, while some other required frames, samples
> or bytes). Also tried to reduce the number of abbreviations used by the
> config keys.
>
> Some of the more important changes:
> * use `in` and `out` instead of `ADC` and `DAC`, as the former is more
> user friendly imho
> * moved buffer settings into the global setting area (so it's the same
> for all backends that support it. Backends that can't change buffer
> size will simply ignore them). Also using usecs, as it's probably more
> user friendly than samples or bytes.
> * try-poll is now an alsa backend specific option (as all other backends
> currently ignore it)
>
> Signed-off-by: Kővágó, Zoltán <address@hidden>
> ---
> Makefile.objs | 6 +-
> qapi/audio.json | 253 ++++++++++++++++++++++++++++++++++++++++++
> qapi/qapi-schema.json | 1 +
> 3 files changed, 257 insertions(+), 3 deletions(-)
> create mode 100644 qapi/audio.json
>
> diff --git a/Makefile.objs b/Makefile.objs
> index bc5b8a8442..3f833a70c0 100644
> --- a/Makefile.objs
> +++ b/Makefile.objs
> @@ -1,6 +1,6 @@
> -QAPI_MODULES = block-core block char common crypto introspect job migration
> -QAPI_MODULES += misc net rdma rocker run-state sockets tpm trace transaction
> -QAPI_MODULES += ui
> +QAPI_MODULES = audio block-core block char common crypto introspect job
> +QAPI_MODULES += migration misc net rdma rocker run-state sockets tpm trace
> +QAPI_MODULES += transaction ui
>
> #######################################################################
> # Common libraries for tools and emulators
> diff --git a/qapi/audio.json b/qapi/audio.json
> new file mode 100644
> index 0000000000..56d8ce439f
> --- /dev/null
> +++ b/qapi/audio.json
> @@ -0,0 +1,253 @@
> +# -*- mode: python -*-
> +#
> +# Copyright (C) 2015 Zoltán Kővágó <address@hidden>
Do you want to claim 2015-2019 now? But ultimately what you put is your
call, so don't treat my suggestion as a legal mandate.
> +#
> +# This work is licensed under the terms of the GNU GPL, version 2 or later.
> +# See the COPYING file in the top-level directory.
> +
> +##
> +# @AudiodevNoOptions:
> +#
> +# The none, coreaudio, sdl and spice audio backend have no options.
> +#
> +# Since: 3.2
4.0, now.
> +##
> +{ 'struct': 'AudiodevNoOptions',
> + 'data': { } }
Also, we now have support for empty branches in a flat union, so do you
really need this type, or...
> +
> +##
> +# @AudiodevAlsaPerDirectionOptions:
> +#
> +# Options of the alsa backend that are used for both playback and recording.
> +#
> +# @dev: #optional the name of the alsa device to use (default 'default')
No need to use the '#optional' tag any more; the doc generator now takes
care of that.
> +#
> +# @try-poll: #optional attempt to use poll mode, falling back to non polling
> +# access on failure (default on)
> +#
> +# Since: 3.2
More 4.0 (I'll quit pointing it out)
> +##
> +{ 'union': 'Audiodev',
> + 'base': {
> + 'id': 'str',
> + 'driver': 'AudiodevDriver',
> + 'in': 'AudiodevPerDirectionOptions',
> + 'out': 'AudiodevPerDirectionOptions',
> + '*timer-period': 'int' },
> + 'discriminator': 'driver',
> + 'data': {
> + 'none': 'AudiodevNoOptions',
...you could just omit the lines that don't add anything.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH v2 03/52] qapi: qapi for audio backends,
Eric Blake <=