0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/** @file
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * PDM - Pluggable Device Manager, audio interfaces.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/*
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsync * Copyright (C) 2006-2015 Oracle Corporation
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * available from http://www.virtualbox.org. This file is free software;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * you can redistribute it and/or modify it under the terms of the GNU
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * General Public License (GPL) as published by the Free Software
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * The contents of this file may alternatively be used under the terms
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * of the Common Development and Distribution License Version 1.0
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * VirtualBox OSE distribution, in which case the provisions of the
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * CDDL are applicable instead of those of the GPL.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * You may elect to license modified versions of this file under the
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * terms and conditions of either the GPL or the CDDL or both.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#ifndef ___VBox_vmm_pdmaudioifs_h
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#define ___VBox_vmm_pdmaudioifs_h
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#include <VBox/types.h>
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#include <iprt/list.h>
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync#ifndef VBOX_WITH_PDM_AUDIO_DRIVER
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync int mute;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t r;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t l;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} volume_t;
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync#endif
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
307a7d6149fc07e6bb75bf04f38ef1195c791268vboxsynctypedef uint32_t PDMAUDIODRVFLAGS;
307a7d6149fc07e6bb75bf04f38ef1195c791268vboxsync
307a7d6149fc07e6bb75bf04f38ef1195c791268vboxsync/** No flags set. */
307a7d6149fc07e6bb75bf04f38ef1195c791268vboxsync#define PDMAUDIODRVFLAG_NONE 0
307a7d6149fc07e6bb75bf04f38ef1195c791268vboxsync/** Marks a primary audio driver which is critical
307a7d6149fc07e6bb75bf04f38ef1195c791268vboxsync * when running the VM. */
307a7d6149fc07e6bb75bf04f38ef1195c791268vboxsync#define PDMAUDIODRVFLAG_PRIMARY RT_BIT(0)
307a7d6149fc07e6bb75bf04f38ef1195c791268vboxsync
307a7d6149fc07e6bb75bf04f38ef1195c791268vboxsync/**
307a7d6149fc07e6bb75bf04f38ef1195c791268vboxsync * Audio format in signed or unsigned variants.
307a7d6149fc07e6bb75bf04f38ef1195c791268vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef enum PDMAUDIOFMT
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync AUD_FMT_INVALID,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync AUD_FMT_U8,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync AUD_FMT_S8,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync AUD_FMT_U16,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync AUD_FMT_S16,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync AUD_FMT_U32,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync AUD_FMT_S32,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Hack to blow the type up to 32-bit. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync AUD_FMT_32BIT_HACK = 0x7fffffff
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOFMT;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#endif
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Audio configuration of a certain backend.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMAUDIOBACKENDCFG
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
a3b592bbebcadf0cc7c1b9e295f4f8a032128ef0vboxsync uint32_t cbStreamOut;
a3b592bbebcadf0cc7c1b9e295f4f8a032128ef0vboxsync uint32_t cbStreamIn;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t cMaxHstStrmsOut;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t cMaxHstStrmsIn;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOBACKENDCFG, *PPDMAUDIOBACKENDCFG;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * An audio sample. At the moment stereo (left + right channels) only.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @todo Replace this with a more generic union
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * which then also could handle 2.1 or 5.1 sound.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMAUDIOSAMPLE
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
10258d88c40d8254a2a0d89e9b6c1f3b487f5c2dvboxsync int64_t i64LSample;
10258d88c40d8254a2a0d89e9b6c1f3b487f5c2dvboxsync int64_t i64RSample;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOSAMPLE, *PPDMAUDIOSAMPLE;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
10258d88c40d8254a2a0d89e9b6c1f3b487f5c2dvboxsynctypedef enum PDMAUDIOENDIANNESS
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** The usual invalid endian. */
10258d88c40d8254a2a0d89e9b6c1f3b487f5c2dvboxsync PDMAUDIOENDIANNESS_INVALID,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Little endian. */
10258d88c40d8254a2a0d89e9b6c1f3b487f5c2dvboxsync PDMAUDIOENDIANNESS_LITTLE,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Bit endian. */
10258d88c40d8254a2a0d89e9b6c1f3b487f5c2dvboxsync PDMAUDIOENDIANNESS_BIG,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Endianness doesn't have a meaning in the context. */
10258d88c40d8254a2a0d89e9b6c1f3b487f5c2dvboxsync PDMAUDIOENDIANNESS_NA,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** The end of the valid endian values (exclusive). */
10258d88c40d8254a2a0d89e9b6c1f3b487f5c2dvboxsync PDMAUDIOENDIANNESS_END,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Hack to blow the type up to 32-bit. */
10258d88c40d8254a2a0d89e9b6c1f3b487f5c2dvboxsync PDMAUDIOENDIANNESS_32BIT_HACK = 0x7fffffff
10258d88c40d8254a2a0d89e9b6c1f3b487f5c2dvboxsync} PDMAUDIOENDIANNESS;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMAUDIOSTREAMCFG
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Frequency in Hertz (Hz). */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t uHz;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Number of channels (2 for stereo). */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint8_t cChannels;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Audio format. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOFMT enmFormat;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** @todo Use RT_LE2H_*? */
10258d88c40d8254a2a0d89e9b6c1f3b487f5c2dvboxsync PDMAUDIOENDIANNESS enmEndianness;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOSTREAMCFG, *PPDMAUDIOSTREAMCFG;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#endif
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#if defined(RT_LITTLE_ENDIAN)
10258d88c40d8254a2a0d89e9b6c1f3b487f5c2dvboxsync# define PDMAUDIOHOSTENDIANNESS PDMAUDIOENDIANNESS_LITTLE
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#elif defined(RT_BIG_ENDIAN)
10258d88c40d8254a2a0d89e9b6c1f3b487f5c2dvboxsync# define PDMAUDIOHOSTENDIANNESS PDMAUDIOENDIANNESS_BIG
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#else
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync# error "Port me!"
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#endif
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsynctypedef enum PDMAUDIODIR
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsync{
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsync PDMAUDIODIR_UNKNOWN = 0,
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsync PDMAUDIODIR_IN = 1,
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsync PDMAUDIODIR_OUT = 2,
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsync PDMAUDIODIR_BOTH = 3
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsync} PDMAUDIODIR;
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsync
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsynctypedef enum PDMAUDIOMIXERCTL
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOMIXERCTL_UNKNOWN = 0,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOMIXERCTL_VOLUME,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOMIXERCTL_PCM,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOMIXERCTL_LINE_IN,
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync PDMAUDIOMIXERCTL_MIC_IN,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Hack to blow the type up to 32-bit. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOMIXERCTL_32BIT_HACK = 0x7fffffff
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOMIXERCTL;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsynctypedef enum PDMAUDIORECSOURCE
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIORECSOURCE_UNKNOWN = 0,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIORECSOURCE_MIC,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIORECSOURCE_CD,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIORECSOURCE_VIDEO,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIORECSOURCE_AUX,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIORECSOURCE_LINE_IN,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIORECSOURCE_PHONE,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Hack to blow the type up to 32-bit. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIORECSOURCE_32BIT_HACK = 0x7fffffff
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIORECSOURCE;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Audio stream commands. Used in the audio connector
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * as well as in the actual host backends.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef enum PDMAUDIOSTREAMCMD
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Unknown command, do not use. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOSTREAMCMD_UNKNOWN = 0,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Enables the stream. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOSTREAMCMD_ENABLE,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Disables the stream. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOSTREAMCMD_DISABLE,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Hack to blow the type up to 32-bit. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOSTREAMCMD_32BIT_HACK = 0x7fffffff
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOSTREAMCMD;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Properties of audio streams for host/guest
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * for in or out directions.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMPCMPROPS
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Sample width. Bits per sample. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint8_t cBits;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Signed or unsigned sample. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync bool fSigned;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Shift count used for faster calculation of various
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * values, such as the alignment, bytes to samples and so on.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Depends on number of stream channels and the stream format
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * being used.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync ** @todo Use some RTAsmXXX functions instead?
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint8_t cShift;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Number of audio channels. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint8_t cChannels;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Alignment mask. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t uAlign;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Sample frequency in Hertz (Hz). */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t uHz;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Bandwidth (bytes/s). */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t cbPerSec;
10258d88c40d8254a2a0d89e9b6c1f3b487f5c2dvboxsync /** Whether the endianness is swapped or not. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync bool fSwapEndian;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMPCMPROPS, *PPDMPCMPROPS;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync/**
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync * Structure keeping an audio volume level.
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync */
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsynctypedef struct PDMAUDIOVOLUME
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync{
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync /** Set to @c true if this stream is muted, @c false if not. */
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync bool fMuted;
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync /** Left channel volume. */
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync uint32_t uLeft;
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync /** Right channel volume. */
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync uint32_t uRight;
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync} PDMAUDIOVOLUME, *PPDMAUDIOVOLUME;
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Structure for holding rate processing information
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * of a source + destination audio stream. This is needed
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * because both streams can differ regarding their rates
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * and therefore need to be treated accordingly.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMAUDIOSTRMRATE
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Current (absolute) offset in the output
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * (destination) stream. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint64_t dstOffset;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Increment for moving dstOffset for the
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * destination stream. This is needed because the
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * source <-> destination rate might be different. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint64_t dstInc;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Current (absolute) offset in the input
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * stream. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t srcOffset;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Last processed sample of the input stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Needed for interpolation. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOSAMPLE srcSampleLast;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOSTRMRATE, *PPDMAUDIOSTRMRATE;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Note: All internal handling is done in samples,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * not in bytes!
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef uint32_t PDMAUDIOMIXBUFFMT;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef PDMAUDIOMIXBUFFMT *PPDMAUDIOMIXBUFFMT;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMAUDIOMIXBUF *PPDMAUDIOMIXBUF;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMAUDIOMIXBUF
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync RTLISTNODE Node;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Name of the buffer. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync char *pszName;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Sample buffer. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PPDMAUDIOSAMPLE pSamples;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Size of the sample buffer (in samples). */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t cSamples;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** The current read/write position (in samples)
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * in the samples buffer. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t offReadWrite;
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync /**
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync * Total samples already mixed down to the parent buffer (if any). Always starting at
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync * the parent's offReadWrite position.
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync *
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync * Note: Count always is specified in parent samples, as the sample count can differ between parent
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync * and child.
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t cMixed;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t cProcessed;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Pointer to parent buffer (if any). */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PPDMAUDIOMIXBUF pParent;
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync /** List of children mix buffers to keep in sync with (if being a parent buffer). */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync RTLISTANCHOR lstBuffers;
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync /** Intermediate structure for buffer conversion tasks. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PPDMAUDIOSTRMRATE pRate;
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync /** Current volume used for mixing. */
53aa5f00ecfc2d0e5ac355bc452b30cc1202c676vboxsync PDMAUDIOVOLUME Volume;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** This buffer's audio format. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOMIXBUFFMT AudioFmt;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Ratio of the associated parent stream's frequency by this stream's
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * frequency (1<<32), represented as a signed 64 bit integer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * For example, if the parent stream has a frequency of 44 khZ, and this
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * stream has a frequency of 11 kHz, the ration then would be
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * (44/11 * (1 << 32)).
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Currently this does not get changed once assigned.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync int64_t iFreqRatio;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /* For quickly converting samples <-> bytes and
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * vice versa. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint8_t cShift;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOMIXBUF;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Represents an audio input on the host of a certain
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * backend (e.g. DirectSound, PulseAudio etc).
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * One host audio input is assigned to exactly one parent
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * guest input stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsyncstruct PDMAUDIOGSTSTRMIN;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef PDMAUDIOGSTSTRMIN *PPDMAUDIOGSTSTRMIN;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMAUDIOHSTSTRMIN
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** List node. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync RTLISTNODE Node;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** PCM properties. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMPCMPROPS Props;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Whether this input is enabled or not. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync bool fEnabled;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** This stream's mixing buffer. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOMIXBUF MixBuf;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Pointer to (parent) guest stream. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PPDMAUDIOGSTSTRMIN pGstStrmIn;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOHSTSTRMIN, *PPDMAUDIOHSTSTRMIN;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/*
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Represents an audio output on the host through a certain
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * backend (e.g. DirectSound, PulseAudio etc).
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * One host audio output can have multiple (1:N) guest outputs
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * assigned.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMAUDIOHSTSTRMOUT
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** List node. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync RTLISTNODE Node;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Stream properites. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMPCMPROPS Props;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Enabled or disabled flag. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync bool fEnabled;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Whether this stream was marked as being disabled
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * but there are still associated guest output streams
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * which rely on its data. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync bool fPendingDisable;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** This stream's mixing buffer. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOMIXBUF MixBuf;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Associated guest output streams. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync RTLISTANCHOR lstGstStrmOut;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOHSTSTRMOUT, *PPDMAUDIOHSTSTRMOUT;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Guest audio stream state.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMAUDIOGSTSTRMSTATE
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Guest audio out stream active or not. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync bool fActive;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Guest audio output stream has some samples or not. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync bool fEmpty;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Name of this stream. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync char *pszName;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOGSTSTRMSTATE, *PPDMAUDIOGSTSTRMSTATE;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Represents an audio input from the guest (that is, from the
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * emulated device, e.g. Intel HDA).
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Each guest input can have multiple host input streams.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMAUDIOGSTSTRMIN
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Guest stream properites. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMPCMPROPS Props;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Current stream state. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOGSTSTRMSTATE State;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** This stream's mixing buffer. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOMIXBUF MixBuf;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Pointer to associated host input stream. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PPDMAUDIOHSTSTRMIN pHstStrmIn;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOGSTSTRMIN, *PPDMAUDIOGSTSTRMIN;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Represents an audio output from the guest (that is, from the
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * emulated device, e.g. Intel HDA).
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Each guest output is assigned to a single host output.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMAUDIOGSTSTRMOUT
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** List node. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync RTLISTNODE Node;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Guest output stream properites. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMPCMPROPS Props;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Current stream state. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOGSTSTRMSTATE State;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** This stream's mixing buffer. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOMIXBUF MixBuf;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Pointer to the associated host output stream. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PPDMAUDIOHSTSTRMOUT pHstStrmOut;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOGSTSTRMOUT, *PPDMAUDIOGSTSTRMOUT;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/** Pointer to a audio connector interface. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMIAUDIOCONNECTOR *PPDMIAUDIOCONNECTOR;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Audio connector interface (up).
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMIAUDIOCONNECTOR
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsync DECLR3CALLBACKMEMBER(int, pfnQueryStatus, (PPDMIAUDIOCONNECTOR pInterface, uint32_t *pcbAvailIn, uint32_t *pcbFreeOut, uint32_t *pcSamplesLive));
6e4f0a21de35da7e77586bc1fab65d1bbf611eeevboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Reads PCM audio data from the host (input).
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pGstStrmIn Pointer to guest input stream to write to.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pvBuf Where to store the read data.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param cbSize Number of bytes to read.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pcbRead Bytes of audio data read. Optional.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
a3b592bbebcadf0cc7c1b9e295f4f8a032128ef0vboxsync DECLR3CALLBACKMEMBER(int, pfnRead, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMIN pGstStrmIn, void *pvBuf, uint32_t cbSize, uint32_t *pcbRead));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Writes PCM audio data to the host (output).
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pGstStrmOut Pointer to guest output stream to read from.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pvBuf Audio data to be written.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param cbSize Number of bytes to be written.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pcbWritten Bytes of audio data written. Optional.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
a3b592bbebcadf0cc7c1b9e295f4f8a032128ef0vboxsync DECLR3CALLBACKMEMBER(int, pfnWrite, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut, const void *pvBuf, uint32_t cbSize, uint32_t *pcbWritten));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Checks whether the specified guest input stream is in a working state.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns True if a host voice in is available, false if not.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pGstStrmIn Pointer to guest input stream to check.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(bool, pfnIsInputOK, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMIN pGstStrmIn));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Checks whether the specified guest output stream is in a working state.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns True if a host voice out is available, false if not.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pGstStrmOut Pointer to guest output stream to check.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(bool, pfnIsOutputOK, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
6e4f0a21de35da7e77586bc1fab65d1bbf611eeevboxsync * Initializes the NULL audio driver as a fallback in case no host backend is available.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnInitNull, (PPDMIAUDIOCONNECTOR pInterface));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Enables a specific guest output stream and starts the audio device.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pGstStrmOut Pointer to guest output stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param fEnable Whether to enable or disable the specified output stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnEnableOut, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut, bool fEnable));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Enables a specific guest input stream and starts the audio device.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pGstStrmIn Pointer to guest input stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param fEnable Whether to enable or disable the specified input stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnEnableIn, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMIN pGstStrmIn, bool fEnable));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Closes a specific guest input stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pGstStrmIn Pointer to guest input stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(void, pfnCloseIn, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMIN pGstStrmIn));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Closes a specific guest output stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pGstStrmOut Pointer to guest output stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(void, pfnCloseOut, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Opens an input audio channel.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pszName Name of the audio channel.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param enmRecSource Specifies the type of recording source to be opened.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pCfg Pointer to PDMAUDIOSTREAMCFG to use.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param ppGstStrmIn Pointer where to return the guest guest input stream on success.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnOpenIn, (PPDMIAUDIOCONNECTOR pInterface, const char *pszName,
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsync PDMAUDIORECSOURCE enmRecSource, PPDMAUDIOSTREAMCFG pCfg,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PPDMAUDIOGSTSTRMIN *ppGstStrmIn));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Opens an output audio channel.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pszName Name of the audio channel.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pCfg Pointer to PDMAUDIOSTREAMCFG to use.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param ppGstStrmOut Pointer where to return the guest guest input stream on success.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnOpenOut, (PPDMIAUDIOCONNECTOR pInterface, const char *pszName,
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsync PPDMAUDIOSTREAMCFG pCfg, PPDMAUDIOGSTSTRMOUT *ppGstStrmOut));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsync DECLR3CALLBACKMEMBER(int, pfnPlayOut, (PPDMIAUDIOCONNECTOR pInterface, uint32_t *pcSamplesPlayed));
6e4f0a21de35da7e77586bc1fab65d1bbf611eeevboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Checks whether a specific guest input stream is active or not.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns Whether the specified stream is active or not.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pGstStrmIn Pointer to guest input stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(bool, pfnIsActiveIn, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMIN pGstStrmIn));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Checks whether a specific guest output stream is active or not.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns Whether the specified stream is active or not.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pGstStrmOut Pointer to guest output stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(bool, pfnIsActiveOut, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMIAUDIOCONNECTOR;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/** PDMIAUDIOCONNECTOR interface ID. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#define PDMIAUDIOCONNECTOR_IID "a41ca770-ed07-4f57-a0a6-41377d9d484f"
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsync/** Defines all needed interface callbacks for an audio backend. */
8a204879c937e7c55da35682a0e5d2e1df91c856vboxsync#define PDMAUDIO_IHOSTAUDIO_CALLBACKS(_aDrvName) \
8a204879c937e7c55da35682a0e5d2e1df91c856vboxsync pThis->IHostAudio.pfnCaptureIn = _aDrvName##CaptureIn; \
8a204879c937e7c55da35682a0e5d2e1df91c856vboxsync pThis->IHostAudio.pfnControlIn = _aDrvName##ControlIn; \
8a204879c937e7c55da35682a0e5d2e1df91c856vboxsync pThis->IHostAudio.pfnControlOut = _aDrvName##ControlOut; \
8a204879c937e7c55da35682a0e5d2e1df91c856vboxsync pThis->IHostAudio.pfnFiniIn = _aDrvName##FiniIn; \
8a204879c937e7c55da35682a0e5d2e1df91c856vboxsync pThis->IHostAudio.pfnFiniOut = _aDrvName##FiniOut; \
8a204879c937e7c55da35682a0e5d2e1df91c856vboxsync pThis->IHostAudio.pfnGetConf = _aDrvName##GetConf; \
8a204879c937e7c55da35682a0e5d2e1df91c856vboxsync pThis->IHostAudio.pfnInit = _aDrvName##Init; \
8a204879c937e7c55da35682a0e5d2e1df91c856vboxsync pThis->IHostAudio.pfnInitIn = _aDrvName##InitIn; \
8a204879c937e7c55da35682a0e5d2e1df91c856vboxsync pThis->IHostAudio.pfnInitOut = _aDrvName##InitOut; \
8a204879c937e7c55da35682a0e5d2e1df91c856vboxsync pThis->IHostAudio.pfnIsEnabled = _aDrvName##IsEnabled; \
1705f7565ed8533058b8541d72d6c5d4453de00fvboxsync pThis->IHostAudio.pfnPlayOut = _aDrvName##PlayOut; \
1705f7565ed8533058b8541d72d6c5d4453de00fvboxsync pThis->IHostAudio.pfnShutdown = _aDrvName##Shutdown;
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/** Pointer to a host audio interface. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMIHOSTAUDIO *PPDMIHOSTAUDIO;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * PDM host audio interface.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMIHOSTAUDIO
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Initialize the host-specific audio device.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnInit, (PPDMIHOSTAUDIO pInterface));
1705f7565ed8533058b8541d72d6c5d4453de00fvboxsync
1705f7565ed8533058b8541d72d6c5d4453de00fvboxsync /**
1705f7565ed8533058b8541d72d6c5d4453de00fvboxsync * Shuts down the host-specific audio device.
1705f7565ed8533058b8541d72d6c5d4453de00fvboxsync *
1705f7565ed8533058b8541d72d6c5d4453de00fvboxsync * @returns VBox status code.
1705f7565ed8533058b8541d72d6c5d4453de00fvboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
1705f7565ed8533058b8541d72d6c5d4453de00fvboxsync */
1705f7565ed8533058b8541d72d6c5d4453de00fvboxsync DECLR3CALLBACKMEMBER(void, pfnShutdown, (PPDMIHOSTAUDIO pInterface));
1705f7565ed8533058b8541d72d6c5d4453de00fvboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Initialize the host-specific audio device for input stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pHstStrmIn Pointer to host input stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pStreamCfg Pointer to stream configuration.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param enmRecSource Specifies the type of recording source to be initialized.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pcSamples Returns how many samples the backend can handle. Optional.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnInitIn, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOHSTSTRMIN pHstStrmIn, PPDMAUDIOSTREAMCFG pStreamCfg, PDMAUDIORECSOURCE enmRecSource, uint32_t *pcSamples));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Initialize the host-specific output device for output stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pHstStrmOut Pointer to host output stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pStreamCfg Pointer to stream configuration.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pcSamples Returns how many samples the backend can handle. Optional.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnInitOut, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOHSTSTRMOUT pHstStrmOut, PPDMAUDIOSTREAMCFG pStreamCfg, uint32_t *pcSamples));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Control the host audio device for an input stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pHstStrmOut Pointer to host output stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param enmStreamCmd The stream command to issue.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnControlOut, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOHSTSTRMOUT pHstStrmOut, PDMAUDIOSTREAMCMD enmStreamCmd));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Control the host audio device for an output stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pHstStrmOut Pointer to host output stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param enmStreamCmd The stream command to issue.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnControlIn, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOHSTSTRMIN pHstStrmIn, PDMAUDIOSTREAMCMD enmStreamCmd));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
6e4f0a21de35da7e77586bc1fab65d1bbf611eeevboxsync * Ends the host audio input streamm.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pHstStrmIn Pointer to host input stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnFiniIn, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOHSTSTRMIN pHstStrmIn));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
6e4f0a21de35da7e77586bc1fab65d1bbf611eeevboxsync * Ends the host output stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pHstStrmOut Pointer to host output stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnFiniOut, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOHSTSTRMOUT pHstStrmOut));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsync DECLR3CALLBACKMEMBER(bool, pfnIsEnabled, (PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir));
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
e95cc69731ec79cf167e6167808e1c9b275ea007vboxsync * Plays a host audio stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pHstStrmOut Pointer to host output stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pcSamplesPlayed Pointer to number of samples captured.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnPlayOut, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOHSTSTRMOUT pHstStrmOut, uint32_t *pcSamplesPlayed));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Records audio to input stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pHstStrmIn Pointer to host input stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pcSamplesCaptured Pointer to number of samples captured.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnCaptureIn, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOHSTSTRMIN pHstStrmIn, uint32_t *pcSamplesCaptured));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Gets the configuration from the host audio (backend) driver.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pBackendCfg Pointer where to store the backend audio configuration to.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnGetConf, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDCFG pBackendCfg));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMIHOSTAUDIO;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#define PDMIHOSTAUDIO_IID "39feea4f-c824-4197-bcff-7d4a6ede7420"
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#endif /* VBOX_WITH_PDM_AUDIO_DRIVER */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#endif /* ___VBox_vmm_pdmaudioifs_h */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync