VirtualBox

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


Ignore:
Timestamp:
Jun 3, 2021 12:56:20 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144838
Message:

DrvHostAudioPulseAudio: Cleaned up function prefix and struct names. bugref:9890

File:
1 edited

Legend:

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

    r89423 r89482  
    5050*   Defines                                                                                                                      *
    5151*********************************************************************************************************************************/
    52 /** Max number of errors reported by drvHostAudioPaError per instance.
     52/** Max number of errors reported by drvHstAudPaError per instance.
    5353 * @todo Make this configurable thru driver config. */
    5454#define VBOX_PULSEAUDIO_MAX_LOG_REL_ERRORS  99
    5555
    5656
    57 /** @name PULSEAUDIOENUMCBFLAGS_XXX
     57/** @name DRVHSTAUDPAENUMCB_F_XXX
    5858 * @{ */
    5959/** No flags specified. */
    60 #define PULSEAUDIOENUMCBFLAGS_NONE          0
     60#define DRVHSTAUDPAENUMCB_F_NONE            0
    6161/** (Release) log found devices. */
    62 #define PULSEAUDIOENUMCBFLAGS_LOG           RT_BIT(0)
     62#define DRVHSTAUDPAENUMCB_F_LOG             RT_BIT(0)
    6363/** Only do default devices. */
    64 #define PULSEAUDIOENUMCBFLAGS_DEFAULT_ONLY  RT_BIT(1)
     64#define DRVHSTAUDPAENUMCB_F_DEFAULT_ONLY    RT_BIT(1)
    6565/** @} */
    6666
     
    7070*********************************************************************************************************************************/
    7171/** Pointer to the instance data for a pulse audio host audio driver. */
    72 typedef struct DRVHOSTPULSEAUDIO *PDRVHOSTPULSEAUDIO;
     72typedef struct DRVHSTAUDPA *PDRVHSTAUDPA;
    7373
    7474
     
    7676 * Callback context for the server init context state changed callback.
    7777 */
    78 typedef struct PULSEAUDIOSTATECHGCTX
     78typedef struct DRVHSTAUDPASTATECHGCTX
    7979{
    8080    /** The event semaphore. */
     
    8282    /** The returned context state. */
    8383    pa_context_state_t volatile enmCtxState;
    84 } PULSEAUDIOSTATECHGCTX;
     84} DRVHSTAUDPASTATECHGCTX;
    8585/** Pointer to a server init context state changed callback context. */
    86 typedef PULSEAUDIOSTATECHGCTX *PPULSEAUDIOSTATECHGCTX;
     86typedef DRVHSTAUDPASTATECHGCTX *PDRVHSTAUDPASTATECHGCTX;
    8787
    8888
     
    9090 * Enumeration callback context used by the pfnGetConfig code.
    9191 */
    92 typedef struct PULSEAUDIOENUMCBCTX
     92typedef struct DRVHSTAUDPAENUMCBCTX
    9393{
    9494    /** Pointer to PulseAudio's threaded main loop. */
    9595    pa_threaded_mainloop   *pMainLoop;
    96     /** Enumeration flags, PULSEAUDIOENUMCBFLAGS_XXX. */
     96    /** Enumeration flags, DRVHSTAUDPAENUMCB_F_XXX. */
    9797    uint32_t                fFlags;
    9898    /** VBox status code for the operation.
     
    106106    /** The device enumeration to fill, NULL if pfnGetConfig context.   */
    107107    PPDMAUDIOHOSTENUM       pDeviceEnum;
    108 } PULSEAUDIOENUMCBCTX;
     108} DRVHSTAUDPAENUMCBCTX;
    109109/** Pointer to an enumeration callback context. */
    110 typedef PULSEAUDIOENUMCBCTX *PPULSEAUDIOENUMCBCTX;
     110typedef DRVHSTAUDPAENUMCBCTX *PDRVHSTAUDPAENUMCBCTX;
    111111
    112112
     
    114114 * Pulse audio device enumeration entry.
    115115 */
    116 typedef struct PULSEAUDIODEVENTRY
     116typedef struct DRVHSTAUDPADEVENTRY
    117117{
    118118    /** The part we share with others. */
     
    123123    RT_FLEXIBLE_ARRAY_EXTENSION
    124124    char                    szPulseName[RT_FLEXIBLE_ARRAY];
    125 } PULSEAUDIODEVENTRY;
     125} DRVHSTAUDPADEVENTRY;
    126126/** Pointer to a pulse audio device enumeration entry. */
    127 typedef PULSEAUDIODEVENTRY *PPULSEAUDIODEVENTRY;
     127typedef DRVHSTAUDPADEVENTRY *PDRVHSTAUDPADEVENTRY;
    128128
    129129
     
    131131 * Pulse audio stream data.
    132132 */
    133 typedef struct PULSEAUDIOSTREAM
     133typedef struct DRVHSTAUDPASTREAM
    134134{
    135135    /** Common part. */
     
    138138    PDMAUDIOSTREAMCFG       Cfg;
    139139    /** Pointer to driver instance. */
    140     PDRVHOSTPULSEAUDIO      pDrv;
     140    PDRVHSTAUDPA      pDrv;
    141141    /** Pointer to opaque PulseAudio stream. */
    142142    pa_stream              *pStream;
     
    177177    /** Pulse playback and buffer metrics. */
    178178    pa_buffer_attr          BufAttr;
    179 } PULSEAUDIOSTREAM;
     179} DRVHSTAUDPASTREAM;
    180180/** Pointer to pulse audio stream data. */
    181 typedef PULSEAUDIOSTREAM *PPULSEAUDIOSTREAM;
     181typedef DRVHSTAUDPASTREAM *PDRVHSTAUDPASTREAM;
    182182
    183183
     
    186186 * @implements PDMIAUDIOCONNECTOR
    187187 */
    188 typedef struct DRVHOSTPULSEAUDIO
     188typedef struct DRVHSTAUDPA
    189189{
    190190    /** Pointer to the driver instance structure. */
     
    209209    char                    szStreamName[64];
    210210    /** Don't want to put this on the stack... */
    211     PULSEAUDIOSTATECHGCTX   InitStateChgCtx;
     211    DRVHSTAUDPASTATECHGCTX   InitStateChgCtx;
    212212    /** Pointer to host audio interface. */
    213213    PDMIHOSTAUDIO           IHostAudio;
    214 } DRVHOSTPULSEAUDIO;
     214} DRVHSTAUDPA;
    215215
    216216
     
    244244 * @param   rcPa    The error code to convert.
    245245 */
    246 static int drvHostAudioPaErrorToVBox(int rcPa)
     246static int drvHstAudPaErrorToVBox(int rcPa)
    247247{
    248248    /** @todo Implement some PulseAudio -> VBox mapping here. */
     
    260260 * @param   ...         Format string arguments.
    261261 */
    262 static int drvHostAudioPaError(PDRVHOSTPULSEAUDIO pThis, const char *pszFormat, ...)
     262static int drvHstAudPaError(PDRVHSTAUDPA pThis, const char *pszFormat, ...)
    263263{
    264264    AssertPtrReturn(pThis, VERR_INVALID_POINTER);
     
    266266
    267267    int const rcPa   = pa_context_errno(pThis->pContext);
    268     int const rcVBox = drvHostAudioPaErrorToVBox(rcPa);
     268    int const rcVBox = drvHstAudPaErrorToVBox(rcPa);
    269269
    270270    if (   pThis->cLogErrors < VBOX_PULSEAUDIO_MAX_LOG_REL_ERRORS
     
    288288 * mainloop might not have been entered yet.
    289289 */
    290 static void drvHostAudioPaSignalWaiter(PDRVHOSTPULSEAUDIO pThis)
     290static void drvHstAudPaSignalWaiter(PDRVHSTAUDPA pThis)
    291291{
    292292    if (pThis)
     
    301301 * Wrapper around pa_threaded_mainloop_wait().
    302302 */
    303 static void drvHostAudioPaMainloopWait(PDRVHOSTPULSEAUDIO pThis)
     303static void drvHstAudPaMainloopWait(PDRVHSTAUDPA pThis)
    304304{
    305305    /** @todo r=bird: explain this logic. */
     
    313313 * Pulse audio callback for context status changes, init variant.
    314314 */
    315 static void drvHostAudioPaCtxCallbackStateChanged(pa_context *pCtx, void *pvUser)
     315static void drvHstAudPaCtxCallbackStateChanged(pa_context *pCtx, void *pvUser)
    316316{
    317317    AssertPtrReturnVoid(pCtx);
    318318
    319     PDRVHOSTPULSEAUDIO pThis = (PDRVHOSTPULSEAUDIO)pvUser;
     319    PDRVHSTAUDPA pThis = (PDRVHSTAUDPA)pvUser;
    320320    AssertPtrReturnVoid(pThis);
    321321
     
    325325        case PA_CONTEXT_TERMINATED:
    326326        case PA_CONTEXT_FAILED:
    327             drvHostAudioPaSignalWaiter(pThis);
     327            drvHstAudPaSignalWaiter(pThis);
    328328            break;
    329329
     
    339339 * This will consume the pOperation reference.
    340340 */
    341 static int drvHostAudioPaWaitForEx(PDRVHOSTPULSEAUDIO pThis, pa_operation *pOperation, RTMSINTERVAL cMsTimeout)
     341static int drvHstAudPaWaitForEx(PDRVHSTAUDPA pThis, pa_operation *pOperation, RTMSINTERVAL cMsTimeout)
    342342{
    343343    AssertPtrReturn(pOperation, VERR_INVALID_POINTER);
     
    348348    {
    349349        if (!pThis->fAbortLoop) /** @todo r=bird: I do _not_ get the logic behind this fAbortLoop mechanism, it looks more
    350                                  * than a little mixed up and too much generalized see drvHostAudioPaSignalWaiter. */
     350                                 * than a little mixed up and too much generalized see drvHstAudPaSignalWaiter. */
    351351        {
    352352            AssertPtr(pThis->pMainLoop);
     
    384384
    385385
    386 static int drvHostAudioPaWaitFor(PDRVHOSTPULSEAUDIO pThis, pa_operation *pOP)
    387 {
    388     return drvHostAudioPaWaitForEx(pThis, pOP, 10 * RT_MS_1SEC);
     386static int drvHstAudPaWaitFor(PDRVHSTAUDPA pThis, pa_operation *pOP)
     387{
     388    return drvHstAudPaWaitForEx(pThis, pOP, 10 * RT_MS_1SEC);
    389389}
    390390
     
    396396
    397397/**
    398  * Worker for drvHostAudioPaEnumSourceCallback() and
    399  * drvHostAudioPaEnumSinkCallback() that adds an entry to the enumeration
     398 * Worker for drvHstAudPaEnumSourceCallback() and
     399 * drvHstAudPaEnumSinkCallback() that adds an entry to the enumeration
    400400 * result.
    401401 */
    402 static void drvHostAudioPaEnumAddDevice(PPULSEAUDIOENUMCBCTX pCbCtx, PDMAUDIODIR enmDir, const char *pszName,
     402static void drvHstAudPaEnumAddDevice(PDRVHSTAUDPAENUMCBCTX pCbCtx, PDMAUDIODIR enmDir, const char *pszName,
    403403                                        const char *pszDesc, uint8_t cChannelsInput, uint8_t cChannelsOutput,
    404404                                        const char *pszDefaultName)
    405405{
    406     size_t const cchName = strlen(pszName);
    407     PPULSEAUDIODEVENTRY pDev = (PPULSEAUDIODEVENTRY)PDMAudioHostDevAlloc(RT_UOFFSETOF(PULSEAUDIODEVENTRY, szPulseName)
    408                                                                          + RT_ALIGN_Z(cchName + 1, 16));
     406    size_t const         cchName = strlen(pszName);
     407    PDRVHSTAUDPADEVENTRY pDev    = (PDRVHSTAUDPADEVENTRY)PDMAudioHostDevAlloc(RT_UOFFSETOF(DRVHSTAUDPADEVENTRY, szPulseName)
     408                                                                            + RT_ALIGN_Z(cchName + 1, 16));
    409409    if (pDev != NULL)
    410410    {
     
    434434 * Enumeration callback - source info.
    435435 *
    436  * @param   pCtx        The context (DRVHOSTPULSEAUDIO::pContext).
     436 * @param   pCtx        The context (DRVHSTAUDPA::pContext).
    437437 * @param   pInfo       The info.  NULL when @a eol is not zero.
    438438 * @param   eol         Error-or-last indicator or something like that:
     
    440440 *                          -  1: End of list, no info.
    441441 *                          - -1: Error callback, no info.
    442  * @param   pvUserData  Pointer to our PULSEAUDIOENUMCBCTX structure.
    443  */
    444 static void drvHostAudioPaEnumSourceCallback(pa_context *pCtx, const pa_source_info *pInfo, int eol, void *pvUserData)
     442 * @param   pvUserData  Pointer to our DRVHSTAUDPAENUMCBCTX structure.
     443 */
     444static void drvHstAudPaEnumSourceCallback(pa_context *pCtx, const pa_source_info *pInfo, int eol, void *pvUserData)
    445445{
    446446    LogFlowFunc(("pCtx=%p pInfo=%p eol=%d pvUserData=%p\n", pCtx, pInfo, eol, pvUserData));
    447     PPULSEAUDIOENUMCBCTX pCbCtx = (PPULSEAUDIOENUMCBCTX)pvUserData;
     447    PDRVHSTAUDPAENUMCBCTX pCbCtx = (PDRVHSTAUDPAENUMCBCTX)pvUserData;
    448448    AssertPtrReturnVoid(pCbCtx);
    449449    Assert((pInfo == NULL) == (eol != 0));
     
    455455                 pInfo->index, pInfo->sample_spec.rate, pInfo->sample_spec.channels, pInfo->sample_spec.format,
    456456                 pInfo->name, pInfo->description, pInfo->driver, pInfo->flags));
    457         drvHostAudioPaEnumAddDevice(pCbCtx, PDMAUDIODIR_IN, pInfo->name, pInfo->description,
     457        drvHstAudPaEnumAddDevice(pCbCtx, PDMAUDIODIR_IN, pInfo->name, pInfo->description,
    458458                                    pInfo->sample_spec.channels, 0 /*cChannelsOutput*/, pCbCtx->pszDefaultSource);
    459459    }
     
    470470 * Enumeration callback - sink info.
    471471 *
    472  * @param   pCtx        The context (DRVHOSTPULSEAUDIO::pContext).
     472 * @param   pCtx        The context (DRVHSTAUDPA::pContext).
    473473 * @param   pInfo       The info.  NULL when @a eol is not zero.
    474474 * @param   eol         Error-or-last indicator or something like that:
     
    476476 *                          -  1: End of list, no info.
    477477 *                          - -1: Error callback, no info.
    478  * @param   pvUserData  Pointer to our PULSEAUDIOENUMCBCTX structure.
    479  */
    480 static void drvHostAudioPaEnumSinkCallback(pa_context *pCtx, const pa_sink_info *pInfo, int eol, void *pvUserData)
     478 * @param   pvUserData  Pointer to our DRVHSTAUDPAENUMCBCTX structure.
     479 */
     480static void drvHstAudPaEnumSinkCallback(pa_context *pCtx, const pa_sink_info *pInfo, int eol, void *pvUserData)
    481481{
    482482    LogFlowFunc(("pCtx=%p pInfo=%p eol=%d pvUserData=%p\n", pCtx, pInfo, eol, pvUserData));
    483     PPULSEAUDIOENUMCBCTX pCbCtx = (PPULSEAUDIOENUMCBCTX)pvUserData;
     483    PDRVHSTAUDPAENUMCBCTX pCbCtx = (PDRVHSTAUDPAENUMCBCTX)pvUserData;
    484484    AssertPtrReturnVoid(pCbCtx);
    485485    Assert((pInfo == NULL) == (eol != 0));
     
    491491                 pInfo->index, pInfo->sample_spec.rate, pInfo->sample_spec.channels, pInfo->sample_spec.format,
    492492                 pInfo->name, pInfo->description, pInfo->driver, pInfo->flags));
    493         drvHostAudioPaEnumAddDevice(pCbCtx, PDMAUDIODIR_OUT, pInfo->name, pInfo->description,
     493        drvHstAudPaEnumAddDevice(pCbCtx, PDMAUDIODIR_OUT, pInfo->name, pInfo->description,
    494494                                    0 /*cChannelsInput*/, pInfo->sample_spec.channels, pCbCtx->pszDefaultSink);
    495495    }
     
    508508 * Copy down the default names.
    509509 */
    510 static void drvHostAudioPaEnumServerCallback(pa_context *pCtx, const pa_server_info *pInfo, void *pvUserData)
     510static void drvHstAudPaEnumServerCallback(pa_context *pCtx, const pa_server_info *pInfo, void *pvUserData)
    511511{
    512512    LogFlowFunc(("pCtx=%p pInfo=%p pvUserData=%p\n", pCtx, pInfo, pvUserData));
    513     PPULSEAUDIOENUMCBCTX pCbCtx = (PPULSEAUDIOENUMCBCTX)pvUserData;
     513    PDRVHSTAUDPAENUMCBCTX pCbCtx = (PDRVHSTAUDPAENUMCBCTX)pvUserData;
    514514    AssertPtrReturnVoid(pCbCtx);
    515515    RT_NOREF(pCtx);
     
    551551 * @note Called with the PA main loop locked.
    552552 */
    553 static int drvHostAudioPaEnumerate(PDRVHOSTPULSEAUDIO pThis, uint32_t fEnum, PPDMAUDIOHOSTENUM pDeviceEnum)
    554 {
    555     PULSEAUDIOENUMCBCTX CbCtx        = { pThis->pMainLoop, fEnum, VERR_AUDIO_ENUMERATION_FAILED, NULL, NULL, pDeviceEnum };
    556     bool const          fLog         = (fEnum & PULSEAUDIOENUMCBFLAGS_LOG);
    557     bool const          fOnlyDefault = (fEnum & PULSEAUDIOENUMCBFLAGS_DEFAULT_ONLY);
    558     int                 rc;
     553static int drvHstAudPaEnumerate(PDRVHSTAUDPA pThis, uint32_t fEnum, PPDMAUDIOHOSTENUM pDeviceEnum)
     554{
     555    DRVHSTAUDPAENUMCBCTX CbCtx        = { pThis->pMainLoop, fEnum, VERR_AUDIO_ENUMERATION_FAILED, NULL, NULL, pDeviceEnum };
     556    bool const           fLog         = (fEnum & DRVHSTAUDPAENUMCB_F_LOG);
     557    bool const           fOnlyDefault = (fEnum & DRVHSTAUDPAENUMCB_F_DEFAULT_ONLY);
     558    int                  rc;
    559559
    560560    /*
     
    564564    LogRel(("PulseAudio: Retrieving server information ...\n"));
    565565    CbCtx.rcEnum = VERR_AUDIO_ENUMERATION_FAILED;
    566     pa_operation *paOpServerInfo = pa_context_get_server_info(pThis->pContext, drvHostAudioPaEnumServerCallback, &CbCtx);
     566    pa_operation *paOpServerInfo = pa_context_get_server_info(pThis->pContext, drvHstAudPaEnumServerCallback, &CbCtx);
    567567    if (paOpServerInfo)
    568         rc = drvHostAudioPaWaitFor(pThis, paOpServerInfo);
     568        rc = drvHstAudPaWaitFor(pThis, paOpServerInfo);
    569569    else
    570570    {
     
    593593        CbCtx.rcEnum = VERR_AUDIO_ENUMERATION_FAILED;
    594594        if (!fOnlyDefault)
    595             rc = drvHostAudioPaWaitFor(pThis,
    596                                        pa_context_get_sink_info_list(pThis->pContext, drvHostAudioPaEnumSinkCallback, &CbCtx));
     595            rc = drvHstAudPaWaitFor(pThis,
     596                                       pa_context_get_sink_info_list(pThis->pContext, drvHstAudPaEnumSinkCallback, &CbCtx));
    597597        else
    598             rc = drvHostAudioPaWaitFor(pThis, pa_context_get_sink_info_by_name(pThis->pContext, CbCtx.pszDefaultSink,
    599                                                                                drvHostAudioPaEnumSinkCallback, &CbCtx));
     598            rc = drvHstAudPaWaitFor(pThis, pa_context_get_sink_info_by_name(pThis->pContext, CbCtx.pszDefaultSink,
     599                                                                               drvHstAudPaEnumSinkCallback, &CbCtx));
    600600        if (RT_SUCCESS(rc))
    601601            rc = CbCtx.rcEnum;
     
    617617        int rc2;
    618618        if (!fOnlyDefault)
    619             rc2 = drvHostAudioPaWaitFor(pThis, pa_context_get_source_info_list(pThis->pContext,
    620                                                                                drvHostAudioPaEnumSourceCallback, &CbCtx));
     619            rc2 = drvHstAudPaWaitFor(pThis, pa_context_get_source_info_list(pThis->pContext,
     620                                                                               drvHstAudPaEnumSourceCallback, &CbCtx));
    621621        else
    622             rc2 = drvHostAudioPaWaitFor(pThis, pa_context_get_source_info_by_name(pThis->pContext, CbCtx.pszDefaultSource,
    623                                                                                   drvHostAudioPaEnumSourceCallback, &CbCtx));
     622            rc2 = drvHstAudPaWaitFor(pThis, pa_context_get_source_info_by_name(pThis->pContext, CbCtx.pszDefaultSource,
     623                                                                                  drvHstAudPaEnumSourceCallback, &CbCtx));
    624624        if (RT_SUCCESS(rc2))
    625625            rc2 = CbCtx.rcEnum;
     
    643643 * @interface_method_impl{PDMIHOSTAUDIO,pfnGetConfig}
    644644 */
    645 static DECLCALLBACK(int) drvHostAudioPaHA_GetConfig(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDCFG pBackendCfg)
    646 {
    647     PDRVHOSTPULSEAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVHOSTPULSEAUDIO, IHostAudio);
     645static DECLCALLBACK(int) drvHstAudPaHA_GetConfig(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDCFG pBackendCfg)
     646{
     647    PDRVHSTAUDPA pThis = RT_FROM_MEMBER(pInterface, DRVHSTAUDPA, IHostAudio);
    648648    AssertPtrReturn(pBackendCfg, VERR_INVALID_POINTER);
    649649
     
    652652     */
    653653    RTStrCopy(pBackendCfg->szName, sizeof(pBackendCfg->szName), "PulseAudio");
    654     pBackendCfg->cbStream       = sizeof(PULSEAUDIOSTREAM);
     654    pBackendCfg->cbStream       = sizeof(DRVHSTAUDPASTREAM);
    655655    pBackendCfg->fFlags         = 0;
    656656    pBackendCfg->cMaxStreamsOut = UINT32_MAX;
     
    664664    PDMAudioHostEnumInit(&DeviceEnum);
    665665    pa_threaded_mainloop_lock(pThis->pMainLoop);
    666     int rc = drvHostAudioPaEnumerate(pThis, PULSEAUDIOENUMCBFLAGS_DEFAULT_ONLY | PULSEAUDIOENUMCBFLAGS_LOG, &DeviceEnum);
     666    int rc = drvHstAudPaEnumerate(pThis, DRVHSTAUDPAENUMCB_F_DEFAULT_ONLY | DRVHSTAUDPAENUMCB_F_LOG, &DeviceEnum);
    667667    pa_threaded_mainloop_unlock(pThis->pMainLoop);
    668668    AssertRCReturn(rc, rc);
     
    679679 * @interface_method_impl{PDMIHOSTAUDIO,pfnGetDevices}
    680680 */
    681 static DECLCALLBACK(int) drvHostAudioPaHA_GetDevices(PPDMIHOSTAUDIO pInterface, PPDMAUDIOHOSTENUM pDeviceEnum)
    682 {
    683     PDRVHOSTPULSEAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVHOSTPULSEAUDIO, IHostAudio);
     681static DECLCALLBACK(int) drvHstAudPaHA_GetDevices(PPDMIHOSTAUDIO pInterface, PPDMAUDIOHOSTENUM pDeviceEnum)
     682{
     683    PDRVHSTAUDPA pThis = RT_FROM_MEMBER(pInterface, DRVHSTAUDPA, IHostAudio);
    684684    AssertPtrReturn(pDeviceEnum, VERR_INVALID_POINTER);
    685685    PDMAudioHostEnumInit(pDeviceEnum);
     
    687687    /* Refine it or something (currently only some LogRel2 stuff): */
    688688    pa_threaded_mainloop_lock(pThis->pMainLoop);
    689     int rc = drvHostAudioPaEnumerate(pThis, PULSEAUDIOENUMCBFLAGS_NONE, pDeviceEnum);
     689    int rc = drvHstAudPaEnumerate(pThis, DRVHSTAUDPAENUMCB_F_NONE, pDeviceEnum);
    690690    pa_threaded_mainloop_unlock(pThis->pMainLoop);
    691691    return rc;
     
    696696 * @interface_method_impl{PDMIHOSTAUDIO,pfnGetStatus}
    697697 */
    698 static DECLCALLBACK(PDMAUDIOBACKENDSTS) drvHostAudioPaHA_GetStatus(PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir)
     698static DECLCALLBACK(PDMAUDIOBACKENDSTS) drvHstAudPaHA_GetStatus(PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir)
    699699{
    700700    RT_NOREF(pInterface, enmDir);
     
    706706 * Stream status changed.
    707707 */
    708 static void drvHostAudioPaStreamStateChangedCallback(pa_stream *pStream, void *pvUser)
     708static void drvHstAudPaStreamStateChangedCallback(pa_stream *pStream, void *pvUser)
    709709{
    710710    AssertPtrReturnVoid(pStream);
    711711
    712     PDRVHOSTPULSEAUDIO pThis = (PDRVHOSTPULSEAUDIO)pvUser;
     712    PDRVHSTAUDPA pThis = (PDRVHSTAUDPA)pvUser;
    713713    AssertPtrReturnVoid(pThis);
    714714
     
    718718        case PA_STREAM_FAILED:
    719719        case PA_STREAM_TERMINATED:
    720             drvHostAudioPaSignalWaiter(pThis);
     720            drvHstAudPaSignalWaiter(pThis);
    721721            break;
    722722
     
    731731 * Debug PA callback: Need data to output.
    732732 */
    733 static void drvHostAudioPaStreamReqWriteDebugCallback(pa_stream *pStream, size_t cbLen, void *pvContext)
     733static void drvHstAudPaStreamReqWriteDebugCallback(pa_stream *pStream, size_t cbLen, void *pvContext)
    734734{
    735735    RT_NOREF(cbLen, pvContext);
     
    745745 * Debug PA callback: Underflow.  This may happen when draing/corking.
    746746 */
    747 static void drvHostAudioPaStreamUnderflowDebugCallback(pa_stream *pStream, void *pvContext)
    748 {
    749     PPULSEAUDIOSTREAM pStrm = (PPULSEAUDIOSTREAM)pvContext;
     747static void drvHstAudPaStreamUnderflowDebugCallback(pa_stream *pStream, void *pvContext)
     748{
     749    PDRVHSTAUDPASTREAM pStrm = (PDRVHSTAUDPASTREAM)pvContext;
    750750    AssertPtrReturnVoid(pStrm);
    751751
     
    794794 * Debug PA callback: Overflow.  This may happen when draing/corking.
    795795 */
    796 static void drvHostAudioPaStreamOverflowDebugCallback(pa_stream *pStream, void *pvContext)
     796static void drvHstAudPaStreamOverflowDebugCallback(pa_stream *pStream, void *pvContext)
    797797{
    798798    RT_NOREF(pStream, pvContext);
     
    811811 * @param   pProps      The PDM audio source properties.
    812812 */
    813 static pa_sample_format_t drvHostAudioPaPropsToPulse(PCPDMAUDIOPCMPROPS pProps)
     813static pa_sample_format_t drvHstAudPaPropsToPulse(PCPDMAUDIOPCMPROPS pProps)
    814814{
    815815    switch (PDMAudioPropsSampleSize(pProps))
     
    849849 * @param   uHz         The frequency.
    850850 */
    851 static int drvHostAudioPaToAudioProps(PPDMAUDIOPCMPROPS pProps, pa_sample_format_t enmPulseFmt, uint8_t cChannels, uint32_t uHz)
     851static int drvHstAudPaToAudioProps(PPDMAUDIOPCMPROPS pProps, pa_sample_format_t enmPulseFmt, uint8_t cChannels, uint32_t uHz)
    852852{
    853853    AssertReturn(cChannels > 0, VERR_INVALID_PARAMETER);
     
    901901 * @note    Caller owns the mainloop lock.
    902902 */
    903 static int drvHostAudioPaStreamCreateLocked(PDRVHOSTPULSEAUDIO pThis, PPULSEAUDIOSTREAM pStreamPA,
    904                                             const char *pszName, PPDMAUDIOSTREAMCFG pCfgAcq)
     903static int drvHstAudPaStreamCreateLocked(PDRVHSTAUDPA pThis, PDRVHSTAUDPASTREAM pStreamPA,
     904                                         const char *pszName, PPDMAUDIOSTREAMCFG pCfgAcq)
    905905{
    906906    /*
     
    919919     */
    920920#ifdef DEBUG
    921     pa_stream_set_write_callback(       pStream, drvHostAudioPaStreamReqWriteDebugCallback,  pStreamPA);
    922     pa_stream_set_underflow_callback(   pStream, drvHostAudioPaStreamUnderflowDebugCallback, pStreamPA);
     921    pa_stream_set_write_callback(       pStream, drvHstAudPaStreamReqWriteDebugCallback,  pStreamPA);
     922    pa_stream_set_underflow_callback(   pStream, drvHstAudPaStreamUnderflowDebugCallback, pStreamPA);
    923923    if (pCfgAcq->enmDir == PDMAUDIODIR_OUT)
    924         pa_stream_set_overflow_callback(pStream, drvHostAudioPaStreamOverflowDebugCallback,  pStreamPA);
     924        pa_stream_set_overflow_callback(pStream, drvHstAudPaStreamOverflowDebugCallback,  pStreamPA);
    925925#endif
    926     pa_stream_set_state_callback(       pStream, drvHostAudioPaStreamStateChangedCallback,   pThis);
     926    pa_stream_set_state_callback(       pStream, drvHstAudPaStreamStateChangedCallback,   pThis);
    927927
    928928    /*
     
    960960               && PA_STREAM_IS_GOOD(enmStreamState)
    961961               && RTTimeNanoTS() - nsStart < RT_NS_10SEC /* not really timed */ )
    962             drvHostAudioPaMainloopWait(pThis);
     962            drvHstAudPaMainloopWait(pThis);
    963963        if (enmStreamState == PA_STREAM_READY)
    964964        {
     
    984984                 *       modified since the caller converted it from pCfgReq.
    985985                 */
    986                 rc = drvHostAudioPaToAudioProps(&pCfgAcq->Props, pStreamPA->SampleSpec.format,
     986                rc = drvHstAudPaToAudioProps(&pCfgAcq->Props, pStreamPA->SampleSpec.format,
    987987                                                pStreamPA->SampleSpec.channels, pStreamPA->SampleSpec.rate);
    988988                if (RT_SUCCESS(rc))
     
    10931093 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamCreate}
    10941094 */
    1095 static DECLCALLBACK(int) drvHostAudioPaHA_StreamCreate(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
    1096                                                        PPDMAUDIOSTREAMCFG pCfgReq, PPDMAUDIOSTREAMCFG pCfgAcq)
    1097 {
    1098     PDRVHOSTPULSEAUDIO pThis     = RT_FROM_MEMBER(pInterface, DRVHOSTPULSEAUDIO, IHostAudio);
    1099     PPULSEAUDIOSTREAM  pStreamPA = (PPULSEAUDIOSTREAM)pStream;
     1095static DECLCALLBACK(int) drvHstAudPaHA_StreamCreate(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
     1096                                                    PPDMAUDIOSTREAMCFG pCfgReq, PPDMAUDIOSTREAMCFG pCfgAcq)
     1097{
     1098    PDRVHSTAUDPA        pThis     = RT_FROM_MEMBER(pInterface, DRVHSTAUDPA, IHostAudio);
     1099    PDRVHSTAUDPASTREAM  pStreamPA = (PDRVHSTAUDPASTREAM)pStream;
    11001100    AssertPtrReturn(pStreamPA, VERR_INVALID_POINTER);
    11011101    AssertPtrReturn(pCfgReq, VERR_INVALID_POINTER);
     
    11161116    pStreamPA->SampleSpec.rate     = PDMAudioPropsHz(&pCfgReq->Props);
    11171117    pStreamPA->SampleSpec.channels = PDMAudioPropsChannels(&pCfgReq->Props);
    1118     pStreamPA->SampleSpec.format   = drvHostAudioPaPropsToPulse(&pCfgReq->Props);
     1118    pStreamPA->SampleSpec.format   = drvHstAudPaPropsToPulse(&pCfgReq->Props);
    11191119
    11201120    /*
     
    11861186         */
    11871187        pa_threaded_mainloop_lock(pThis->pMainLoop);
    1188         rc = drvHostAudioPaStreamCreateLocked(pThis, pStreamPA, szName, pCfgAcq);
     1188        rc = drvHstAudPaStreamCreateLocked(pThis, pStreamPA, szName, pCfgAcq);
    11891189        pa_threaded_mainloop_unlock(pThis->pMainLoop);
    11901190        if (RT_SUCCESS(rc))
     
    12371237 * @note Caller has locked the mainloop.
    12381238 */
    1239 static void drvHostAudioPaStreamCancelAndReleaseOperations(PPULSEAUDIOSTREAM pStreamPA)
     1239static void drvHstAudPaStreamCancelAndReleaseOperations(PDRVHSTAUDPASTREAM pStreamPA)
    12401240{
    12411241    if (pStreamPA->pDrainOp)
     
    12681268 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDestroy}
    12691269 */
    1270 static DECLCALLBACK(int) drvHostAudioPaHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
    1271                                                         bool fImmediate)
    1272 {
    1273     PDRVHOSTPULSEAUDIO pThis     = RT_FROM_MEMBER(pInterface, DRVHOSTPULSEAUDIO, IHostAudio);
    1274     PPULSEAUDIOSTREAM  pStreamPA = (PPULSEAUDIOSTREAM)pStream;
     1270static DECLCALLBACK(int) drvHstAudPaHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, bool fImmediate)
     1271{
     1272    PDRVHSTAUDPA        pThis     = RT_FROM_MEMBER(pInterface, DRVHSTAUDPA, IHostAudio);
     1273    PDRVHSTAUDPASTREAM  pStreamPA = (PDRVHSTAUDPASTREAM)pStream;
    12751274    AssertPtrReturn(pStreamPA, VERR_INVALID_POINTER);
    12761275    RT_NOREF(fImmediate);
     
    12801279        pa_threaded_mainloop_lock(pThis->pMainLoop);
    12811280
    1282         drvHostAudioPaStreamCancelAndReleaseOperations(pStreamPA);
     1281        drvHstAudPaStreamCancelAndReleaseOperations(pStreamPA);
    12831282        pa_stream_disconnect(pStreamPA->pStream);
    12841283
     
    12971296 * @note This is fully async, so nobody is waiting for this.
    12981297 */
    1299 static void drvHostAudioPaStreamCorkUncorkCommon(PPULSEAUDIOSTREAM pStreamPA, int fSuccess, const char *pszOperation)
     1298static void drvHstAudPaStreamCorkUncorkCommon(PDRVHSTAUDPASTREAM pStreamPA, int fSuccess, const char *pszOperation)
    13001299{
    13011300    AssertPtrReturnVoid(pStreamPA);
     
    13031302
    13041303    if (!fSuccess)
    1305         drvHostAudioPaError(pStreamPA->pDrv, "%s stream '%s' failed", pszOperation, pStreamPA->Cfg.szName);
     1304        drvHstAudPaError(pStreamPA->pDrv, "%s stream '%s' failed", pszOperation, pStreamPA->Cfg.szName);
    13061305
    13071306    if (pStreamPA->pCorkOp)
     
    13161315 * Completion callback used with pa_stream_cork(,false,).
    13171316 */
    1318 static void drvHostAudioPaStreamUncorkCompletionCallback(pa_stream *pStream, int fSuccess, void *pvUser)
     1317static void drvHstAudPaStreamUncorkCompletionCallback(pa_stream *pStream, int fSuccess, void *pvUser)
    13191318{
    13201319    RT_NOREF(pStream);
    1321     drvHostAudioPaStreamCorkUncorkCommon((PPULSEAUDIOSTREAM)pvUser, fSuccess, "Uncorking");
     1320    drvHstAudPaStreamCorkUncorkCommon((PDRVHSTAUDPASTREAM)pvUser, fSuccess, "Uncorking");
    13221321}
    13231322
     
    13261325 * Completion callback used with pa_stream_cork(,true,).
    13271326 */
    1328 static void drvHostAudioPaStreamCorkCompletionCallback(pa_stream *pStream, int fSuccess, void *pvUser)
     1327static void drvHstAudPaStreamCorkCompletionCallback(pa_stream *pStream, int fSuccess, void *pvUser)
    13291328{
    13301329    RT_NOREF(pStream);
    1331     drvHostAudioPaStreamCorkUncorkCommon((PPULSEAUDIOSTREAM)pvUser, fSuccess, "Corking");
     1330    drvHstAudPaStreamCorkUncorkCommon((PDRVHSTAUDPASTREAM)pvUser, fSuccess, "Corking");
    13321331}
    13331332
     
    13361335 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
    13371336 */
    1338 static DECLCALLBACK(int) drvHostAudioPaHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    1339 {
    1340     PDRVHOSTPULSEAUDIO pThis     = RT_FROM_MEMBER(pInterface, DRVHOSTPULSEAUDIO, IHostAudio);
    1341     PPULSEAUDIOSTREAM  pStreamPA = (PPULSEAUDIOSTREAM)pStream;
     1337static DECLCALLBACK(int) drvHstAudPaHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     1338{
     1339    PDRVHSTAUDPA        pThis     = RT_FROM_MEMBER(pInterface, DRVHSTAUDPA, IHostAudio);
     1340    PDRVHSTAUDPASTREAM  pStreamPA = (PDRVHSTAUDPASTREAM)pStream;
    13421341    LogFlowFunc(("\n"));
    13431342
     
    13471346    pa_threaded_mainloop_lock(pThis->pMainLoop);
    13481347
    1349     drvHostAudioPaStreamCancelAndReleaseOperations(pStreamPA);
     1348    drvHstAudPaStreamCancelAndReleaseOperations(pStreamPA);
    13501349    pStreamPA->pCorkOp = pa_stream_cork(pStreamPA->pStream, 0 /*uncork it*/,
    1351                                         drvHostAudioPaStreamUncorkCompletionCallback, pStreamPA);
     1350                                        drvHstAudPaStreamUncorkCompletionCallback, pStreamPA);
    13521351    LogFlowFunc(("Uncorking '%s': %p (async)\n", pStreamPA->Cfg.szName, pStreamPA->pCorkOp));
    13531352    int const rc = pStreamPA->pCorkOp ? VINF_SUCCESS
    1354                  : drvHostAudioPaError(pThis, "pa_stream_cork('%s', 0 /*uncork it*/,,) failed", pStreamPA->Cfg.szName);
     1353                 : drvHstAudPaError(pThis, "pa_stream_cork('%s', 0 /*uncork it*/,,) failed", pStreamPA->Cfg.szName);
    13551354
    13561355
     
    13651364 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable}
    13661365 */
    1367 static DECLCALLBACK(int) drvHostAudioPaHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    1368 {
    1369     PDRVHOSTPULSEAUDIO pThis     = RT_FROM_MEMBER(pInterface, DRVHOSTPULSEAUDIO, IHostAudio);
    1370     PPULSEAUDIOSTREAM  pStreamPA = (PPULSEAUDIOSTREAM)pStream;
     1366static DECLCALLBACK(int) drvHstAudPaHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     1367{
     1368    PDRVHSTAUDPA        pThis     = RT_FROM_MEMBER(pInterface, DRVHSTAUDPA, IHostAudio);
     1369    PDRVHSTAUDPASTREAM  pStreamPA = (PDRVHSTAUDPASTREAM)pStream;
    13711370    LogFlowFunc(("\n"));
    13721371
     
    14091408     * Cork (pause playback/capture) the stream.
    14101409     */
    1411     drvHostAudioPaStreamCancelAndReleaseOperations(pStreamPA);
     1410    drvHstAudPaStreamCancelAndReleaseOperations(pStreamPA);
    14121411    pStreamPA->pCorkOp = pa_stream_cork(pStreamPA->pStream, 1 /* cork it */,
    1413                                         drvHostAudioPaStreamCorkCompletionCallback, pStreamPA);
     1412                                        drvHstAudPaStreamCorkCompletionCallback, pStreamPA);
    14141413    LogFlowFunc(("Corking '%s': %p (async)\n", pStreamPA->Cfg.szName, pStreamPA->pCorkOp));
    14151414    int const rc = pStreamPA->pCorkOp ? VINF_SUCCESS
    1416                  : drvHostAudioPaError(pThis, "pa_stream_cork('%s', 1 /*cork*/,,) failed", pStreamPA->Cfg.szName);
     1415                 : drvHstAudPaError(pThis, "pa_stream_cork('%s', 1 /*cork*/,,) failed", pStreamPA->Cfg.szName);
    14171416
    14181417    pa_threaded_mainloop_unlock(pThis->pMainLoop);
     
    14251424 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause}
    14261425 */
    1427 static DECLCALLBACK(int) drvHostAudioPaHA_StreamPause(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     1426static DECLCALLBACK(int) drvHstAudPaHA_StreamPause(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    14281427{
    14291428    /* Same as disable. */
    1430     return drvHostAudioPaHA_StreamDisable(pInterface, pStream);
     1429    return drvHstAudPaHA_StreamDisable(pInterface, pStream);
    14311430}
    14321431
     
    14351434 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume}
    14361435 */
    1437 static DECLCALLBACK(int) drvHostAudioPaHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     1436static DECLCALLBACK(int) drvHstAudPaHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    14381437{
    14391438    /* Same as enable. */
    1440     return drvHostAudioPaHA_StreamEnable(pInterface, pStream);
     1439    return drvHstAudPaHA_StreamEnable(pInterface, pStream);
    14411440}
    14421441
     
    14461445 * @note This is fully async, so nobody is waiting for this.
    14471446 */
    1448 static void drvHostAudioPaStreamDrainCompletionCallback(pa_stream *pStream, int fSuccess, void *pvUser)
    1449 {
    1450     PPULSEAUDIOSTREAM pStreamPA = (PPULSEAUDIOSTREAM)pvUser;
     1447static void drvHstAudPaStreamDrainCompletionCallback(pa_stream *pStream, int fSuccess, void *pvUser)
     1448{
     1449    PDRVHSTAUDPASTREAM pStreamPA = (PDRVHSTAUDPASTREAM)pvUser;
    14511450    AssertPtrReturnVoid(pStreamPA);
    14521451    Assert(pStreamPA->pStream == pStream);
     
    14541453
    14551454    if (!fSuccess)
    1456         drvHostAudioPaError(pStreamPA->pDrv, "Draining stream '%s' failed", pStreamPA->Cfg.szName);
     1455        drvHstAudPaError(pStreamPA->pDrv, "Draining stream '%s' failed", pStreamPA->Cfg.szName);
    14571456
    14581457    /* Now cork the stream (doing it unconditionally atm). */
     
    14651464    }
    14661465
    1467     pStreamPA->pCorkOp = pa_stream_cork(pStream, 1 /* cork it*/, drvHostAudioPaStreamCorkCompletionCallback, pStreamPA);
     1466    pStreamPA->pCorkOp = pa_stream_cork(pStream, 1 /* cork it*/, drvHstAudPaStreamCorkCompletionCallback, pStreamPA);
    14681467    if (pStreamPA->pCorkOp)
    14691468        LogFlowFunc(("Started cork operation %p of %s (following drain)\n", pStreamPA->pCorkOp, pStreamPA->Cfg.szName));
    14701469    else
    1471         drvHostAudioPaError(pStreamPA->pDrv, "pa_stream_cork failed on '%s' (following drain)", pStreamPA->Cfg.szName);
     1470        drvHstAudPaError(pStreamPA->pDrv, "pa_stream_cork failed on '%s' (following drain)", pStreamPA->Cfg.szName);
    14721471}
    14731472
     
    14761475 * Callback used with pa_stream_tigger(), starts draining.
    14771476 */
    1478 static void drvHostAudioPaStreamTriggerCompletionCallback(pa_stream *pStream, int fSuccess, void *pvUser)
    1479 {
    1480     PPULSEAUDIOSTREAM pStreamPA = (PPULSEAUDIOSTREAM)pvUser;
     1477static void drvHstAudPaStreamTriggerCompletionCallback(pa_stream *pStream, int fSuccess, void *pvUser)
     1478{
     1479    PDRVHSTAUDPASTREAM pStreamPA = (PDRVHSTAUDPASTREAM)pvUser;
    14811480    AssertPtrReturnVoid(pStreamPA);
    14821481    RT_NOREF(pStream);
     
    14841483
    14851484    if (!fSuccess)
    1486         drvHostAudioPaError(pStreamPA->pDrv, "Forcing playback before drainig '%s' failed", pStreamPA->Cfg.szName);
     1485        drvHstAudPaError(pStreamPA->pDrv, "Forcing playback before drainig '%s' failed", pStreamPA->Cfg.szName);
    14871486
    14881487    if (pStreamPA->pTriggerOp)
     
    14971496 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain}
    14981497 */
    1499 static DECLCALLBACK(int) drvHostAudioPaHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    1500 {
    1501     PDRVHOSTPULSEAUDIO pThis     = RT_FROM_MEMBER(pInterface, DRVHOSTPULSEAUDIO, IHostAudio);
    1502     PPULSEAUDIOSTREAM  pStreamPA = (PPULSEAUDIOSTREAM)pStream;
     1498static DECLCALLBACK(int) drvHstAudPaHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     1499{
     1500    PDRVHSTAUDPA        pThis     = RT_FROM_MEMBER(pInterface, DRVHSTAUDPA, IHostAudio);
     1501    PDRVHSTAUDPASTREAM  pStreamPA = (PDRVHSTAUDPASTREAM)pStream;
    15031502    AssertReturn(pStreamPA->Cfg.enmDir == PDMAUDIODIR_OUT, VERR_INVALID_PARAMETER);
    15041503    LogFlowFunc(("\n"));
     
    15391538            pa_operation_unref(pStreamPA->pTriggerOp);
    15401539        }
    1541         pStreamPA->pTriggerOp = pa_stream_trigger(pStreamPA->pStream, drvHostAudioPaStreamTriggerCompletionCallback, pStreamPA);
     1540        pStreamPA->pTriggerOp = pa_stream_trigger(pStreamPA->pStream, drvHstAudPaStreamTriggerCompletionCallback, pStreamPA);
    15421541        if (pStreamPA->pTriggerOp)
    15431542            LogFlowFunc(("Started tigger operation %p on %s\n", pStreamPA->pTriggerOp, pStreamPA->Cfg.szName));
    15441543        else
    1545             rc = drvHostAudioPaError(pStreamPA->pDrv, "pa_stream_trigger failed on '%s'", pStreamPA->Cfg.szName);
     1544            rc = drvHstAudPaError(pStreamPA->pDrv, "pa_stream_trigger failed on '%s'", pStreamPA->Cfg.szName);
    15461545    }
    15471546
     
    15491548     * Initiate the draining (async), will cork the stream when it completes.
    15501549     */
    1551     pStreamPA->pDrainOp = pa_stream_drain(pStreamPA->pStream, drvHostAudioPaStreamDrainCompletionCallback, pStreamPA);
     1550    pStreamPA->pDrainOp = pa_stream_drain(pStreamPA->pStream, drvHstAudPaStreamDrainCompletionCallback, pStreamPA);
    15521551    if (pStreamPA->pDrainOp)
    15531552        LogFlowFunc(("Started drain operation %p of %s\n", pStreamPA->pDrainOp, pStreamPA->Cfg.szName));
    15541553    else
    1555         rc = drvHostAudioPaError(pStreamPA->pDrv, "pa_stream_drain failed on '%s'", pStreamPA->Cfg.szName);
     1554        rc = drvHstAudPaError(pStreamPA->pDrv, "pa_stream_drain failed on '%s'", pStreamPA->Cfg.szName);
    15561555
    15571556    pa_threaded_mainloop_unlock(pThis->pMainLoop);
     
    15641563 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamControl}
    15651564 */
    1566 static DECLCALLBACK(int) drvHostAudioPaHA_StreamControl(PPDMIHOSTAUDIO pInterface,
    1567                                                         PPDMAUDIOBACKENDSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd)
     1565static DECLCALLBACK(int) drvHstAudPaHA_StreamControl(PPDMIHOSTAUDIO pInterface,
     1566                                                     PPDMAUDIOBACKENDSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd)
    15681567{
    15691568    /** @todo r=bird: I'd like to get rid of this pfnStreamControl method,
     
    15741573    {
    15751574        case PDMAUDIOSTREAMCMD_ENABLE:
    1576             return drvHostAudioPaHA_StreamEnable(pInterface, pStream);
     1575            return drvHstAudPaHA_StreamEnable(pInterface, pStream);
    15771576        case PDMAUDIOSTREAMCMD_DISABLE:
    1578             return drvHostAudioPaHA_StreamDisable(pInterface, pStream);
     1577            return drvHstAudPaHA_StreamDisable(pInterface, pStream);
    15791578        case PDMAUDIOSTREAMCMD_PAUSE:
    1580             return drvHostAudioPaHA_StreamPause(pInterface, pStream);
     1579            return drvHstAudPaHA_StreamPause(pInterface, pStream);
    15811580        case PDMAUDIOSTREAMCMD_RESUME:
    1582             return drvHostAudioPaHA_StreamResume(pInterface, pStream);
     1581            return drvHstAudPaHA_StreamResume(pInterface, pStream);
    15831582        case PDMAUDIOSTREAMCMD_DRAIN:
    1584             return drvHostAudioPaHA_StreamDrain(pInterface, pStream);
     1583            return drvHstAudPaHA_StreamDrain(pInterface, pStream);
    15851584
    15861585        case PDMAUDIOSTREAMCMD_END:
     
    15971596 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetReadable}
    15981597 */
    1599 static DECLCALLBACK(uint32_t) drvHostAudioPaHA_StreamGetReadable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    1600 {
    1601     PDRVHOSTPULSEAUDIO  pThis      = RT_FROM_MEMBER(pInterface, DRVHOSTPULSEAUDIO, IHostAudio);
    1602     PPULSEAUDIOSTREAM   pStreamPA  = (PPULSEAUDIOSTREAM)pStream;
     1598static DECLCALLBACK(uint32_t) drvHstAudPaHA_StreamGetReadable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     1599{
     1600    PDRVHSTAUDPA        pThis      = RT_FROM_MEMBER(pInterface, DRVHSTAUDPA, IHostAudio);
     1601    PDRVHSTAUDPASTREAM  pStreamPA  = (PDRVHSTAUDPASTREAM)pStream;
    16031602    uint32_t            cbReadable = 0;
    16041603    if (pStreamPA->Cfg.enmDir == PDMAUDIODIR_IN)
     
    16131612                cbReadable = (uint32_t)cbReadablePa;
    16141613            else
    1615                 drvHostAudioPaError(pThis, "pa_stream_readable_size failed on '%s'", pStreamPA->Cfg.szName);
     1614                drvHstAudPaError(pThis, "pa_stream_readable_size failed on '%s'", pStreamPA->Cfg.szName);
    16161615        }
    16171616        else
     
    16281627 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetWritable}
    16291628 */
    1630 static DECLCALLBACK(uint32_t) drvHostAudioPaHA_StreamGetWritable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    1631 {
    1632     PDRVHOSTPULSEAUDIO  pThis      = RT_FROM_MEMBER(pInterface, DRVHOSTPULSEAUDIO, IHostAudio);
    1633     PPULSEAUDIOSTREAM   pStreamPA  = (PPULSEAUDIOSTREAM)pStream;
     1629static DECLCALLBACK(uint32_t) drvHstAudPaHA_StreamGetWritable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     1630{
     1631    PDRVHSTAUDPA        pThis      = RT_FROM_MEMBER(pInterface, DRVHSTAUDPA, IHostAudio);
     1632    PDRVHSTAUDPASTREAM  pStreamPA  = (PDRVHSTAUDPASTREAM)pStream;
    16341633    uint32_t            cbWritable = 0;
    16351634    if (pStreamPA->Cfg.enmDir == PDMAUDIODIR_OUT)
     
    16441643                cbWritable = cbWritablePa <= UINT32_MAX ? (uint32_t)cbWritablePa : UINT32_MAX;
    16451644            else
    1646                 drvHostAudioPaError(pThis, "pa_stream_writable_size failed on '%s'", pStreamPA->Cfg.szName);
     1645                drvHstAudPaError(pThis, "pa_stream_writable_size failed on '%s'", pStreamPA->Cfg.szName);
    16471646        }
    16481647        else
     
    16601659 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetState}
    16611660 */
    1662 static DECLCALLBACK(PDMHOSTAUDIOSTREAMSTATE) drvHostAudioPaHA_StreamGetState(PPDMIHOSTAUDIO pInterface,
    1663                                                                              PPDMAUDIOBACKENDSTREAM pStream)
    1664 {
    1665     PDRVHOSTPULSEAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVHOSTPULSEAUDIO, IHostAudio);
     1661static DECLCALLBACK(PDMHOSTAUDIOSTREAMSTATE) drvHstAudPaHA_StreamGetState(PPDMIHOSTAUDIO pInterface,
     1662                                                                          PPDMAUDIOBACKENDSTREAM pStream)
     1663{
     1664    PDRVHSTAUDPA        pThis     = RT_FROM_MEMBER(pInterface, DRVHSTAUDPA, IHostAudio);
    16661665    AssertPtrReturn(pStream, PDMHOSTAUDIOSTREAMSTATE_INVALID);
    1667     PPULSEAUDIOSTREAM  pStreamPA = (PPULSEAUDIOSTREAM)pStream;
     1666    PDRVHSTAUDPASTREAM  pStreamPA = (PDRVHSTAUDPASTREAM)pStream;
    16681667    AssertPtrReturn(pStreamPA, PDMHOSTAUDIOSTREAMSTATE_INVALID);
    16691668
     
    17061705 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPlay}
    17071706 */
    1708 static DECLCALLBACK(int) drvHostAudioPaHA_StreamPlay(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
    1709                                                      const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten)
    1710 {
    1711     PDRVHOSTPULSEAUDIO pThis     = RT_FROM_MEMBER(pInterface, DRVHOSTPULSEAUDIO, IHostAudio);
    1712     PPULSEAUDIOSTREAM  pStreamPA = (PPULSEAUDIOSTREAM)pStream;
     1707static DECLCALLBACK(int) drvHstAudPaHA_StreamPlay(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
     1708                                                  const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten)
     1709{
     1710    PDRVHSTAUDPA        pThis     = RT_FROM_MEMBER(pInterface, DRVHSTAUDPA, IHostAudio);
     1711    PDRVHSTAUDPASTREAM  pStreamPA = (PDRVHSTAUDPASTREAM)pStream;
    17131712    AssertPtrReturn(pStreamPA, VERR_INVALID_POINTER);
    17141713    AssertPtrReturn(pcbWritten, VERR_INVALID_POINTER);
     
    17551754            else
    17561755            {
    1757                 rc = drvHostAudioPaError(pStreamPA->pDrv, "Failed to write to output stream");
     1756                rc = drvHstAudPaError(pStreamPA->pDrv, "Failed to write to output stream");
    17581757                break;
    17591758            }
     
    17621761        {
    17631762            if (cbWriteable == (size_t)-1)
    1764                 rc = drvHostAudioPaError(pStreamPA->pDrv, "pa_stream_writable_size failed on '%s'", pStreamPA->Cfg.szName);
     1763                rc = drvHstAudPaError(pStreamPA->pDrv, "pa_stream_writable_size failed on '%s'", pStreamPA->Cfg.szName);
    17651764            break;
    17661765        }
     
    17851784 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamCapture}
    17861785 */
    1787 static DECLCALLBACK(int) drvHostAudioPaHA_StreamCapture(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
    1788                                                         void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead)
    1789 {
    1790     PDRVHOSTPULSEAUDIO pThis     = RT_FROM_MEMBER(pInterface, DRVHOSTPULSEAUDIO, IHostAudio);
    1791     PPULSEAUDIOSTREAM  pStreamPA = (PPULSEAUDIOSTREAM)pStream;
     1786static DECLCALLBACK(int) drvHstAudPaHA_StreamCapture(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
     1787                                                     void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead)
     1788{
     1789    PDRVHSTAUDPA        pThis     = RT_FROM_MEMBER(pInterface, DRVHSTAUDPA, IHostAudio);
     1790    PDRVHSTAUDPASTREAM  pStreamPA = (PDRVHSTAUDPASTREAM)pStream;
    17921791    AssertPtrReturn(pStreamPA, VERR_INVALID_POINTER);
    17931792    AssertPtrReturn(pvBuf, VERR_INVALID_POINTER);
     
    19061905            else
    19071906            {
    1908                 rc = drvHostAudioPaError(pStreamPA->pDrv, "pa_stream_peek failed on '%s' (%d)", pStreamPA->Cfg.szName, rcPa);
     1907                rc = drvHstAudPaError(pStreamPA->pDrv, "pa_stream_peek failed on '%s' (%d)", pStreamPA->Cfg.szName, rcPa);
    19091908                pStreamPA->pbPeekBuf  = NULL;
    19101909                pStreamPA->cbPeekBuf  = 0;
     
    19151914        {
    19161915            if (cbAvail != (size_t)-1)
    1917                 rc = drvHostAudioPaError(pStreamPA->pDrv, "pa_stream_readable_size failed on '%s'", pStreamPA->Cfg.szName);
     1916                rc = drvHstAudPaError(pStreamPA->pDrv, "pa_stream_readable_size failed on '%s'", pStreamPA->Cfg.szName);
    19181917            break;
    19191918        }
     
    19421941 * @interface_method_impl{PDMIBASE,pfnQueryInterface}
    19431942 */
    1944 static DECLCALLBACK(void *) drvHostAudioPaQueryInterface(PPDMIBASE pInterface, const char *pszIID)
     1943static DECLCALLBACK(void *) drvHstAudPaQueryInterface(PPDMIBASE pInterface, const char *pszIID)
    19451944{
    19461945    AssertPtrReturn(pInterface, NULL);
    19471946    AssertPtrReturn(pszIID, NULL);
    19481947
    1949     PPDMDRVINS pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
    1950     PDRVHOSTPULSEAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPULSEAUDIO);
     1948    PPDMDRVINS   pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
     1949    PDRVHSTAUDPA pThis   = PDMINS_2_DATA(pDrvIns, PDRVHSTAUDPA);
    19511950    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase);
    19521951    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIHOSTAUDIO, &pThis->IHostAudio);
     
    19651964 * @copydoc FNPDMDRVDESTRUCT
    19661965 */
    1967 static DECLCALLBACK(void) drvHostAudioPaDestruct(PPDMDRVINS pDrvIns)
     1966static DECLCALLBACK(void) drvHstAudPaDestruct(PPDMDRVINS pDrvIns)
    19681967{
    19691968    PDMDRV_CHECK_VERSIONS_RETURN_VOID(pDrvIns);
    1970     PDRVHOSTPULSEAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPULSEAUDIO);
     1969    PDRVHSTAUDPA pThis = PDMINS_2_DATA(pDrvIns, PDRVHSTAUDPA);
    19711970    LogFlowFuncEnter();
    19721971
     
    19951994 *
    19961995 * Signalls our event semaphore so we can do a timed wait from
    1997  * drvHostAudioPaConstruct().
    1998  */
    1999 static void drvHostAudioPaCtxCallbackStateChangedInit(pa_context *pCtx, void *pvUser)
     1996 * drvHstAudPaConstruct().
     1997 */
     1998static void drvHstAudPaCtxCallbackStateChangedInit(pa_context *pCtx, void *pvUser)
    20001999{
    20012000    AssertPtrReturnVoid(pCtx);
    2002     PPULSEAUDIOSTATECHGCTX pStateChgCtx = (PPULSEAUDIOSTATECHGCTX)pvUser;
     2001    PDRVHSTAUDPASTATECHGCTX pStateChgCtx = (PDRVHSTAUDPASTATECHGCTX)pvUser;
    20032002    pa_context_state_t     enmCtxState  = pa_context_get_state(pCtx);
    20042003    switch (enmCtxState)
     
    20232022 * @copydoc FNPDMDRVCONSTRUCT
    20242023 */
    2025 static DECLCALLBACK(int) drvHostAudioPaConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
     2024static DECLCALLBACK(int) drvHstAudPaConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
    20262025{
    20272026    RT_NOREF(pCfg, fFlags);
    20282027    PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
    2029     PDRVHOSTPULSEAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTPULSEAUDIO);
     2028    PDRVHSTAUDPA pThis = PDMINS_2_DATA(pDrvIns, PDRVHSTAUDPA);
    20302029    LogRel(("Audio: Initializing PulseAudio driver\n"));
    20312030
     
    20352034    pThis->pDrvIns                   = pDrvIns;
    20362035    /* IBase */
    2037     pDrvIns->IBase.pfnQueryInterface = drvHostAudioPaQueryInterface;
     2036    pDrvIns->IBase.pfnQueryInterface = drvHstAudPaQueryInterface;
    20382037    /* IHostAudio */
    2039     pThis->IHostAudio.pfnGetConfig                  = drvHostAudioPaHA_GetConfig;
    2040     pThis->IHostAudio.pfnGetDevices                 = drvHostAudioPaHA_GetDevices;
     2038    pThis->IHostAudio.pfnGetConfig                  = drvHstAudPaHA_GetConfig;
     2039    pThis->IHostAudio.pfnGetDevices                 = drvHstAudPaHA_GetDevices;
    20412040    pThis->IHostAudio.pfnSetDevice                  = NULL;
    2042     pThis->IHostAudio.pfnGetStatus                  = drvHostAudioPaHA_GetStatus;
     2041    pThis->IHostAudio.pfnGetStatus                  = drvHstAudPaHA_GetStatus;
    20432042    pThis->IHostAudio.pfnDoOnWorkerThread           = NULL;
    20442043    pThis->IHostAudio.pfnStreamConfigHint           = NULL;
    2045     pThis->IHostAudio.pfnStreamCreate               = drvHostAudioPaHA_StreamCreate;
     2044    pThis->IHostAudio.pfnStreamCreate               = drvHstAudPaHA_StreamCreate;
    20462045    pThis->IHostAudio.pfnStreamInitAsync            = NULL;
    2047     pThis->IHostAudio.pfnStreamDestroy              = drvHostAudioPaHA_StreamDestroy;
     2046    pThis->IHostAudio.pfnStreamDestroy              = drvHstAudPaHA_StreamDestroy;
    20482047    pThis->IHostAudio.pfnStreamNotifyDeviceChanged  = NULL;
    2049     pThis->IHostAudio.pfnStreamControl              = drvHostAudioPaHA_StreamControl;
    2050     pThis->IHostAudio.pfnStreamGetReadable          = drvHostAudioPaHA_StreamGetReadable;
    2051     pThis->IHostAudio.pfnStreamGetWritable          = drvHostAudioPaHA_StreamGetWritable;
     2048    pThis->IHostAudio.pfnStreamControl              = drvHstAudPaHA_StreamControl;
     2049    pThis->IHostAudio.pfnStreamGetReadable          = drvHstAudPaHA_StreamGetReadable;
     2050    pThis->IHostAudio.pfnStreamGetWritable          = drvHstAudPaHA_StreamGetWritable;
    20522051    pThis->IHostAudio.pfnStreamGetPending           = NULL;
    2053     pThis->IHostAudio.pfnStreamGetState             = drvHostAudioPaHA_StreamGetState;
    2054     pThis->IHostAudio.pfnStreamPlay                 = drvHostAudioPaHA_StreamPlay;
    2055     pThis->IHostAudio.pfnStreamCapture              = drvHostAudioPaHA_StreamCapture;
     2052    pThis->IHostAudio.pfnStreamGetState             = drvHstAudPaHA_StreamGetState;
     2053    pThis->IHostAudio.pfnStreamPlay                 = drvHstAudPaHA_StreamPlay;
     2054    pThis->IHostAudio.pfnStreamCapture              = drvHstAudPaHA_StreamCapture;
    20562055
    20572056    /*
     
    21092108
    21102109    pa_threaded_mainloop_lock(pThis->pMainLoop);
    2111     pa_context_set_state_callback(pThis->pContext, drvHostAudioPaCtxCallbackStateChangedInit, &pThis->InitStateChgCtx);
     2110    pa_context_set_state_callback(pThis->pContext, drvHstAudPaCtxCallbackStateChangedInit, &pThis->InitStateChgCtx);
    21122111    if (!pa_context_connect(pThis->pContext, NULL /* pszServer */, PA_CONTEXT_NOFLAGS, NULL))
    21132112    {
     
    21212120                /* Install the main state changed callback to know if something happens to our acquired context. */
    21222121                pa_threaded_mainloop_lock(pThis->pMainLoop);
    2123                 pa_context_set_state_callback(pThis->pContext, drvHostAudioPaCtxCallbackStateChanged, pThis /* pvUserData */);
     2122                pa_context_set_state_callback(pThis->pContext, drvHstAudPaCtxCallbackStateChanged, pThis /* pvUserData */);
    21242123                pa_threaded_mainloop_unlock(pThis->pMainLoop);
    21252124            }
     
    21722171    ~0U,
    21732172    /* cbInstance */
    2174     sizeof(DRVHOSTPULSEAUDIO),
     2173    sizeof(DRVHSTAUDPA),
    21752174    /* pfnConstruct */
    2176     drvHostAudioPaConstruct,
     2175    drvHstAudPaConstruct,
    21772176    /* pfnDestruct */
    2178     drvHostAudioPaDestruct,
     2177    drvHstAudPaDestruct,
    21792178    /* pfnRelocate */
    21802179    NULL,
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