VirtualBox

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


Ignore:
Timestamp:
Feb 9, 2018 10:44:14 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
120756
Message:

Audio/DrvHostDSound.cpp: Cleanup / docs.

File:
1 edited

Legend:

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

    r70927 r70928  
    258258}
    259259
    260 
    261260static int dsoundWaveFmtFromCfg(PPDMAUDIOSTREAMCFG pCfg, PWAVEFORMATEX pFmt)
    262261{
     
    277276}
    278277
    279 
    280278/**
    281279 * Retrieves the number of free bytes available for writing to a DirectSound output stream.
     
    356354}
    357355
    358 
    359356static char *dsoundGUIDToUtf8StrA(LPCGUID pGUID)
    360357{
     
    375372    return RTStrDup("{Default device}");
    376373}
    377 
    378374
    379375/**
     
    397393    Assert(RTListIsEmpty(&pThis->lstDevOutput));
    398394}
    399 
    400395
    401396static HRESULT directSoundPlayRestore(PDRVHOSTDSOUND pThis, LPDIRECTSOUNDBUFFER8 pDSB)
     
    411406}
    412407
    413 
    414408static HRESULT directSoundPlayUnlock(PDRVHOSTDSOUND pThis, LPDIRECTSOUNDBUFFER8 pDSB,
    415409                                     PVOID pv1, PVOID pv2,
     
    423417}
    424418
    425 
    426419static HRESULT directSoundCaptureUnlock(LPDIRECTSOUNDCAPTUREBUFFER8 pDSCB,
    427420                                        PVOID pv1, PVOID pv2,
     
    433426    return hr;
    434427}
    435 
    436428
    437429static HRESULT directSoundPlayLock(PDRVHOSTDSOUND pThis, PDSOUNDSTREAM pStreamDS,
     
    482474}
    483475
    484 
    485476static HRESULT directSoundCaptureLock(PDSOUNDSTREAM pStreamDS,
    486477                                      DWORD dwOffset, DWORD dwBytes,
     
    519510}
    520511
    521 
    522512/*
    523513 * DirectSound playback
     
    534524    }
    535525}
    536 
    537526
    538527static HRESULT directSoundPlayInterfaceCreate(PDRVHOSTDSOUND pThis)
     
    575564}
    576565
    577 
    578566static HRESULT directSoundPlayClose(PDRVHOSTDSOUND pThis, PDSOUNDSTREAM pStreamDS)
    579567{
     
    621609    return hr;
    622610}
    623 
    624611
    625612static HRESULT directSoundPlayOpen(PDRVHOSTDSOUND pThis, PDSOUNDSTREAM pStreamDS,
     
    814801}
    815802
    816 
    817803static void dsoundPlayClearBuffer(PDRVHOSTDSOUND pThis, PDSOUNDSTREAM pStreamDS)
    818804{
     
    845831}
    846832
    847 
    848833static HRESULT directSoundPlayGetStatus(PDRVHOSTDSOUND pThis, LPDIRECTSOUNDBUFFER8 pDSB, DWORD *pdwStatus)
    849834{
     
    879864    return hr;
    880865}
    881 
    882866
    883867static HRESULT directSoundPlayStop(PDRVHOSTDSOUND pThis, PDSOUNDSTREAM pStreamDS, bool fFlush)
     
    927911
    928912    pStreamDS->fEnabled           = true;
     913    /* Note: Playing back via DirectSound starts in the notification thread
     914     *       once enough audio output data is available. */
    929915
    930916    pStreamDS->Out.fFirstPlayback = true;
     
    10731059}
    10741060
    1075 
    10761061static HRESULT directSoundCaptureClose(PDRVHOSTDSOUND pThis, PDSOUNDSTREAM pStreamDS)
    10771062{
     
    10971082    return hr;
    10981083}
    1099 
    11001084
    11011085static HRESULT directSoundCaptureOpen(PDRVHOSTDSOUND pThis, PDSOUNDSTREAM pStreamDS,
     
    12591243}
    12601244
    1261 
    12621245static HRESULT directSoundCaptureStop(PDRVHOSTDSOUND pThis, PDSOUNDSTREAM pStreamDS, bool fFlush)
    12631246{
     
    12931276}
    12941277
    1295 
    12961278static HRESULT directSoundCaptureStart(PDRVHOSTDSOUND pThis, PDSOUNDSTREAM pStreamDS)
    12971279{
    1298     AssertPtrReturn(pThis,     VERR_INVALID_POINTER);
    1299     AssertPtrReturn(pStreamDS, VERR_INVALID_POINTER);
     1280    AssertPtrReturn(pThis,     E_POINTER);
     1281    AssertPtrReturn(pStreamDS, E_POINTER);
     1282
     1283    Assert(pStreamDS->fEnabled == false);
    13001284
    13011285    HRESULT hr;
     
    13241308                    pStreamDS->fEnabled = true;
    13251309
    1326                     pStreamDS->In.cOverruns = 0;
     1310                    pStreamDS->In.offReadPos = 0;
     1311                    pStreamDS->In.cOverruns  = 0;
    13271312                }
    13281313                else
     
    13341319        hr = E_UNEXPECTED;
    13351320
    1336     if (SUCCEEDED(hr))
    1337 
    1338 
    13391321    LogFlowFunc(("Returning %Rhrc\n", hr));
    13401322    return hr;
    13411323}
    1342 
    13431324
    13441325static int dsoundDevAdd(PRTLISTANCHOR pList, LPGUID pGUID, LPCWSTR pwszDescription, PDSOUNDDEV *ppDev)
     
    13681349}
    13691350
    1370 
    13711351static void dsoundDeviceRemove(PDSOUNDDEV pDev)
    13721352{
     
    13851365    }
    13861366}
    1387 
    13881367
    13891368static void dsoundLogDevice(const char *pszType, LPGUID pGUID, LPCWSTR pwszDescription, LPCWSTR pwszModule)
     
    13961375}
    13971376
    1398 
    13991377static BOOL CALLBACK dsoundDevicesEnumCbPlayback(LPGUID pGUID, LPCWSTR pwszDescription, LPCWSTR pwszModule, PVOID lpContext)
    14001378{
     
    14221400}
    14231401
    1424 
    14251402static BOOL CALLBACK dsoundDevicesEnumCbCapture(LPGUID pGUID, LPCWSTR pwszDescription, LPCWSTR pwszModule, PVOID lpContext)
    14261403{
     
    14441421    return TRUE;
    14451422}
    1446 
    14471423
    14481424/**
     
    15001476}
    15011477
    1502 
    15031478/**
    15041479 * Updates this host driver's internal status, according to the global, overall input/output
     
    15461521}
    15471522
    1548 
    15491523static void dsoundUpdateStatusInternal(PDRVHOSTDSOUND pThis)
    15501524{
    15511525    dsoundUpdateStatusInternalEx(pThis, NULL /* pCfg */, 0 /* fEnum */);
    15521526}
    1553 
    15541527
    15551528static int dsoundCreateStreamOut(PDRVHOSTDSOUND pThis, PDSOUNDSTREAM pStreamDS,
     
    15571530{
    15581531    LogFlowFunc(("pStreamDS=%p, pCfgReq=%p\n", pStreamDS, pCfgReq));
     1532
     1533    pStreamDS->cbBufSize = 0;
    15591534
    15601535    pStreamDS->Out.pDSB = NULL;
     
    15651540    pStreamDS->Out.fFirstPlayback = true;
    15661541    pStreamDS->Out.tsLastPlayMs = 0;
    1567     pStreamDS->cbBufSize = 0;
    15681542
    15691543    int rc = VINF_SUCCESS;
     
    16971671}
    16981672
    1699 
    17001673static int dsoundDestroyStreamOut(PDRVHOSTDSOUND pThis, PPDMAUDIOBACKENDSTREAM pStream)
    17011674{
     
    17221695
    17231696    /* Init the stream structure and save relevant information to it. */
     1697    pStreamDS->cbBufSize     = 0;
     1698
     1699    pStreamDS->In.pDSCB      = NULL;
    17241700    pStreamDS->In.offReadPos = 0;
    1725     pStreamDS->cbBufSize     = 0;
    1726     pStreamDS->In.pDSCB      = NULL;
     1701    pStreamDS->In.cOverruns  = 0;
    17271702
    17281703    int rc = VINF_SUCCESS;
     
    18591834    return VINF_SUCCESS;
    18601835}
    1861 
    18621836
    18631837/**
     
    22062180}
    22072181
    2208 
    22092182/**
    22102183 * @interface_method_impl{PDMIHOSTAUDIO,pfnInit}
     
    22592232}
    22602233
    2261 
    22622234static LPCGUID dsoundConfigQueryGUID(PCFGMNODE pCfg, const char *pszName, RTUUID *pUuid)
    22632235{
     
    22802252}
    22812253
    2282 
    22832254static int dsoundConfigInit(PDRVHOSTDSOUND pThis, PCFGMNODE pCfg)
    22842255{
     
    22982269}
    22992270
    2300 
    23012271/**
    23022272 * @interface_method_impl{PDMIHOSTAUDIO,pfnGetStatus}
     
    23092279    return PDMAUDIOBACKENDSTS_RUNNING;
    23102280}
    2311 
    23122281
    23132282/**
     
    23412310}
    23422311
    2343 
    23442312/**
    23452313 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDestroy}
     
    23712339}
    23722340
    2373 
    23742341/**
    23752342 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamControl}
     
    23962363}
    23972364
    2398 
    23992365/**
    24002366 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetReadable}
     
    24162382}
    24172383
    2418 
    24192384/**
    24202385 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetWritable}
     
    24322397    return 0;
    24332398}
    2434 
    24352399
    24362400/**
     
    24782442}
    24792443
    2480 
    24812444/**
    24822445 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetStatus}
     
    25062469    return strmSts;
    25072470}
    2508 
    25092471
    25102472/**
     
    25652527#endif
    25662528
    2567 
    25682529/*********************************************************************************************************************************
    25692530*   PDMDRVINS::IBase Interface                                                                                                   *
     
    25832544}
    25842545
    2585 
    25862546/*********************************************************************************************************************************
    25872547*   PDMDRVREG Interface                                                                                                          *
     
    26162576    LogFlowFuncLeave();
    26172577}
    2618 
    26192578
    26202579/**
Note: See TracChangeset for help on using the changeset viewer.

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