VirtualBox

Changeset 55340 in vbox for trunk


Ignore:
Timestamp:
Apr 20, 2015 1:26:03 PM (10 years ago)
Author:
vboxsync
Message:

Audio: Fixed warnings, largely inconsistent types.

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmaudioifs.h

    r55335 r55340  
    7070typedef struct PDMAUDIOBACKENDCFG
    7171{
    72     size_t      cbStreamOut;
    73     size_t      cbStreamIn;
     72    uint32_t    cbStreamOut;
     73    uint32_t    cbStreamIn;
    7474    uint32_t    cMaxHstStrmsOut;
    7575    uint32_t    cMaxHstStrmsIn;
     
    415415     * @param   pcbRead         Bytes of audio data read. Optional.
    416416     */
    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));
    418418
    419419    /**
     
    427427     * @param   pcbWritten      Bytes of audio data written. Optional.
    428428     */
    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));
    430430
    431431    /**
  • trunk/src/VBox/Devices/Audio/AudioMixBuffer.cpp

    r55339 r55340  
    231231}
    232232
    233 size_t audioMixBufFreeBytes(PPDMAUDIOMIXBUF pMixBuf)
     233uint32_t audioMixBufFreeBytes(PPDMAUDIOMIXBUF pMixBuf)
    234234{
    235235    return AUDIOMIXBUF_S2B(pMixBuf, audioMixBufFree(pMixBuf));
     
    935935int audioMixBufReadAt(PPDMAUDIOMIXBUF pMixBuf,
    936936                      uint32_t offSamples,
    937                       void *pvBuf, size_t cbBuf,
     937                      void *pvBuf, uint32_t cbBuf,
    938938                      uint32_t *pcbRead)
    939939{
     
    944944int audioMixBufReadAtEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt,
    945945                        uint32_t offSamples,
    946                         void *pvBuf, size_t cbBuf,
     946                        void *pvBuf, uint32_t cbBuf,
    947947                        uint32_t *pcbRead)
    948948{
     
    991991
    992992int audioMixBufReadCirc(PPDMAUDIOMIXBUF pMixBuf,
    993                         void *pvBuf, size_t cbBuf, uint32_t *pcRead)
     993                        void *pvBuf, uint32_t cbBuf, uint32_t *pcRead)
    994994{
    995995    return audioMixBufReadCircEx(pMixBuf, pMixBuf->AudioFmt,
     
    998998
    999999int audioMixBufReadCircEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt,
    1000                           void *pvBuf, size_t cbBuf, uint32_t *pcRead)
     1000                          void *pvBuf, uint32_t cbBuf, uint32_t *pcRead)
    10011001{
    10021002    AssertPtrReturn(pMixBuf, VERR_INVALID_POINTER);
     
    10271027
    10281028    PPDMAUDIOSAMPLE pSamplesSrc1 = pMixBuf->pSamples + pMixBuf->offReadWrite;
    1029     size_t cLenSrc1 = cToRead;
     1029    uint32_t cLenSrc1 = cToRead;
    10301030
    10311031    PPDMAUDIOSAMPLE pSamplesSrc2 = NULL;
    1032     size_t cLenSrc2 = 0;
     1032    uint32_t cLenSrc2 = 0;
    10331033
    10341034    uint32_t offRead = pMixBuf->offReadWrite + cToRead;
     
    11441144 * @param   pMixBuf
    11451145 */
    1146 size_t audioMixBufSizeBytes(PPDMAUDIOMIXBUF pMixBuf)
     1146uint32_t audioMixBufSizeBytes(PPDMAUDIOMIXBUF pMixBuf)
    11471147{
    11481148    return AUDIOMIXBUF_S2B(pMixBuf, pMixBuf->cSamples);
     
    11931193int audioMixBufWriteAt(PPDMAUDIOMIXBUF pMixBuf,
    11941194                       uint32_t offSamples,
    1195                        const void *pvBuf, size_t cbBuf,
     1195                       const void *pvBuf, uint32_t cbBuf,
    11961196                       uint32_t *pcWritten)
    11971197{
     
    12141214int audioMixBufWriteAtEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt,
    12151215                         uint32_t offSamples,
    1216                          const void *pvBuf, size_t cbBuf,
     1216                         const void *pvBuf, uint32_t cbBuf,
    12171217                         uint32_t *pcWritten)
    12181218{
     
    12791279
    12801280int audioMixBufWriteCirc(PPDMAUDIOMIXBUF pMixBuf,
    1281                          const void *pvBuf, size_t cbBuf,
     1281                         const void *pvBuf, uint32_t cbBuf,
    12821282                         uint32_t *pcWritten)
    12831283{
     
    12861286
    12871287int audioMixBufWriteCircEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt,
    1288                            const void *pvBuf, size_t cbBuf,
     1288                           const void *pvBuf, uint32_t cbBuf,
    12891289                           uint32_t *pcWritten)
    12901290{
     
    13271327
    13281328    PPDMAUDIOSAMPLE pSamplesDst1 = pMixBuf->pSamples + pMixBuf->offReadWrite;
    1329     size_t cLenDst1 = cToWrite;
     1329    uint32_t cLenDst1 = cToWrite;
    13301330
    13311331    PPDMAUDIOSAMPLE pSamplesDst2 = NULL;
    1332     size_t cLenDst2 = 0;
     1332    uint32_t cLenDst2 = 0;
    13331333
    13341334    uint32_t offWrite = pMixBuf->offReadWrite + cToWrite;
  • trunk/src/VBox/Devices/Audio/AudioMixBuffer.h

    r55005 r55340  
    5454void audioMixBufFinish(PPDMAUDIOMIXBUF pMixBuf, uint32_t cSamplesToClear);
    5555uint32_t audioMixBufFree(PPDMAUDIOMIXBUF pMixBuf);
    56 size_t audioMixBufFreeBytes(PPDMAUDIOMIXBUF pMixBuf);
     56uint32_t audioMixBufFreeBytes(PPDMAUDIOMIXBUF pMixBuf);
    5757int audioMixBufInit(PPDMAUDIOMIXBUF pMixBuf, const char *pszName, PPDMPCMPROPS pProps, uint32_t cSamples);
    5858bool audioMixBufIsEmpty(PPDMAUDIOMIXBUF pMixBuf);
     
    6262int audioMixBufMixToParent(PPDMAUDIOMIXBUF pMixBuf, uint32_t cSamples, uint32_t *pcProcessed);
    6363uint32_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);
     64int audioMixBufReadAt(PPDMAUDIOMIXBUF pMixBuf, uint32_t offSamples, void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead);
     65int audioMixBufReadAtEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt, uint32_t offSamples, void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead);
     66int audioMixBufReadCirc(PPDMAUDIOMIXBUF pMixBuf, void *pvBuf, uint32_t cbBuf, uint32_t *pcRead);
     67int audioMixBufReadCircEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt, void *pvBuf, uint32_t cbBuf, uint32_t *pcRead);
    6868void audioMixBufReset(PPDMAUDIOMIXBUF pMixBuf);
    6969void audioMixBufSetVolume(PPDMAUDIOMIXBUF pMixBuf, PPDMAUDIOVOLUME pVol);
    7070uint32_t audioMixBufSize(PPDMAUDIOMIXBUF pMixBuf);
    71 size_t audioMixBufSizeBytes(PPDMAUDIOMIXBUF pMixBuf);
     71uint32_t audioMixBufSizeBytes(PPDMAUDIOMIXBUF pMixBuf);
    7272void 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);
     73int audioMixBufWriteAt(PPDMAUDIOMIXBUF pMixBuf, uint32_t offSamples, const void *pvBuf, uint32_t cbBuf, uint32_t *pcWritten);
     74int audioMixBufWriteAtEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt, uint32_t offSamples, const void *pvBuf, uint32_t cbBuf, uint32_t *pcWritten);
     75int audioMixBufWriteCirc(PPDMAUDIOMIXBUF pMixBuf, const void *pvBuf, uint32_t cbBuf, uint32_t *pcWritten);
     76int audioMixBufWriteCircEx(PPDMAUDIOMIXBUF pMixBuf, PDMAUDIOMIXBUFFMT enmFmt, const void *pvBuf, uint32_t cbBuf, uint32_t *pcWritten);
    7777
    7878#endif /* AUDIO_MIXBUF_H */
  • trunk/src/VBox/Devices/Audio/AudioMixer.cpp

    r55065 r55340  
    281281}
    282282
    283 int audioMixerProcessSinkIn(PAUDMIXSINK pSink, AUDMIXOP enmOp, void *pvBuf, size_t cbBuf, uint32_t *pcbProcessed)
     283int audioMixerProcessSinkIn(PAUDMIXSINK pSink, AUDMIXOP enmOp, void *pvBuf, uint32_t cbBuf, uint32_t *pcbProcessed)
    284284{
    285285    AssertPtrReturn(pSink, VERR_INVALID_POINTER);
     
    307307
    308308        uint32_t cbTotalRead = 0;
    309         size_t cbToRead = cbBuf;
     309        uint32_t cbToRead = cbBuf;
    310310
    311311        while (cbToRead)
     
    344344}
    345345
    346 int audioMixerProcessSinkOut(PAUDMIXSINK pSink, AUDMIXOP enmOp, const void *pvBuf, size_t cbBuf, uint32_t *pcbProcessed)
     346int audioMixerProcessSinkOut(PAUDMIXSINK pSink, AUDMIXOP enmOp, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbProcessed)
    347347{
    348348    return VERR_NOT_IMPLEMENTED;
  • trunk/src/VBox/Devices/Audio/AudioMixer.h

    r55065 r55340  
    100100uint32_t audioMixerGetStreamCount(PAUDIOMIXER pMixer);
    101101void 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);
     102int audioMixerProcessSinkIn(PAUDMIXSINK pSink, AUDMIXOP enmOp, void *pvBuf, uint32_t cbBuf, uint32_t *pcbProcessed);
     103int audioMixerProcessSinkOut(PAUDMIXSINK pSink, AUDMIXOP enmOp, const void *pvBuf, uint32_t cbBuf, uint32_t *pcbProcessed);
    104104void audioMixerRemoveSink(PAUDIOMIXER pMixer, PAUDMIXSINK pSink);
    105105void audioMixerRemoveStream(PAUDMIXSINK pMixer, PAUDMIXSTREAM pStream);
  • trunk/src/VBox/Devices/Audio/DrvAudio.cpp

    r55335 r55340  
    396396    else
    397397    {
     398        rc = VERR_ACCESS_DENIED;
    398399        LogFlowFunc(("[%s] Still is being used, rc=%Rrc\n", pHstStrmOut->MixBuf.pszName, rc));
    399         rc = VERR_ACCESS_DENIED;
    400400    }
    401401
     
    861861 */
    862862int 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)
    864864{
    865865    PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface);
     
    976976    else
    977977    {
     978        rc = VERR_ACCESS_DENIED;
    978979        LogFlowFunc(("[%s] Still is being used, rc=%Rrc\n", pHstStrmIn->MixBuf.pszName, rc));
    979         rc = VERR_ACCESS_DENIED;
    980980    }
    981981
     
    14011401
    14021402static 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)
    14041404{
    14051405    PDRVAUDIO pThis = PDMIAUDIOCONNECTOR_2_DRVAUDIO(pInterface);
  • trunk/src/VBox/Devices/Audio/testcase/tstAudioMixBuffer.cpp

    r55335 r55340  
    9292     * Circular writes.
    9393     */
    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++)
    9696    {
    9797        RTTESTI_CHECK_RC_OK(audioMixBufWriteCirc(&mb, &samples16, sizeof(samples16), &written));
     
    110110
    111111    /* 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++)
    114114    {
    115115        RTTESTI_CHECK_RC_OK(audioMixBufReadCirc(&mb, &samples16, sizeof(samples16), &read));
     
    186186     * Writing + mixing from child/children -> parent, sequential.
    187187     */
    188     size_t cbBuf = _1K;
     188    uint32_t cbBuf = _1K;
    189189    char pvBuf[_1K];
    190190    int16_t samples[32] = { 0xAA, 0xBB };
    191     uint32_t free, read , written, proc, mixed, temp;
     191    uint32_t read , written, mixed, temp;
    192192
    193193    uint32_t cChild1Free     = cBufSize;
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