- Timestamp:
- Apr 20, 2015 1:26:03 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmaudioifs.h
r55335 r55340 70 70 typedef struct PDMAUDIOBACKENDCFG 71 71 { 72 size_tcbStreamOut;73 size_tcbStreamIn;72 uint32_t cbStreamOut; 73 uint32_t cbStreamIn; 74 74 uint32_t cMaxHstStrmsOut; 75 75 uint32_t cMaxHstStrmsIn; … … 415 415 * @param pcbRead Bytes of audio data read. Optional. 416 416 */ 417 DECLR3CALLBACKMEMBER(int, pfnRead, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMIN pGstStrmIn, void *pvBuf, size_t cbSize, uint32_t *pcbRead));417 DECLR3CALLBACKMEMBER(int, pfnRead, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMIN pGstStrmIn, void *pvBuf, uint32_t cbSize, uint32_t *pcbRead)); 418 418 419 419 /** … … 427 427 * @param pcbWritten Bytes of audio data written. Optional. 428 428 */ 429 DECLR3CALLBACKMEMBER(int, pfnWrite, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut, const void *pvBuf, size_t cbSize, uint32_t *pcbWritten));429 DECLR3CALLBACKMEMBER(int, pfnWrite, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut, const void *pvBuf, uint32_t cbSize, uint32_t *pcbWritten)); 430 430 431 431 /** -
trunk/src/VBox/Devices/Audio/AudioMixBuffer.cpp
r55339 r55340 231 231 } 232 232 233 size_t audioMixBufFreeBytes(PPDMAUDIOMIXBUF pMixBuf)233 uint32_t audioMixBufFreeBytes(PPDMAUDIOMIXBUF pMixBuf) 234 234 { 235 235 return AUDIOMIXBUF_S2B(pMixBuf, audioMixBufFree(pMixBuf)); … … 935 935 int audioMixBufReadAt(PPDMAUDIOMIXBUF pMixBuf, 936 936 uint32_t offSamples, 937 void *pvBuf, size_t cbBuf,937 void *pvBuf, uint32_t cbBuf, 938 938 uint32_t *pcbRead) 939 939 { … … 944 944 int audioMixBufReadAtEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt, 945 945 uint32_t offSamples, 946 void *pvBuf, size_t cbBuf,946 void *pvBuf, uint32_t cbBuf, 947 947 uint32_t *pcbRead) 948 948 { … … 991 991 992 992 int audioMixBufReadCirc(PPDMAUDIOMIXBUF pMixBuf, 993 void *pvBuf, size_t cbBuf, uint32_t *pcRead)993 void *pvBuf, uint32_t cbBuf, uint32_t *pcRead) 994 994 { 995 995 return audioMixBufReadCircEx(pMixBuf, pMixBuf->AudioFmt, … … 998 998 999 999 int audioMixBufReadCircEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt, 1000 void *pvBuf, size_t cbBuf, uint32_t *pcRead)1000 void *pvBuf, uint32_t cbBuf, uint32_t *pcRead) 1001 1001 { 1002 1002 AssertPtrReturn(pMixBuf, VERR_INVALID_POINTER); … … 1027 1027 1028 1028 PPDMAUDIOSAMPLE pSamplesSrc1 = pMixBuf->pSamples + pMixBuf->offReadWrite; 1029 size_t cLenSrc1 = cToRead;1029 uint32_t cLenSrc1 = cToRead; 1030 1030 1031 1031 PPDMAUDIOSAMPLE pSamplesSrc2 = NULL; 1032 size_t cLenSrc2 = 0;1032 uint32_t cLenSrc2 = 0; 1033 1033 1034 1034 uint32_t offRead = pMixBuf->offReadWrite + cToRead; … … 1144 1144 * @param pMixBuf 1145 1145 */ 1146 size_t audioMixBufSizeBytes(PPDMAUDIOMIXBUF pMixBuf)1146 uint32_t audioMixBufSizeBytes(PPDMAUDIOMIXBUF pMixBuf) 1147 1147 { 1148 1148 return AUDIOMIXBUF_S2B(pMixBuf, pMixBuf->cSamples); … … 1193 1193 int audioMixBufWriteAt(PPDMAUDIOMIXBUF pMixBuf, 1194 1194 uint32_t offSamples, 1195 const void *pvBuf, size_t cbBuf,1195 const void *pvBuf, uint32_t cbBuf, 1196 1196 uint32_t *pcWritten) 1197 1197 { … … 1214 1214 int audioMixBufWriteAtEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt, 1215 1215 uint32_t offSamples, 1216 const void *pvBuf, size_t cbBuf,1216 const void *pvBuf, uint32_t cbBuf, 1217 1217 uint32_t *pcWritten) 1218 1218 { … … 1279 1279 1280 1280 int audioMixBufWriteCirc(PPDMAUDIOMIXBUF pMixBuf, 1281 const void *pvBuf, size_t cbBuf,1281 const void *pvBuf, uint32_t cbBuf, 1282 1282 uint32_t *pcWritten) 1283 1283 { … … 1286 1286 1287 1287 int audioMixBufWriteCircEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt, 1288 const void *pvBuf, size_t cbBuf,1288 const void *pvBuf, uint32_t cbBuf, 1289 1289 uint32_t *pcWritten) 1290 1290 { … … 1327 1327 1328 1328 PPDMAUDIOSAMPLE pSamplesDst1 = pMixBuf->pSamples + pMixBuf->offReadWrite; 1329 size_t cLenDst1 = cToWrite;1329 uint32_t cLenDst1 = cToWrite; 1330 1330 1331 1331 PPDMAUDIOSAMPLE pSamplesDst2 = NULL; 1332 size_t cLenDst2 = 0;1332 uint32_t cLenDst2 = 0; 1333 1333 1334 1334 uint32_t offWrite = pMixBuf->offReadWrite + cToWrite; -
trunk/src/VBox/Devices/Audio/AudioMixBuffer.h
r55005 r55340 54 54 void audioMixBufFinish(PPDMAUDIOMIXBUF pMixBuf, uint32_t cSamplesToClear); 55 55 uint32_t audioMixBufFree(PPDMAUDIOMIXBUF pMixBuf); 56 size_t audioMixBufFreeBytes(PPDMAUDIOMIXBUF pMixBuf);56 uint32_t audioMixBufFreeBytes(PPDMAUDIOMIXBUF pMixBuf); 57 57 int audioMixBufInit(PPDMAUDIOMIXBUF pMixBuf, const char *pszName, PPDMPCMPROPS pProps, uint32_t cSamples); 58 58 bool audioMixBufIsEmpty(PPDMAUDIOMIXBUF pMixBuf); … … 62 62 int audioMixBufMixToParent(PPDMAUDIOMIXBUF pMixBuf, uint32_t cSamples, uint32_t *pcProcessed); 63 63 uint32_t audioMixBufProcessed(PPDMAUDIOMIXBUF pMixBuf); 64 int audioMixBufReadAt(PPDMAUDIOMIXBUF pMixBuf, uint32_t offSamples, void *pvBuf, size_t cbBuf, uint32_t *pcbRead);65 int audioMixBufReadAtEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt, uint32_t offSamples, void *pvBuf, size_t cbBuf, uint32_t *pcbRead);66 int audioMixBufReadCirc(PPDMAUDIOMIXBUF pMixBuf, void *pvBuf, size_t cbBuf, uint32_t *pcRead);67 int audioMixBufReadCircEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt, void *pvBuf, size_t cbBuf, uint32_t *pcRead);64 int audioMixBufReadAt(PPDMAUDIOMIXBUF pMixBuf, uint32_t offSamples, void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead); 65 int audioMixBufReadAtEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt, uint32_t offSamples, void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead); 66 int audioMixBufReadCirc(PPDMAUDIOMIXBUF pMixBuf, void *pvBuf, uint32_t cbBuf, uint32_t *pcRead); 67 int audioMixBufReadCircEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt, void *pvBuf, uint32_t cbBuf, uint32_t *pcRead); 68 68 void audioMixBufReset(PPDMAUDIOMIXBUF pMixBuf); 69 69 void audioMixBufSetVolume(PPDMAUDIOMIXBUF pMixBuf, PPDMAUDIOVOLUME pVol); 70 70 uint32_t audioMixBufSize(PPDMAUDIOMIXBUF pMixBuf); 71 size_t audioMixBufSizeBytes(PPDMAUDIOMIXBUF pMixBuf);71 uint32_t audioMixBufSizeBytes(PPDMAUDIOMIXBUF pMixBuf); 72 72 void audioMixBufUnlink(PPDMAUDIOMIXBUF pMixBuf); 73 int audioMixBufWriteAt(PPDMAUDIOMIXBUF pMixBuf, uint32_t offSamples, const void *pvBuf, size_t cbBuf, uint32_t *pcWritten);74 int audioMixBufWriteAtEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt, uint32_t offSamples, const void *pvBuf, size_t cbBuf, uint32_t *pcWritten);75 int audioMixBufWriteCirc(PPDMAUDIOMIXBUF pMixBuf, const void *pvBuf, size_t cbBuf, uint32_t *pcWritten);76 int audioMixBufWriteCircEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt, const void *pvBuf, size_t cbBuf, uint32_t *pcWritten);73 int audioMixBufWriteAt(PPDMAUDIOMIXBUF pMixBuf, uint32_t offSamples, const void *pvBuf, uint32_t cbBuf, uint32_t *pcWritten); 74 int audioMixBufWriteAtEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt, uint32_t offSamples, const void *pvBuf, uint32_t cbBuf, uint32_t *pcWritten); 75 int audioMixBufWriteCirc(PPDMAUDIOMIXBUF pMixBuf, const void *pvBuf, uint32_t cbBuf, uint32_t *pcWritten); 76 int audioMixBufWriteCircEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt, const void *pvBuf, uint32_t cbBuf, uint32_t *pcWritten); 77 77 78 78 #endif /* AUDIO_MIXBUF_H */ -
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r55065 r55340 281 281 } 282 282 283 int audioMixerProcessSinkIn(PAUDMIXSINK pSink, AUDMIXOP enmOp, void *pvBuf, size_t cbBuf, uint32_t *pcbProcessed)283 int audioMixerProcessSinkIn(PAUDMIXSINK pSink, AUDMIXOP enmOp, void *pvBuf, uint32_t cbBuf, uint32_t *pcbProcessed) 284 284 { 285 285 AssertPtrReturn(pSink, VERR_INVALID_POINTER); … … 307 307 308 308 uint32_t cbTotalRead = 0; 309 size_t cbToRead = cbBuf;309 uint32_t cbToRead = cbBuf; 310 310 311 311 while (cbToRead) … … 344 344 } 345 345 346 int audioMixerProcessSinkOut(PAUDMIXSINK pSink, AUDMIXOP enmOp, const void *pvBuf, size_t cbBuf, uint32_t *pcbProcessed)346 int audioMixerProcessSinkOut(PAUDMIXSINK pSink, AUDMIXOP enmOp, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbProcessed) 347 347 { 348 348 return VERR_NOT_IMPLEMENTED; -
trunk/src/VBox/Devices/Audio/AudioMixer.h
r55065 r55340 100 100 uint32_t audioMixerGetStreamCount(PAUDIOMIXER pMixer); 101 101 void audioMixerInvalidate(PAUDIOMIXER pMixer); 102 int audioMixerProcessSinkIn(PAUDMIXSINK pSink, AUDMIXOP enmOp, void *pvBuf, size_t cbBuf, uint32_t *pcbProcessed);103 int audioMixerProcessSinkOut(PAUDMIXSINK pSink, AUDMIXOP enmOp, const void *pvBuf, size_t cbBuf, uint32_t *pcbProcessed);102 int audioMixerProcessSinkIn(PAUDMIXSINK pSink, AUDMIXOP enmOp, void *pvBuf, uint32_t cbBuf, uint32_t *pcbProcessed); 103 int audioMixerProcessSinkOut(PAUDMIXSINK pSink, AUDMIXOP enmOp, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbProcessed); 104 104 void audioMixerRemoveSink(PAUDIOMIXER pMixer, PAUDMIXSINK pSink); 105 105 void audioMixerRemoveStream(PAUDMIXSINK pMixer, PAUDMIXSTREAM pStream); -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r55335 r55340 396 396 else 397 397 { 398 rc = VERR_ACCESS_DENIED; 398 399 LogFlowFunc(("[%s] Still is being used, rc=%Rrc\n", pHstStrmOut->MixBuf.pszName, rc)); 399 rc = VERR_ACCESS_DENIED;400 400 } 401 401 … … 861 861 */ 862 862 int drvAudioWrite(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut, 863 const void *pvBuf, size_t cbBuf, uint32_t *pcbWritten)863 const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten) 864 864 { 865 865 PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface); … … 976 976 else 977 977 { 978 rc = VERR_ACCESS_DENIED; 978 979 LogFlowFunc(("[%s] Still is being used, rc=%Rrc\n", pHstStrmIn->MixBuf.pszName, rc)); 979 rc = VERR_ACCESS_DENIED;980 980 } 981 981 … … 1401 1401 1402 1402 static DECLCALLBACK(int) drvAudioRead(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMIN pGstStrmIn, 1403 void *pvBuf, size_t cbBuf, uint32_t *pcbRead)1403 void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead) 1404 1404 { 1405 1405 PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface); -
trunk/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp
r55335 r55340 92 92 * Circular writes. 93 93 */ 94 size_t cToWrite = audioMixBufSize(&mb) - written_abs - 1; /* -1 as padding plus -2 samples for above. */95 for ( size_t i = 0; i < cToWrite; i++)94 uint32_t cToWrite = audioMixBufSize(&mb) - written_abs - 1; /* -1 as padding plus -2 samples for above. */ 95 for (uint32_t i = 0; i < cToWrite; i++) 96 96 { 97 97 RTTESTI_CHECK_RC_OK(audioMixBufWriteCirc(&mb, &samples16, sizeof(samples16), &written)); … … 110 110 111 111 /* Circular reads. */ 112 size_t cToRead = audioMixBufSize(&mb) - written_abs - 1;113 for ( size_t i = 0; i < cToWrite; i++)112 uint32_t cToRead = audioMixBufSize(&mb) - written_abs - 1; 113 for (uint32_t i = 0; i < cToWrite; i++) 114 114 { 115 115 RTTESTI_CHECK_RC_OK(audioMixBufReadCirc(&mb, &samples16, sizeof(samples16), &read)); … … 186 186 * Writing + mixing from child/children -> parent, sequential. 187 187 */ 188 size_t cbBuf = _1K;188 uint32_t cbBuf = _1K; 189 189 char pvBuf[_1K]; 190 190 int16_t samples[32] = { 0xAA, 0xBB }; 191 uint32_t free, read , written, proc, mixed, temp;191 uint32_t read , written, mixed, temp; 192 192 193 193 uint32_t cChild1Free = cBufSize;
Note:
See TracChangeset
for help on using the changeset viewer.