VirtualBox

Changeset 53831 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Jan 15, 2015 4:15:21 PM (10 years ago)
Author:
vboxsync
Message:

PDM/Audio: Build fix; forgot some files.

Location:
trunk/src/VBox/Main/src-client
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp

    r53815 r53831  
    26882688                case AudioDriverType_WinMM:
    26892689                {
    2690 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER
     2690#  ifdef VBOX_WITH_PDM_AUDIO_DRIVER
    26912691                    #error "Port WinMM audio backend!" /** @todo Still needed? */
    2692 #else
     2692#  else
    26932693                    InsertConfigString(pCfg, "AudioDriver", "winmm");
    2694 #endif
     2694#  endif
    26952695                    break;
    26962696                }
     
    27092709                case AudioDriverType_SolAudio:
    27102710                {
    2711 #ifdef VBOX_WITH_PDM_AUDIO_DRIVER
    2712                     #error "Port Solaris audio backend!" /** @todo Port Solaris driver. */
    2713 #else
     2711# ifdef VBOX_WITH_PDM_AUDIO_DRIVER
     2712                    /** @todo Hack alert: Find a better solution. */
     2713                    LogRel(("Audio: WARNING: Solaris Audio is deprecated, please switch to OSS!\n"));
     2714                    LogRel(("Audio: Automatically setting host audio backend to OSS\n"));
     2715                    /* Manually set backend to OSS for now. */
     2716                    InsertConfigString(pLunL1, "Driver", "OSSAudio");
     2717# else
    27142718                    InsertConfigString(pCfg, "AudioDriver", "solaudio");
    2715 #endif
     2719# endif
    27162720                    break;
    27172721                }
  • trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp

    r53442 r53831  
    204204                                                 pHstStrmOut->Props.fSigned);
    205205
    206     LogFlowFunc(("hz=%d, chan=%d, cBits=%d, fSigned=%RTbool, format=%ld\n",
     206    pVRDEStrmOut->old_ticks = now;
     207
     208    int cSamplesToSend = live;
     209
     210/*  if (!cSamplesToSend)
     211    {
     212        if (pcSamplesPlayed)
     213            pcSamplesPlayed = 0;
     214
     215        return 0;
     216    }*/
     217
     218    LogFlowFunc(("uFreq=%RU32, cChan=%RU8, cBits=%RU8, fSigned=%RTbool, enmFormat=%ld, cSamplesToSend=%RU32\n",
    207219                 pHstStrmOut->Props.uHz, pHstStrmOut->Props.cChannels,
    208220                 pHstStrmOut->Props.cBits, pHstStrmOut->Props.fSigned,
    209                  format));
    210 
    211     pVRDEStrmOut->old_ticks = now;
    212     int cSamplesToSend = RT_MIN(live, cSamplesPlayed);
     221                 format, cSamplesToSend));
    213222
    214223    uint32_t cReadTotal = 0;
     
    218227    int rc = audioMixBufAcquire(&pHstStrmOut->MixBuf, cSamplesToSend,
    219228                                &pSamples, &cRead);
    220     if (RT_SUCCESS(rc))
     229    if (   RT_SUCCESS(rc)
     230        && cRead)
    221231    {
    222232        cReadTotal = cRead;
     
    228238                                    &pSamples, &cRead);
    229239            if (RT_SUCCESS(rc))
    230             {
    231                 cReadTotal += cRead;
    232240                pDrv->pConsoleVRDPServer->SendAudioSamples(pSamples, cRead, format);
    233             }
     241
     242            cReadTotal += cRead;
    234243        }
    235244    }
    236245
    237     audioMixBufFinish(&pHstStrmOut->MixBuf, cReadTotal);
    238 
     246    audioMixBufFinish(&pHstStrmOut->MixBuf, cSamplesToSend);
     247
     248    /*
     249     * Always report back all samples acquired, regardless of whether the
     250     * VRDP server actually did process those.
     251     */
    239252    if (pcSamplesPlayed)
    240253        *pcSamplesPlayed = cReadTotal;
    241254
    242     LogFlowFunc(("cSamplesToSend=%RU32, rc=%Rrc\n", cSamplesToSend, rc));
     255    LogFlowFunc(("cReadTotal=%RU32, rc=%Rrc\n", cReadTotal, rc));
    243256    return rc;
    244257}
     
    269282    AssertPtrReturn(pDrv, VERR_INVALID_POINTER);
    270283
     284    PVRDESTREAMIN pVRDEStrmOut = (PVRDESTREAMIN)pHstStrmOut;
     285    AssertPtrReturn(pVRDEStrmOut, VERR_INVALID_POINTER);
     286
    271287    LogFlowFunc(("enmStreamCmd=%ld\n", enmStreamCmd));
    272288
    273     return VINF_SUCCESS;
    274 }
    275 
    276 static DECLCALLBACK(int) drvAudioVRDEControlIn(PPDMIHOSTAUDIO pInterface, PPDMAUDIOHSTSTRMIN pHstStrmIn2, /** @todo Fix param types! */
     289    audioMixBufReset(&pHstStrmOut->MixBuf);
     290
     291    return VINF_SUCCESS;
     292}
     293
     294static DECLCALLBACK(int) drvAudioVRDEControlIn(PPDMIHOSTAUDIO pInterface, PPDMAUDIOHSTSTRMIN pHstStrmIn,
    277295                                               PDMAUDIOSTREAMCMD enmStreamCmd)
    278296{
     
    280298    AssertPtrReturn(pDrv, VERR_INVALID_POINTER);
    281299
    282     PVRDESTREAMIN pVRDEStrmIn = (PVRDESTREAMIN)pHstStrmIn2;
     300    PVRDESTREAMIN pVRDEStrmIn = (PVRDESTREAMIN)pHstStrmIn;
    283301    AssertPtrReturn(pVRDEStrmIn, VERR_INVALID_POINTER);
    284302
    285     PPDMAUDIOHSTSTRMIN pHstStrmIn = &pVRDEStrmIn->HstStrmIn;
     303    PPDMAUDIOHSTSTRMIN pThisStrmIn = &pVRDEStrmIn->HstStrmIn;
    286304
    287305    LogFlowFunc(("enmStreamCmd=%ld\n", enmStreamCmd));
     306
     307    if (!pDrv->pConsoleVRDPServer)
     308        return VINF_SUCCESS;
     309
     310    audioMixBufReset(&pThisStrmIn->MixBuf);
    288311
    289312    /* Initialize only if not already done. */
    290313    if (enmStreamCmd == PDMAUDIOSTREAMCMD_ENABLE)
    291314    {
    292         int rc2 = pDrv->pConsoleVRDPServer->SendAudioInputBegin(NULL, pVRDEStrmIn, audioMixBufSize(&pHstStrmIn->MixBuf),
    293                                                                 pHstStrmIn->Props.uHz,
    294                                                                 pHstStrmIn->Props.cChannels, pHstStrmIn->Props.cBits);
     315        int rc2 = pDrv->pConsoleVRDPServer->SendAudioInputBegin(NULL, pVRDEStrmIn, audioMixBufSize(&pThisStrmIn->MixBuf),
     316                                                                pThisStrmIn->Props.uHz,
     317                                                                pThisStrmIn->Props.cChannels, pThisStrmIn->Props.cBits);
    295318#ifdef DEBUG
    296319        if (rc2 == VERR_NOT_SUPPORTED)
     
    299322    }
    300323    else if (enmStreamCmd == PDMAUDIOSTREAMCMD_DISABLE)
     324    {
    301325        pDrv->pConsoleVRDPServer->SendAudioInputEnd(NULL /* pvUserCtx */);
     326    }
    302327
    303328    return VINF_SUCCESS;
     
    345370{
    346371    LogFlowThisFunc(("fIntercept=%RTbool\n", fIntercept));
     372
    347373    return VINF_SUCCESS; /* Never veto. */
    348374}
     
    430456    /* IBase */
    431457    pDrvIns->IBase.pfnQueryInterface  = drvAudioVRDEQueryInterface;
     458    /* IHostAudioR3 */
    432459    pThis->IHostAudioR3.pfnInitIn     = drvAudioVRDEInitIn;
    433460    pThis->IHostAudioR3.pfnInitOut    = drvAudioVRDEInitOut;
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