VirtualBox

Changeset 89350 in vbox for trunk/src/VBox/Devices/Audio


Ignore:
Timestamp:
May 28, 2021 12:11:51 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144699
Message:

AudioMixBuffer: cleanups. bugref:9890

Location:
trunk/src/VBox/Devices/Audio
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/AudioMixBuffer.cpp

    r89340 r89350  
    1515 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
    1616 */
     17
     18/** @page pg_audio_mix_buffer   Audio Mixer Buffer
     19 *
     20 * @section sec_audio_mix_buffer_volume     Soft Volume Control
     21 *
     22 * The external code supplies an 8-bit volume (attenuation) value in the
     23 * 0 .. 255 range. This represents 0 to -96dB attenuation where an input
     24 * value of 0 corresponds to -96dB and 255 corresponds to 0dB (unchanged).
     25 *
     26 * Each step thus corresponds to 96 / 256 or 0.375dB. Every 6dB (16 steps)
     27 * represents doubling the sample value.
     28 *
     29 * For internal use, the volume control needs to be converted to a 16-bit
     30 * (sort of) exponential value between 1 and 65536. This is used with fixed
     31 * point arithmetic such that 65536 means 1.0 and 1 means 1/65536.
     32 *
     33 * For actual volume calculation, 33.31 fixed point is used. Maximum (or
     34 * unattenuated) volume is represented as 0x40000000; conveniently, this
     35 * value fits into a uint32_t.
     36 *
     37 * To enable fast processing, the maximum volume must be a power of two
     38 * and must not have a sign when converted to int32_t. While 0x80000000
     39 * violates these constraints, 0x40000000 does not.
     40 */
     41
     42
     43/*********************************************************************************************************************************
     44*   Header Files                                                                                                                 *
     45*********************************************************************************************************************************/
    1746#define LOG_GROUP LOG_GROUP_AUDIO_MIXER_BUFFER
     47#if defined(VBOX_AUDIO_MIX_BUFFER_TESTCASE) && !defined(RT_STRICT)
     48# define RT_STRICT /* Run the testcase with assertions because the main functions doesn't return on invalid input. */
     49#endif
    1850#include <VBox/log.h>
    1951
     
    5183#include "AudioMixBuffer.h"
    5284
     85
     86/*********************************************************************************************************************************
     87*   Defined Constants And Macros                                                                                                 *
     88*********************************************************************************************************************************/
    5389#ifndef VBOX_AUDIO_TESTCASE
    5490# ifdef DEBUG
     
    6399#endif
    64100
    65 #ifdef DEBUG
    66 static void audioMixBufDbgPrintInternal(PAUDIOMIXBUF pMixBuf, const char *pszFunc);
    67 # ifdef UNUSED
    68 static bool audioMixBufDbgValidate(PAUDIOMIXBUF pMixBuf);
    69 # endif
    70 #endif
    71 
    72 /*
    73  *   Soft Volume Control
    74  *
    75  * The external code supplies an 8-bit volume (attenuation) value in the
    76  * 0 .. 255 range. This represents 0 to -96dB attenuation where an input
    77  * value of 0 corresponds to -96dB and 255 corresponds to 0dB (unchanged).
    78  *
    79  * Each step thus corresponds to 96 / 256 or 0.375dB. Every 6dB (16 steps)
    80  * represents doubling the sample value.
    81  *
    82  * For internal use, the volume control needs to be converted to a 16-bit
    83  * (sort of) exponential value between 1 and 65536. This is used with fixed
    84  * point arithmetic such that 65536 means 1.0 and 1 means 1/65536.
    85  *
    86  * For actual volume calculation, 33.31 fixed point is used. Maximum (or
    87  * unattenuated) volume is represented as 0x40000000; conveniently, this
    88  * value fits into a uint32_t.
    89  *
    90  * To enable fast processing, the maximum volume must be a power of two
    91  * and must not have a sign when converted to int32_t. While 0x80000000
    92  * violates these constraints, 0x40000000 does not.
    93  */
    94 
    95 
    96 /** Logarithmic/exponential volume conversion table. */
    97 static uint32_t const s_aVolumeConv[256] = {
     101
     102/** Bit shift for fixed point conversion.
     103 * @sa @ref sec_audio_mix_buffer_volume */
     104#define AUDIOMIXBUF_VOL_SHIFT       30
     105
     106/** Internal representation of 0dB volume (1.0 in fixed point).
     107 * @sa @ref sec_audio_mix_buffer_volume */
     108#define AUDIOMIXBUF_VOL_0DB         (1 << AUDIOMIXBUF_VOL_SHIFT)
     109AssertCompile(AUDIOMIXBUF_VOL_0DB <= 0x40000000);   /* Must always hold. */
     110AssertCompile(AUDIOMIXBUF_VOL_0DB == 0x40000000);   /* For now -- when only attenuation is used. */
     111
     112
     113/*********************************************************************************************************************************
     114*   Global Variables                                                                                                             *
     115*********************************************************************************************************************************/
     116/** Logarithmic/exponential volume conversion table.
     117 * @sa @ref sec_audio_mix_buffer_volume
     118 */
     119static uint32_t const s_aVolumeConv[256] =
     120{
    98121        1,     1,     1,     1,     1,     1,     1,     1, /*   7 */
    99122        1,     2,     2,     2,     2,     2,     2,     2, /*  15 */
     
    130153};
    131154
    132 /* Bit shift for fixed point conversion. */
    133 #define AUDIOMIXBUF_VOL_SHIFT       30
    134 
    135 /* Internal representation of 0dB volume (1.0 in fixed point). */
    136 #define AUDIOMIXBUF_VOL_0DB         (1 << AUDIOMIXBUF_VOL_SHIFT)
    137 
    138 AssertCompile(AUDIOMIXBUF_VOL_0DB <= 0x40000000);   /* Must always hold. */
    139 AssertCompile(AUDIOMIXBUF_VOL_0DB == 0x40000000);   /* For now -- when only attenuation is used. */
     155
     156/*********************************************************************************************************************************
     157*   Internal Functions                                                                                                           *
     158*********************************************************************************************************************************/
     159#ifdef DEBUG
     160static void audioMixBufDbgPrintInternal(PAUDIOMIXBUF pMixBuf, const char *pszFunc);
     161# ifdef UNUSED
     162static bool audioMixBufDbgValidate(PAUDIOMIXBUF pMixBuf);
     163# endif
     164#endif
     165
    140166
    141167
     
    475501 * Manually coded signed 64-bit conversion.
    476502 */
    477 #if 0
    478 DECLCALLBACK(uint32_t) audioMixBufConvFromS64Stereo(PPDMAUDIOFRAME paDst, const void *pvSrc, uint32_t cbSrc,
    479                                                     PCAUDMIXBUFCONVOPTS pOpts)
    480 {
    481     _aType const *pSrc = (_aType const *)pvSrc;
    482     uint32_t cFrames = RT_MIN(pOpts->cFrames, cbSrc / sizeof(_aType));
    483     AUDMIXBUF_MACRO_LOG(("cFrames=%RU32, BpS=%zu, lVol=%RU32, rVol=%RU32\n",
    484                          pOpts->cFrames, sizeof(_aType), pOpts->From.Volume.uLeft, pOpts->From.Volume.uRight));
    485     for (uint32_t i = 0; i < cFrames; i++)
    486     {
    487         paDst->i64LSample = ASMMult2xS32RetS64((int32_t)audioMixBufClipFrom##_aName(*pSrc++), pOpts->From.Volume.uLeft ) >> AUDIOMIXBUF_VOL_SHIFT; \
    488         paDst->i64RSample = ASMMult2xS32RetS64((int32_t)audioMixBufClipFrom##_aName(*pSrc++), pOpts->From.Volume.uRight) >> AUDIOMIXBUF_VOL_SHIFT; \
    489         paDst++;
    490     }
    491 
    492     return cFrames;
    493 }
    494 #endif
    495 
    496503
    497504/* Encoders for peek: */
     
    747754}
    748755
    749 /**
    750  * Returns the maximum amount of audio frames this buffer can hold.
    751  *
    752  * @return  uint32_t                Size (in audio frames) the mixing buffer can hold.
    753  * @param   pMixBuf                 Mixing buffer to retrieve maximum for.
    754  */
    755 uint32_t AudioMixBufSize(PAUDIOMIXBUF pMixBuf)
     756
     757/**
     758 * Drops all the frames in the given mixing buffer
     759 *
     760 * This will reset the read and write offsets to zero.
     761 *
     762 * @param   pMixBuf             The mixing buffer.
     763 */
     764void AudioMixBufDrop(PAUDIOMIXBUF pMixBuf)
     765{
     766    AssertPtrReturnVoid(pMixBuf);
     767    AssertReturnVoid(pMixBuf->uMagic == AUDIOMIXBUF_MAGIC);
     768
     769    AUDMIXBUF_LOG(("%s\n", pMixBuf->pszName));
     770
     771    pMixBuf->offRead  = 0;
     772    pMixBuf->offWrite = 0;
     773    pMixBuf->cMixed   = 0;
     774    pMixBuf->cUsed    = 0;
     775}
     776
     777
     778/**
     779 * Gets the maximum number of audio frames this buffer can hold.
     780 *
     781 * @returns Number of frames.
     782 * @param   pMixBuf     The mixing buffer.
     783 */
     784uint32_t AudioMixBufSize(PCAUDIOMIXBUF pMixBuf)
    756785{
    757786    AssertPtrReturn(pMixBuf, 0);
     787    Assert(pMixBuf->uMagic == AUDIOMIXBUF_MAGIC);
    758788    return pMixBuf->cFrames;
    759789}
    760790
    761 /**
    762  * Returns the maximum amount of bytes this buffer can hold.
    763  *
    764  * @return  uint32_t                Size (in bytes) the mixing buffer can hold.
    765  * @param   pMixBuf                 Mixing buffer to retrieve maximum for.
    766  */
    767 uint32_t AudioMixBufSizeBytes(PAUDIOMIXBUF pMixBuf)
     791
     792/**
     793 * Gets the maximum number of bytes this buffer can hold.
     794 *
     795 * @returns Number of bytes.
     796 * @param   pMixBuf     The mixing buffer.
     797 */
     798uint32_t AudioMixBufSizeBytes(PCAUDIOMIXBUF pMixBuf)
    768799{
    769800    AssertPtrReturn(pMixBuf, 0);
     801    AssertReturn(pMixBuf->uMagic == AUDIOMIXBUF_MAGIC, 0);
    770802    return AUDIOMIXBUF_F2B(pMixBuf, pMixBuf->cFrames);
    771803}
    772804
    773 /**
    774  * Returns the current write position of a mixing buffer.
    775  *
    776  * @returns VBox status code.
    777  * @param   pMixBuf                 Mixing buffer to return position for.
    778  */
    779 uint32_t AudioMixBufWritePos(PAUDIOMIXBUF pMixBuf)
     805
     806/**
     807 * Worker for AudioMixBufUsed and AudioMixBufUsedBytes.
     808 */
     809DECLINLINE(uint32_t) audioMixBufUsedInternal(PCAUDIOMIXBUF pMixBuf)
     810{
     811    uint32_t const cFrames = pMixBuf->cFrames;
     812    uint32_t       cUsed   = pMixBuf->cUsed;
     813    AssertStmt(cUsed <= cFrames, cUsed = cFrames);
     814    return cUsed;
     815}
     816
     817
     818/**
     819 * Get the number of used (readable) frames in the buffer.
     820 *
     821 * @returns Number of frames.
     822 * @param   pMixBuf     The mixing buffer.
     823 */
     824uint32_t AudioMixBufUsed(PCAUDIOMIXBUF pMixBuf)
    780825{
    781826    AssertPtrReturn(pMixBuf, 0);
    782 
    783     return pMixBuf->offWrite;
    784 }
    785 
    786 /**
    787  * Returns the size (in audio frames) of free audio buffer space.
    788  *
    789  * @return  uint32_t                Size (in audio frames) of free audio buffer space.
    790  * @param   pMixBuf                 Mixing buffer to return free size for.
    791  */
    792 uint32_t AudioMixBufFree(PAUDIOMIXBUF pMixBuf)
     827    Assert(pMixBuf->uMagic == AUDIOMIXBUF_MAGIC);
     828    return audioMixBufUsedInternal(pMixBuf);
     829}
     830
     831
     832/**
     833 * Get the number of (readable) bytes in the buffer.
     834 *
     835 * @returns Number of bytes.
     836 * @param   pMixBuf     The mixing buffer.
     837 */
     838uint32_t AudioMixBufUsedBytes(PCAUDIOMIXBUF pMixBuf)
    793839{
    794840    AssertPtrReturn(pMixBuf, 0);
    795 
     841    Assert(pMixBuf->uMagic == AUDIOMIXBUF_MAGIC);
     842    return AUDIOMIXBUF_F2B(pMixBuf, audioMixBufUsedInternal(pMixBuf));
     843}
     844
     845
     846/**
     847 * Get the number of readable frames in the buffer.
     848 *
     849 * @returns Number of frames.
     850 * @param   pMixBuf     The mixing buffer.
     851 * @todo Exactly same as AudioMixBufUsed.
     852 */
     853uint32_t AudioMixBufLive(PCAUDIOMIXBUF pMixBuf)
     854{
     855    return AudioMixBufUsed(pMixBuf);
     856}
     857
     858
     859/**
     860 * Worker for AudioMixBufFree and AudioMixBufFreeBytes.
     861 */
     862DECLINLINE(uint32_t) audioMixBufFreeInternal(PCAUDIOMIXBUF pMixBuf)
     863{
    796864    uint32_t const cFrames = pMixBuf->cFrames;
    797865    uint32_t       cUsed   = pMixBuf->cUsed;
     
    804872
    805873/**
    806  * Returns the size (in bytes) of free audio buffer space.
    807  *
    808  * @return  uint32_t                Size (in bytes) of free audio buffer space.
    809  * @param   pMixBuf                 Mixing buffer to return free size for.
    810  */
    811 uint32_t AudioMixBufFreeBytes(PAUDIOMIXBUF pMixBuf)
    812 {
    813     return AUDIOMIXBUF_F2B(pMixBuf, AudioMixBufFree(pMixBuf));
     874 * Gets the free buffer space in frames.
     875 *
     876 * @return  Number of frames.
     877 * @param   pMixBuf     The mixing buffer.
     878 */
     879uint32_t AudioMixBufFree(PCAUDIOMIXBUF pMixBuf)
     880{
     881    AssertPtrReturn(pMixBuf, 0);
     882    Assert(pMixBuf->uMagic == AUDIOMIXBUF_MAGIC);
     883    return audioMixBufFreeInternal(pMixBuf);
     884}
     885
     886/**
     887 * Gets the free buffer space in bytes.
     888 *
     889 * @return  Number of bytes.
     890 * @param   pMixBuf     The mixing buffer.
     891 */
     892uint32_t AudioMixBufFreeBytes(PCAUDIOMIXBUF pMixBuf)
     893{
     894    AssertPtrReturn(pMixBuf, 0);
     895    Assert(pMixBuf->uMagic == AUDIOMIXBUF_MAGIC);
     896    return AUDIOMIXBUF_F2B(pMixBuf, audioMixBufFreeInternal(pMixBuf));
    814897}
    815898
     
    825908{
    826909    AssertPtrReturn(pMixBuf, true);
     910    Assert(pMixBuf->uMagic == AUDIOMIXBUF_MAGIC);
    827911    return pMixBuf->cUsed == 0;
    828912}
    829913
    830 /**
    831  * Returns number of available live frames, that is, frames that
    832  * have been written into the mixing buffer but not have been processed yet.
    833  *
    834  * For a parent buffer, this simply returns the currently used number of frames
    835  * in the buffer.
    836  *
    837  * For a child buffer, this returns the number of frames which have been mixed
    838  * to the parent and were not processed by the parent yet.
    839  *
    840  * @return  uint32_t                Number of live frames available.
    841  * @param   pMixBuf                 Mixing buffer to return value for.
    842  */
    843 uint32_t AudioMixBufLive(PAUDIOMIXBUF pMixBuf)
     914
     915/**
     916 * Get the current read position.
     917 *
     918 * This is for the testcase.
     919 *
     920 * @returns Frame number.
     921 * @param   pMixBuf     The mixing buffer.
     922 */
     923uint32_t AudioMixBufReadPos(PCAUDIOMIXBUF pMixBuf)
    844924{
    845925    AssertPtrReturn(pMixBuf, 0);
    846 
    847     uint32_t const cFrames = pMixBuf->cFrames;
    848     uint32_t       cAvail  = pMixBuf->cUsed;
    849     AssertStmt(cAvail <= cFrames, cAvail = cFrames);
    850     return cAvail;
     926    Assert(pMixBuf->uMagic == AUDIOMIXBUF_MAGIC);
     927    return pMixBuf->offRead;
     928}
     929
     930
     931/**
     932 * Gets the current write position.
     933 *
     934 * This is for the testcase.
     935 *
     936 * @returns Frame number.
     937 * @param   pMixBuf     The mixing buffer.
     938 */
     939uint32_t AudioMixBufWritePos(PCAUDIOMIXBUF pMixBuf)
     940{
     941    AssertPtrReturn(pMixBuf, 0);
     942    Assert(pMixBuf->uMagic == AUDIOMIXBUF_MAGIC);
     943    return pMixBuf->offWrite;
    851944}
    852945
     
    9391032
    9401033#endif /* DEBUG */
    941 
    942 /**
    943  * Returns the total number of audio frames used.
    944  *
    945  * @return  uint32_t
    946  * @param   pMixBuf
    947  */
    948 uint32_t AudioMixBufUsed(PAUDIOMIXBUF pMixBuf)
    949 {
    950     AssertPtrReturn(pMixBuf, 0);
    951     return pMixBuf->cUsed;
    952 }
    953 
    954 /**
    955  * Returns the total number of bytes used.
    956  *
    957  * @return  uint32_t
    958  * @param   pMixBuf
    959  */
    960 uint32_t AudioMixBufUsedBytes(PAUDIOMIXBUF pMixBuf)
    961 {
    962     AssertPtrReturn(pMixBuf, 0);
    963     return AUDIOMIXBUF_F2B(pMixBuf, pMixBuf->cUsed);
    964 }
    965 
    966 
    967 /**
    968  * Returns the current read position of a mixing buffer.
    969  *
    970  * @returns VBox status code.
    971  * @param   pMixBuf                 Mixing buffer to return position for.
    972  */
    973 uint32_t AudioMixBufReadPos(PAUDIOMIXBUF pMixBuf)
    974 {
    975     AssertPtrReturn(pMixBuf, 0);
    976 
    977     return pMixBuf->offRead;
    978 }
    979 
    980 
    981 /**
    982  * Drops all the frames in the given mixing buffer
    983  *
    984  * This will reset the read and write offsets to zero.
    985  *
    986  * @param   pMixBuf             The mixing buffer.
    987  */
    988 void AudioMixBufDrop(PAUDIOMIXBUF pMixBuf)
    989 {
    990     AssertPtrReturnVoid(pMixBuf);
    991     AssertReturnVoid(pMixBuf->uMagic == AUDIOMIXBUF_MAGIC);
    992 
    993     AUDMIXBUF_LOG(("%s\n", pMixBuf->pszName));
    994 
    995     pMixBuf->offRead  = 0;
    996     pMixBuf->offWrite = 0;
    997     pMixBuf->cMixed   = 0;
    998     pMixBuf->cUsed    = 0;
    999 }
    10001034
    10011035
  • trunk/src/VBox/Devices/Audio/AudioMixBuffer.h

    r89343 r89350  
    181181
    182182
    183 int     AudioMixBufInit(PAUDIOMIXBUF pMixBuf, const char *pszName, PCPDMAUDIOPCMPROPS pProps, uint32_t cFrames);
    184 void    AudioMixBufDestroy(PAUDIOMIXBUF pMixBuf);
    185 void    AudioMixBufDrop(PAUDIOMIXBUF pMixBuf);
    186 
    187 uint32_t AudioMixBufSize(PAUDIOMIXBUF pMixBuf);
    188 uint32_t AudioMixBufSizeBytes(PAUDIOMIXBUF pMixBuf);
    189 uint32_t AudioMixBufFree(PAUDIOMIXBUF pMixBuf);
    190 uint32_t AudioMixBufFreeBytes(PAUDIOMIXBUF pMixBuf);
    191 bool AudioMixBufIsEmpty(PCAUDIOMIXBUF pMixBuf);
    192 uint32_t AudioMixBufLive(PAUDIOMIXBUF pMixBuf);
    193 uint32_t AudioMixBufUsed(PAUDIOMIXBUF pMixBuf);
    194 uint32_t AudioMixBufUsedBytes(PAUDIOMIXBUF pMixBuf);
    195 uint32_t AudioMixBufReadPos(PAUDIOMIXBUF pMixBuf);
    196 uint32_t AudioMixBufWritePos(PAUDIOMIXBUF pMixBuf);
    197 
    198 void AudioMixBufSetVolume(PAUDIOMIXBUF pMixBuf, PCPDMAUDIOVOLUME pVol);
    199 
    200 int     AudioMixBufInitPeekState(PCAUDIOMIXBUF pMixBuf, PAUDIOMIXBUFPEEKSTATE pState, PCPDMAUDIOPCMPROPS pDstProps);
    201 void    AudioMixBufPeek(PCAUDIOMIXBUF pMixBuf, uint32_t offSrcFrame, uint32_t cMaxSrcFrames, uint32_t *pcSrcFramesPeeked,
    202                         PAUDIOMIXBUFPEEKSTATE pState, void *pvDst, uint32_t cbDst, uint32_t *pcbDstPeeked);
    203 void    AudioMixBufAdvance(PAUDIOMIXBUF pMixBuf, uint32_t cFrames);
    204 
    205 int     AudioMixBufInitWriteState(PCAUDIOMIXBUF pMixBuf, PAUDIOMIXBUFWRITESTATE pState, PCPDMAUDIOPCMPROPS pSrcProps);
    206 void    AudioMixBufWrite(PAUDIOMIXBUF pMixBuf, PAUDIOMIXBUFWRITESTATE pState, const void *pvSrcBuf, uint32_t cbSrcBuf,
    207                          uint32_t offDstFrame, uint32_t cMaxDstFrames, uint32_t *pcDstFramesWritten);
    208 void    AudioMixBufSilence(PAUDIOMIXBUF pMixBuf, PAUDIOMIXBUFWRITESTATE pState, uint32_t offFrame, uint32_t cFrames);
    209 void    AudioMixBufBlend(PAUDIOMIXBUF pMixBuf, PAUDIOMIXBUFWRITESTATE pState, const void *pvSrcBuf, uint32_t cbSrcBuf,
    210                          uint32_t offDstFrame, uint32_t cMaxDstFrames, uint32_t *pcDstFramesBlended);
    211 void    AudioMixBufBlendGap(PAUDIOMIXBUF pMixBuf, PAUDIOMIXBUFWRITESTATE pState, uint32_t cFrames);
    212 void    AudioMixBufCommit(PAUDIOMIXBUF pMixBuf, uint32_t cFrames);
     183int         AudioMixBufInit(PAUDIOMIXBUF pMixBuf, const char *pszName, PCPDMAUDIOPCMPROPS pProps, uint32_t cFrames);
     184void        AudioMixBufDestroy(PAUDIOMIXBUF pMixBuf);
     185void        AudioMixBufDrop(PAUDIOMIXBUF pMixBuf);
     186void        AudioMixBufSetVolume(PAUDIOMIXBUF pMixBuf, PCPDMAUDIOVOLUME pVol);
     187
     188/** @name Mixer buffer getters
     189 * @{ */
     190uint32_t    AudioMixBufSize(PCAUDIOMIXBUF pMixBuf);
     191uint32_t    AudioMixBufSizeBytes(PCAUDIOMIXBUF pMixBuf);
     192uint32_t    AudioMixBufUsed(PCAUDIOMIXBUF pMixBuf);
     193uint32_t    AudioMixBufUsedBytes(PCAUDIOMIXBUF pMixBuf);
     194uint32_t    AudioMixBufLive(PCAUDIOMIXBUF pMixBuf);
     195uint32_t    AudioMixBufFree(PCAUDIOMIXBUF pMixBuf);
     196uint32_t    AudioMixBufFreeBytes(PCAUDIOMIXBUF pMixBuf);
     197bool        AudioMixBufIsEmpty(PCAUDIOMIXBUF pMixBuf);
     198uint32_t    AudioMixBufReadPos(PCAUDIOMIXBUF pMixBuf);
     199uint32_t    AudioMixBufWritePos(PCAUDIOMIXBUF pMixBuf);
     200/** @} */
     201
     202/** @name Mixer buffer reading
     203 *  @{ */
     204int         AudioMixBufInitPeekState(PCAUDIOMIXBUF pMixBuf, PAUDIOMIXBUFPEEKSTATE pState, PCPDMAUDIOPCMPROPS pDstProps);
     205void        AudioMixBufPeek(PCAUDIOMIXBUF pMixBuf, uint32_t offSrcFrame, uint32_t cMaxSrcFrames, uint32_t *pcSrcFramesPeeked,
     206                            PAUDIOMIXBUFPEEKSTATE pState, void *pvDst, uint32_t cbDst, uint32_t *pcbDstPeeked);
     207void        AudioMixBufAdvance(PAUDIOMIXBUF pMixBuf, uint32_t cFrames);
     208/** @} */
     209
     210/** @name Mixer buffer writing
     211 * @{ */
     212int         AudioMixBufInitWriteState(PCAUDIOMIXBUF pMixBuf, PAUDIOMIXBUFWRITESTATE pState, PCPDMAUDIOPCMPROPS pSrcProps);
     213void        AudioMixBufWrite(PAUDIOMIXBUF pMixBuf, PAUDIOMIXBUFWRITESTATE pState, const void *pvSrcBuf, uint32_t cbSrcBuf,
     214                             uint32_t offDstFrame, uint32_t cMaxDstFrames, uint32_t *pcDstFramesWritten);
     215void        AudioMixBufSilence(PAUDIOMIXBUF pMixBuf, PAUDIOMIXBUFWRITESTATE pState, uint32_t offFrame, uint32_t cFrames);
     216void        AudioMixBufBlend(PAUDIOMIXBUF pMixBuf, PAUDIOMIXBUFWRITESTATE pState, const void *pvSrcBuf, uint32_t cbSrcBuf,
     217                             uint32_t offDstFrame, uint32_t cMaxDstFrames, uint32_t *pcDstFramesBlended);
     218void        AudioMixBufBlendGap(PAUDIOMIXBUF pMixBuf, PAUDIOMIXBUFWRITESTATE pState, uint32_t cFrames);
     219void        AudioMixBufCommit(PAUDIOMIXBUF pMixBuf, uint32_t cFrames);
     220/** @} */
     221
    213222
    214223#ifdef DEBUG
  • trunk/src/VBox/Devices/Audio/testcase/Makefile.kmk

    r88234 r89350  
    2525
    2626 tstAudioMixBuffer_TEMPLATE = VBOXR3TSTEXE
    27  tstAudioMixBuffer_DEFS = TESTCASE
     27 tstAudioMixBuffer_DEFS = TESTCASE VBOX_AUDIO_MIX_BUFFER_TESTCASE
    2828 tstAudioMixBuffer_DEFS.debug  = VBOX_WITH_EF_WRAPS
    2929 tstAudioMixBuffer_SOURCES = \
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette