pdmaudioifs.h revision 6e4f0a21de35da7e77586bc1fab65d1bbf611eee
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/** @file
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * PDM - Pluggable Device Manager, audio interfaces.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/*
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Copyright (C) 2006-2014 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
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync int mute;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t r;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t l;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} volume_t;
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 * Function pointer for device emulation callback.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef void (*PDMAUDIOCALLBACK_FN) (void *pvContext, uint32_t cbData);
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Structure holding all necessary callback data to communicate
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * with the sound device emulation, e.g. for reading or writing
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * audio data.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMAUDIOCALLBACK
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Callback function to use in the device emulation. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOCALLBACK_FN fn;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Opaque pointer to context data given on callback
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * creation. Set by the device emulation. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync void *pvContext;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOCALLBACK, *PPDMAUDIOCALLBACK;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync/**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Audio configuration of a certain backend.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef struct PDMAUDIOBACKENDCFG
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync size_t cbStreamOut;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync size_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{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync int64_t u64LSample;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync int64_t u64RSample;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOSAMPLE, *PPDMAUDIOSAMPLE;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef enum PDMAUDIOENDIANESS
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** The usual invalid endian. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOENDIANESS_INVALID,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Little endian. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOENDIANESS_LITTLE,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Bit endian. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOENDIANESS_BIG,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Endianness doesn't have a meaning in the context. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOENDIANESS_NA,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** The end of the valid endian values (exclusive). */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOENDIANESS_END,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Hack to blow the type up to 32-bit. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOENDIANESS_32BIT_HACK = 0x7fffffff
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOENDIANESS;
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_*? */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOENDIANESS enmEndianness;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOSTREAMCFG, *PPDMAUDIOSTREAMCFG;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#endif
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#if defined(RT_LITTLE_ENDIAN)
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync# define PDMAUDIOHOSTENDIANESS PDMAUDIOENDIANESS_LITTLE
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#elif defined(RT_BIG_ENDIAN)
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync# define PDMAUDIOHOSTENDIANESS PDMAUDIOENDIANESS_BIG
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#else
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync# error "Port me!"
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync#endif
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef enum
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync{
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOMIXERCTL_UNKNOWN = 0,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOMIXERCTL_VOLUME,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOMIXERCTL_PCM,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOMIXERCTL_LINE_IN,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Hack to blow the type up to 32-bit. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOMIXERCTL_32BIT_HACK = 0x7fffffff
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMAUDIOMIXERCTL;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsynctypedef enum
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;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Whether the endianess is swapped or not. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync bool fSwapEndian;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync} PDMPCMPROPS, *PPDMPCMPROPS;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
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;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Total samples already mixed down to the
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * parent buffer (if any). Always starting at
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * the parent's offReadWrite position.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Note: Count always is specified in parent samples,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * as the sample count can differ between parent
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * and child. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t cMixed;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t cProcessed;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Pointer to parent buffer (if any). */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PPDMAUDIOMIXBUF pParent;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** List of children mix buffers to keep
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * in sync with (if being a parent buffer). */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync RTLISTANCHOR lstBuffers;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Intermediate structure for buffer
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * conversion tasks. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PPDMAUDIOSTRMRATE pRate;
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 /** Set to @c true if this stream is muted, @c false if not. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync bool fMuted;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Name of this stream. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync char *pszName;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Left channel volume. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t uVolumeLeft;
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /** Right channel volume. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync uint32_t uVolumeRight;
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 /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Callback set by the device emulation on creation.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * This function is used to mix the guest input samples into the target
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * host input recording buffer. */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOCALLBACK Callback;
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 /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Callback set by the device emulation on creation.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * This function is used to tell the device emulation that we're ready to
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * process new samples.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOCALLBACK Callback;
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{
6e4f0a21de35da7e77586bc1fab65d1bbf611eeevboxsync DECLR3CALLBACKMEMBER(int, pfnQueryData, (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 */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnRead, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMIN pGstStrmIn, void *pvBuf, size_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 */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnWrite, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut, const void *pvBuf, size_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 * Sets the audio volume of a specific guest output stream.
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 fMute Whether to mute or not.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param uVolLeft Left audio stream volume.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param uVolRight Right audio stream volume.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnIsSetOutVolume, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync bool fMute, uint8_t uVolLeft, uint8_t uVolRight));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * Sets the overall audio volume.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync *
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @returns VBox status code.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pInterface Pointer to the interface structure containing the called function pointer.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param fMute Whether to mute or not.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param uVolLeft Left audio stream volume.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param uVolRight Right audio stream volume.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync */
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync DECLR3CALLBACKMEMBER(int, pfnSetVolume, (PPDMIAUDIOCONNECTOR pInterface,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync bool fMute, uint8_t uVolLeft, uint8_t uVolRight));
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 fnCallback Callback function to be assigned to this input stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pvCallback Pointer to parameters assigned to the callback function.
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,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIORECSOURCE enmRecSource,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOCALLBACK_FN fnCallback, void *pvCallback,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync 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 fnCallback Callback function to be assigned to this input stream.
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync * @param pvCallback Pointer to parameters assigned to the callback function.
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,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PDMAUDIOCALLBACK_FN fnCallback, void *pvCallback,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PPDMAUDIOSTREAMCFG pCfg,
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync PPDMAUDIOGSTSTRMOUT *ppGstStrmOut));
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync
6e4f0a21de35da7e77586bc1fab65d1bbf611eeevboxsync DECLR3CALLBACKMEMBER(int, pfnPlayOut, (PPDMIAUDIOCONNECTOR pInterface));
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
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));
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
0c64f283f499a1ec6e8861ea98e7f252284e8358vboxsync /**
6e4f0a21de35da7e77586bc1fab65d1bbf611eeevboxsync * Plays an 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