AudioMixer.h revision 174f3dff60f96d89b320f9a322307118676db1db
/* $Id$ */
/** @file
* VBox audio: Mixing routines, mainly used by the various audio device
* devices LUNs.
*/
/*
* Copyright (C) 2014 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef AUDIO_MIXER_H
#define AUDIO_MIXER_H
typedef struct AUDIOMIXER
{
/** Mixer name. */
char *pszName;
* data to so that the underlying device emulation
* can work with it. */
/* List of audio mixer sinks. */
/** Number of used audio sinks. */
} AUDIOMIXER, *PAUDIOMIXER;
typedef struct AUDMIXSTREAM
{
/** @todo Add support for output streams. */
typedef enum AUDMIXSINKDIR
{
typedef struct AUDMIXSINK
{
/** Name of this sink. */
char *pszName;
/** The sink direction, that is,
* if this sink handles input or output. */
/** Pointer to mixer object this sink is bound
* to. */
/** Number of streams assigned. */
/** List of assigned streams. */
/** This sink's mixing buffer. */
} AUDMIXSINK, *PAUDMIXSINK;
typedef enum AUDMIXOP
{
AUDMIXOP_NONE = 0,
} AUDMIXOP;
int audioMixerAddStreamIn(PAUDMIXSINK pSink, PPDMIAUDIOCONNECTOR pConnector, PPDMAUDIOGSTSTRMIN pStream, uint32_t uFlags, PAUDMIXSTREAM *ppStream);
int audioMixerProcessSamples(AUDMIXOP enmOp, PPDMAUDIOSAMPLE pDst, uint32_t cToWrite, PPDMAUDIOSAMPLE pSrc, uint32_t cToRead, uint32_t *pcRead, uint32_t *pcWritten);
int audioMixerProcessSamplesEx(AUDMIXOP enmOp, void *pvParms, size_t cbParms, PPDMAUDIOSAMPLE pDst, uint32_t cToWrite, PPDMAUDIOSAMPLE pSrc, uint32_t cToRead, uint32_t *pcRead, uint32_t *pcWritten);
#endif /* AUDIO_MIXER_H */