Changeset 88920 in vbox
- Timestamp:
- May 6, 2021 11:19:09 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144255
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r88918 r88920 776 776 pSink->VolumeCombined.uLeft = PDMAUDIO_VOLUME_MAX; 777 777 pSink->VolumeCombined.uRight = PDMAUDIO_VOLUME_MAX; 778 779 const size_t cbScratchBuf = _1K; /** @todo Make this configurable? */780 781 pSink->pabScratchBuf = (uint8_t *)RTMemAlloc(cbScratchBuf);782 AssertPtrReturn(pSink->pabScratchBuf, VERR_NO_MEMORY);783 pSink->cbScratchBuf = cbScratchBuf;784 778 } 785 779 … … 853 847 RTStrFree(pSink->pszName); 854 848 pSink->pszName = NULL; 855 856 RTMemFree(pSink->pabScratchBuf);857 pSink->pabScratchBuf = NULL;858 pSink->cbScratchBuf = 0;859 849 860 850 AudioMixBufDestroy(&pSink->MixBuf); -
trunk/src/VBox/Devices/Audio/AudioMixer.h
r88918 r88920 48 48 /** The master volume of this mixer. */ 49 49 PDMAUDIOVOLUME VolMaster; 50 /** List of audio mixer sinks . */50 /** List of audio mixer sinks (AUDMIXSINK). */ 51 51 RTLISTANCHOR lstSinks; 52 52 /** Number of used audio sinks. */ … … 57 57 /** Pointer to an audio mixer instance. */ 58 58 typedef AUDIOMIXER *PAUDIOMIXER; 59 60 /** @name AUDMIXER_FLAGS_XXX - For AudioMixerCreate(). 61 * @{ */ 62 /** No mixer flags specified. */ 63 #define AUDMIXER_FLAGS_NONE 0 64 /** Debug mode enabled. 65 * This writes .WAV file to the host, usually to the temporary directory. */ 66 #define AUDMIXER_FLAGS_DEBUG RT_BIT(0) 67 /** Validation mask. */ 68 #define AUDMIXER_FLAGS_VALID_MASK UINT32_C(0x00000001) 69 /** @} */ 59 70 60 71 … … 123 134 /** The sink direction (either PDMAUDIODIR_IN or PDMAUDIODIR_OUT). */ 124 135 PDMAUDIODIR enmDir; 125 /** Scratch buffer for multiplexing / mixing. Might be NULL if not needed. */ 126 uint8_t *pabScratchBuf; 127 /** Size (in bytes) of pabScratchBuf. Might be 0 if not needed. */ 128 size_t cbScratchBuf; 129 /** The sink's PCM format. */ 136 /** The sink's PCM format (i.e. the guest device side). */ 130 137 PDMAUDIOPCMPROPS PCMProps; 131 138 /** Sink status bits - AUDMIXSINK_STS_XXX. */ … … 133 140 /** Number of streams assigned. */ 134 141 uint8_t cStreams; 135 /** List of assigned streams .142 /** List of assigned streams (AUDMIXSTREAM). 136 143 * @note All streams have the same PCM properties, so the mixer does not do 137 144 * any conversion. bird: That is *NOT* true any more, the mixer has … … 209 216 210 217 211 /** @name AUDMIXER_FLAGS_XXX - For AudioMixerCreate().212 * @{ */213 /** No mixer flags specified. */214 #define AUDMIXER_FLAGS_NONE 0215 /** Debug mode enabled.216 * This writes .WAV file to the host, usually to the temporary directory. */217 #define AUDMIXER_FLAGS_DEBUG RT_BIT(0)218 /** Validation mask. */219 #define AUDMIXER_FLAGS_VALID_MASK UINT32_C(0x00000001)220 /** @} */221 222 223 218 int AudioMixerCreate(const char *pszName, uint32_t fFlags, PAUDIOMIXER *ppMixer); 224 219 int AudioMixerCreateSink(PAUDIOMIXER pMixer, const char *pszName, PDMAUDIODIR enmDir, PPDMDEVINS pDevIns, PAUDMIXSINK *ppSink);
Note:
See TracChangeset
for help on using the changeset viewer.