VirtualBox

Changeset 89485 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 3, 2021 1:04:26 PM (4 years ago)
Author:
vboxsync
Message:

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

File:
1 edited

Legend:

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

    r89344 r89485  
    3838 * Debug host audio stream.
    3939 */
    40 typedef struct DEBUGAUDIOSTREAM
     40typedef struct DRVHSTAUDDEBUGSTREAM
    4141{
    4242    /** Common part. */
     
    5050        AUDIOTESTTONE       In;
    5151    };
    52 } DEBUGAUDIOSTREAM;
     52} DRVHSTAUDDEBUGSTREAM;
    5353/** Pointer to a debug host audio stream. */
    54 typedef DEBUGAUDIOSTREAM *PDEBUGAUDIOSTREAM;
     54typedef DRVHSTAUDDEBUGSTREAM *PDRVHSTAUDDEBUGSTREAM;
    5555
    5656/**
     
    5858 * @implements PDMIAUDIOCONNECTOR
    5959 */
    60 typedef struct DRVHOSTDEBUGAUDIO
     60typedef struct DRVHSTAUDDEBUG
    6161{
    6262    /** Pointer to the driver instance structure. */
     
    6464    /** Pointer to host audio interface. */
    6565    PDMIHOSTAUDIO   IHostAudio;
    66 } DRVHOSTDEBUGAUDIO;
     66} DRVHSTAUDDEBUG;
    6767/** Pointer to a debug host audio driver. */
    68 typedef DRVHOSTDEBUGAUDIO *PDRVHOSTDEBUGAUDIO;
     68typedef DRVHSTAUDDEBUG *PDRVHSTAUDDEBUG;
    6969
    7070
     
    7272 * @interface_method_impl{PDMIHOSTAUDIO,pfnGetConfig}
    7373 */
    74 static DECLCALLBACK(int) drvHostDebugAudioHA_GetConfig(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDCFG pBackendCfg)
     74static DECLCALLBACK(int) drvHstAudDebugHA_GetConfig(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDCFG pBackendCfg)
    7575{
    7676    RT_NOREF(pInterface);
     
    8181     */
    8282    RTStrCopy(pBackendCfg->szName, sizeof(pBackendCfg->szName), "DebugAudio");
    83     pBackendCfg->cbStream       = sizeof(DEBUGAUDIOSTREAM);
     83    pBackendCfg->cbStream       = sizeof(DRVHSTAUDDEBUGSTREAM);
    8484    pBackendCfg->fFlags         = 0;
    8585    pBackendCfg->cMaxStreamsOut = 1; /* Output; writing to a file. */
     
    9393 * @interface_method_impl{PDMIHOSTAUDIO,pfnGetStatus}
    9494 */
    95 static DECLCALLBACK(PDMAUDIOBACKENDSTS) drvHostDebugAudioHA_GetStatus(PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir)
     95static DECLCALLBACK(PDMAUDIOBACKENDSTS) drvHstAudDebugHA_GetStatus(PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir)
    9696{
    9797    RT_NOREF(pInterface, enmDir);
     
    103103 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamCreate}
    104104 */
    105 static DECLCALLBACK(int) drvHostDebugAudioHA_StreamCreate(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
     105static DECLCALLBACK(int) drvHstAudDebugHA_StreamCreate(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
    106106                                                          PPDMAUDIOSTREAMCFG pCfgReq, PPDMAUDIOSTREAMCFG pCfgAcq)
    107107{
    108     PDRVHOSTDEBUGAUDIO pDrv       = RT_FROM_MEMBER(pInterface, DRVHOSTDEBUGAUDIO, IHostAudio);
    109     PDEBUGAUDIOSTREAM  pStreamDbg = (PDEBUGAUDIOSTREAM)pStream;
     108    PDRVHSTAUDDEBUG         pThis      = RT_FROM_MEMBER(pInterface, DRVHSTAUDDEBUG, IHostAudio);
     109    PDRVHSTAUDDEBUGSTREAM   pStreamDbg = (PDRVHSTAUDDEBUGSTREAM)pStream;
    110110    AssertPtrReturn(pStreamDbg, VERR_INVALID_POINTER);
    111111    AssertPtrReturn(pCfgReq, VERR_INVALID_POINTER);
     
    119119    int rc = AudioHlpFileCreateAndOpenEx(&pStreamDbg->pFile, AUDIOHLPFILETYPE_WAV, NULL /*use temp dir*/,
    120120                                         pCfgReq->enmDir == PDMAUDIODIR_IN ? "DebugAudioIn" : "DebugAudioOut",
    121                                          pDrv->pDrvIns->iInstance, AUDIOHLPFILENAME_FLAGS_NONE, AUDIOHLPFILE_FLAGS_NONE,
     121                                         pThis->pDrvIns->iInstance, AUDIOHLPFILENAME_FLAGS_NONE, AUDIOHLPFILE_FLAGS_NONE,
    122122                                         &pCfgReq->Props, RTFILE_O_WRITE | RTFILE_O_DENY_WRITE | RTFILE_O_CREATE_REPLACE);
    123123    if (RT_FAILURE(rc))
     
    132132 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDestroy}
    133133 */
    134 static DECLCALLBACK(int) drvHostDebugAudioHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
    135                                                            bool fImmediate)
     134static DECLCALLBACK(int) drvHstAudDebugHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
     135                                                        bool fImmediate)
    136136{
    137137    RT_NOREF(pInterface, fImmediate);
    138     PDEBUGAUDIOSTREAM pStreamDbg = (PDEBUGAUDIOSTREAM)pStream;
     138    PDRVHSTAUDDEBUGSTREAM pStreamDbg = (PDRVHSTAUDDEBUGSTREAM)pStream;
    139139    AssertPtrReturn(pStreamDbg, VERR_INVALID_POINTER);
    140140
     
    152152 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
    153153 */
    154 static DECLCALLBACK(int) drvHostDebugAudioHA_StreamControlStub(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     154static DECLCALLBACK(int) drvHstAudDebugHA_StreamControlStub(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    155155{
    156156    RT_NOREF(pInterface, pStream);
     
    162162 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamControl}
    163163 */
    164 static DECLCALLBACK(int) drvHostDebugAudioHA_StreamControl(PPDMIHOSTAUDIO pInterface,
    165                                                            PPDMAUDIOBACKENDSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd)
     164static DECLCALLBACK(int) drvHstAudDebugHA_StreamControl(PPDMIHOSTAUDIO pInterface,
     165                                                        PPDMAUDIOBACKENDSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd)
    166166{
    167167    /** @todo r=bird: I'd like to get rid of this pfnStreamControl method,
     
    172172    {
    173173        case PDMAUDIOSTREAMCMD_ENABLE:
    174             return drvHostDebugAudioHA_StreamControlStub(pInterface, pStream);
     174            return drvHstAudDebugHA_StreamControlStub(pInterface, pStream);
    175175        case PDMAUDIOSTREAMCMD_DISABLE:
    176             return drvHostDebugAudioHA_StreamControlStub(pInterface, pStream);
     176            return drvHstAudDebugHA_StreamControlStub(pInterface, pStream);
    177177        case PDMAUDIOSTREAMCMD_PAUSE:
    178             return drvHostDebugAudioHA_StreamControlStub(pInterface, pStream);
     178            return drvHstAudDebugHA_StreamControlStub(pInterface, pStream);
    179179        case PDMAUDIOSTREAMCMD_RESUME:
    180             return drvHostDebugAudioHA_StreamControlStub(pInterface, pStream);
     180            return drvHstAudDebugHA_StreamControlStub(pInterface, pStream);
    181181        case PDMAUDIOSTREAMCMD_DRAIN:
    182             return drvHostDebugAudioHA_StreamControlStub(pInterface, pStream);
     182            return drvHstAudDebugHA_StreamControlStub(pInterface, pStream);
    183183
    184184        case PDMAUDIOSTREAMCMD_END:
     
    195195 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetReadable}
    196196 */
    197 static DECLCALLBACK(uint32_t) drvHostDebugAudioHA_StreamGetReadable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    198 {
    199     RT_NOREF(pInterface);
    200     PDEBUGAUDIOSTREAM pStreamDbg = (PDEBUGAUDIOSTREAM)pStream;
     197static DECLCALLBACK(uint32_t) drvHstAudDebugHA_StreamGetReadable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     198{
     199    RT_NOREF(pInterface);
     200    PDRVHSTAUDDEBUGSTREAM pStreamDbg = (PDRVHSTAUDDEBUGSTREAM)pStream;
    201201
    202202    return PDMAudioPropsMilliToBytes(&pStreamDbg->Cfg.Props, 10 /*ms*/);
     
    207207 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetWritable}
    208208 */
    209 static DECLCALLBACK(uint32_t) drvHostDebugAudioHA_StreamGetWritable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     209static DECLCALLBACK(uint32_t) drvHstAudDebugHA_StreamGetWritable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    210210{
    211211    RT_NOREF(pInterface, pStream);
     
    217217 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetPending}
    218218 */
    219 static DECLCALLBACK(uint32_t) drvHostDebugAudioHA_StreamGetPending(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     219static DECLCALLBACK(uint32_t) drvHstAudDebugHA_StreamGetPending(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    220220{
    221221    RT_NOREF(pInterface, pStream);
     
    227227 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetState}
    228228 */
    229 static DECLCALLBACK(PDMHOSTAUDIOSTREAMSTATE) drvHostDebugAudioHA_StreamGetState(PPDMIHOSTAUDIO pInterface,
    230                                                                                 PPDMAUDIOBACKENDSTREAM pStream)
     229static DECLCALLBACK(PDMHOSTAUDIOSTREAMSTATE) drvHstAudDebugHA_StreamGetState(PPDMIHOSTAUDIO pInterface,
     230                                                                             PPDMAUDIOBACKENDSTREAM pStream)
    231231{
    232232    RT_NOREF(pInterface);
     
    239239 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPlay}
    240240 */
    241 static DECLCALLBACK(int) drvHostDebugAudioHA_StreamPlay(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
     241static DECLCALLBACK(int) drvHstAudDebugHA_StreamPlay(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
    242242                                                        const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten)
    243243{
    244244    RT_NOREF(pInterface);
    245     PDEBUGAUDIOSTREAM pStreamDbg = (PDEBUGAUDIOSTREAM)pStream;
     245    PDRVHSTAUDDEBUGSTREAM pStreamDbg = (PDRVHSTAUDDEBUGSTREAM)pStream;
    246246
    247247    int rc = AudioHlpFileWrite(pStreamDbg->pFile, pvBuf, cbBuf, 0 /* fFlags */);
     
    257257 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamCapture}
    258258 */
    259 static DECLCALLBACK(int) drvHostDebugAudioHA_StreamCapture(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
    260                                                            void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead)
    261 {
    262     RT_NOREF(pInterface);
    263     PDEBUGAUDIOSTREAM pStreamDbg = (PDEBUGAUDIOSTREAM)pStream;
     259static DECLCALLBACK(int) drvHstAudDebugHA_StreamCapture(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
     260                                                        void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead)
     261{
     262    RT_NOREF(pInterface);
     263    PDRVHSTAUDDEBUGSTREAM pStreamDbg = (PDRVHSTAUDDEBUGSTREAM)pStream;
    264264/** @todo rate limit this?  */
    265265
     
    286286 * @interface_method_impl{PDMIBASE,pfnQueryInterface}
    287287 */
    288 static DECLCALLBACK(void *) drvHostDebugAudioQueryInterface(PPDMIBASE pInterface, const char *pszIID)
    289 {
    290     PPDMDRVINS         pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
    291     PDRVHOSTDEBUGAUDIO pThis   = PDMINS_2_DATA(pDrvIns, PDRVHOSTDEBUGAUDIO);
     288static DECLCALLBACK(void *) drvHstAudDebugQueryInterface(PPDMIBASE pInterface, const char *pszIID)
     289{
     290    PPDMDRVINS      pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
     291    PDRVHSTAUDDEBUG pThis   = PDMINS_2_DATA(pDrvIns, PDRVHSTAUDDEBUG);
    292292
    293293    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase);
     
    302302 * @copydoc FNPDMDRVCONSTRUCT
    303303 */
    304 static DECLCALLBACK(int) drvHostDebugAudioConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
     304static DECLCALLBACK(int) drvHstAudDebugConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
    305305{
    306306    RT_NOREF(pCfg, fFlags);
    307307    PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
    308     PDRVHOSTDEBUGAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTDEBUGAUDIO);
     308    PDRVHSTAUDDEBUG pThis = PDMINS_2_DATA(pDrvIns, PDRVHSTAUDDEBUG);
    309309    LogRel(("Audio: Initializing DEBUG driver\n"));
    310310
     
    314314    pThis->pDrvIns                   = pDrvIns;
    315315    /* IBase */
    316     pDrvIns->IBase.pfnQueryInterface = drvHostDebugAudioQueryInterface;
     316    pDrvIns->IBase.pfnQueryInterface = drvHstAudDebugQueryInterface;
    317317    /* IHostAudio */
    318     pThis->IHostAudio.pfnGetConfig                  = drvHostDebugAudioHA_GetConfig;
     318    pThis->IHostAudio.pfnGetConfig                  = drvHstAudDebugHA_GetConfig;
    319319    pThis->IHostAudio.pfnGetDevices                 = NULL;
    320320    pThis->IHostAudio.pfnSetDevice                  = NULL;
    321     pThis->IHostAudio.pfnGetStatus                  = drvHostDebugAudioHA_GetStatus;
     321    pThis->IHostAudio.pfnGetStatus                  = drvHstAudDebugHA_GetStatus;
    322322    pThis->IHostAudio.pfnDoOnWorkerThread           = NULL;
    323323    pThis->IHostAudio.pfnStreamConfigHint           = NULL;
    324     pThis->IHostAudio.pfnStreamCreate               = drvHostDebugAudioHA_StreamCreate;
     324    pThis->IHostAudio.pfnStreamCreate               = drvHstAudDebugHA_StreamCreate;
    325325    pThis->IHostAudio.pfnStreamInitAsync            = NULL;
    326     pThis->IHostAudio.pfnStreamDestroy              = drvHostDebugAudioHA_StreamDestroy;
     326    pThis->IHostAudio.pfnStreamDestroy              = drvHstAudDebugHA_StreamDestroy;
    327327    pThis->IHostAudio.pfnStreamNotifyDeviceChanged  = NULL;
    328     pThis->IHostAudio.pfnStreamControl              = drvHostDebugAudioHA_StreamControl;
    329     pThis->IHostAudio.pfnStreamGetReadable          = drvHostDebugAudioHA_StreamGetReadable;
    330     pThis->IHostAudio.pfnStreamGetWritable          = drvHostDebugAudioHA_StreamGetWritable;
    331     pThis->IHostAudio.pfnStreamGetPending           = drvHostDebugAudioHA_StreamGetPending;
    332     pThis->IHostAudio.pfnStreamGetState             = drvHostDebugAudioHA_StreamGetState;
    333     pThis->IHostAudio.pfnStreamPlay                 = drvHostDebugAudioHA_StreamPlay;
    334     pThis->IHostAudio.pfnStreamCapture              = drvHostDebugAudioHA_StreamCapture;
     328    pThis->IHostAudio.pfnStreamControl              = drvHstAudDebugHA_StreamControl;
     329    pThis->IHostAudio.pfnStreamGetReadable          = drvHstAudDebugHA_StreamGetReadable;
     330    pThis->IHostAudio.pfnStreamGetWritable          = drvHstAudDebugHA_StreamGetWritable;
     331    pThis->IHostAudio.pfnStreamGetPending           = drvHstAudDebugHA_StreamGetPending;
     332    pThis->IHostAudio.pfnStreamGetState             = drvHstAudDebugHA_StreamGetState;
     333    pThis->IHostAudio.pfnStreamPlay                 = drvHstAudDebugHA_StreamPlay;
     334    pThis->IHostAudio.pfnStreamCapture              = drvHstAudDebugHA_StreamCapture;
    335335
    336336#ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH
     
    363363    ~0U,
    364364    /* cbInstance */
    365     sizeof(DRVHOSTDEBUGAUDIO),
     365    sizeof(DRVHSTAUDDEBUG),
    366366    /* pfnConstruct */
    367     drvHostDebugAudioConstruct,
     367    drvHstAudDebugConstruct,
    368368    /* pfnDestruct */
    369369    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