VirtualBox

Ignore:
Timestamp:
Jun 3, 2021 12:35:28 PM (4 years ago)
Author:
vboxsync
Message:

DrvHostAudioOss: Don't refuse to pre-buffer input streams. Cleaned up function prefix and struct names. bugref:9890

File:
1 edited

Legend:

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

    r89443 r89479  
    5353*********************************************************************************************************************************/
    5454/**
    55  * OSS host audio driver instance data.
    56  * @implements PDMIAUDIOCONNECTOR
    57  */
    58 typedef struct DRVHOSTOSSAUDIO
    59 {
    60     /** Pointer to the driver instance structure. */
    61     PPDMDRVINS          pDrvIns;
    62     /** Pointer to host audio interface. */
    63     PDMIHOSTAUDIO       IHostAudio;
    64     /** Error count for not flooding the release log.
    65      *  UINT32_MAX for unlimited logging. */
    66     uint32_t            cLogErrors;
    67 } DRVHOSTOSSAUDIO;
    68 /** Pointer to the instance data for an OSS host audio driver. */
    69 typedef DRVHOSTOSSAUDIO *PDRVHOSTOSSAUDIO;
    70 
    71 /**
    7255 * OSS audio stream configuration.
    7356 */
    74 typedef struct OSSAUDIOSTREAMCFG
     57typedef struct DRVHSTAUDOSSSTREAMCFG
    7558{
    7659    PDMAUDIOPCMPROPS    Props;
     
    7962    uint16_t            cbFragmentLog2;
    8063    uint32_t            cbFragment;
    81 } OSSAUDIOSTREAMCFG;
     64} DRVHSTAUDOSSSTREAMCFG;
    8265/** Pointer to an OSS audio stream configuration. */
    83 typedef OSSAUDIOSTREAMCFG *POSSAUDIOSTREAMCFG;
     66typedef DRVHSTAUDOSSSTREAMCFG *PDRVHSTAUDOSSSTREAMCFG;
    8467
    8568/**
    8669 * OSS audio stream.
    8770 */
    88 typedef struct OSSAUDIOSTREAM
     71typedef struct DRVHSTAUDOSSSTREAM
    8972{
    9073    /** Common part. */
     
    10184    PDMAUDIOSTREAMCFG       Cfg;
    10285    /** The acquired OSS configuration. */
    103     OSSAUDIOSTREAMCFG       OssCfg;
     86    DRVHSTAUDOSSSTREAMCFG   OssCfg;
    10487    /** Handle to the thread draining output streams. */
    10588    RTTHREAD                hThreadDrain;
    106 } OSSAUDIOSTREAM;
     89} DRVHSTAUDOSSSTREAM;
    10790/** Pointer to an OSS audio stream. */
    108 typedef OSSAUDIOSTREAM *POSSAUDIOSTREAM;
     91typedef DRVHSTAUDOSSSTREAM *PDRVHSTAUDOSSSTREAM;
     92
     93/**
     94 * OSS host audio driver instance data.
     95 * @implements PDMIAUDIOCONNECTOR
     96 */
     97typedef struct DRVHSTAUDOSS
     98{
     99    /** Pointer to the driver instance structure. */
     100    PPDMDRVINS          pDrvIns;
     101    /** Pointer to host audio interface. */
     102    PDMIHOSTAUDIO       IHostAudio;
     103    /** Error count for not flooding the release log.
     104     *  UINT32_MAX for unlimited logging. */
     105    uint32_t            cLogErrors;
     106} DRVHSTAUDOSS;
     107/** Pointer to the instance data for an OSS host audio driver. */
     108typedef DRVHSTAUDOSS *PDRVHSTAUDOSS;
    109109
    110110
     
    119119
    120120
    121 static int ossOSSToAudioProps(PPDMAUDIOPCMPROPS pProps, int fmt, int cChannels, int uHz)
     121static int drvHstAudOssToPdmAudioProps(PPDMAUDIOPCMPROPS pProps, int fmt, int cChannels, int uHz)
    122122{
    123123    switch (fmt)
     
    155155
    156156
    157 static int ossStreamClose(int *phFile)
     157static int drvHstAudOssStreamClose(int *phFile)
    158158{
    159159    if (!phFile || !*phFile || *phFile == -1)
     
    179179 * @interface_method_impl{PDMIHOSTAUDIO,pfnGetConfig}
    180180 */
    181 static DECLCALLBACK(int) drvHostOssAudioHA_GetConfig(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDCFG pBackendCfg)
     181static DECLCALLBACK(int) drvHstAudOssHA_GetConfig(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDCFG pBackendCfg)
    182182{
    183183    RT_NOREF(pInterface);
     
    187187     */
    188188    RTStrCopy(pBackendCfg->szName, sizeof(pBackendCfg->szName), "OSS");
    189     pBackendCfg->cbStream       = sizeof(OSSAUDIOSTREAM);
     189    pBackendCfg->cbStream       = sizeof(DRVHSTAUDOSSSTREAM);
    190190    pBackendCfg->fFlags         = 0;
    191191    pBackendCfg->cMaxStreamsIn  = 0;
     
    242242
    243243
    244 
    245 
    246244/**
    247245 * @interface_method_impl{PDMIHOSTAUDIO,pfnGetStatus}
    248246 */
    249 static DECLCALLBACK(PDMAUDIOBACKENDSTS) drvHostOssAudioHA_GetStatus(PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir)
     247static DECLCALLBACK(PDMAUDIOBACKENDSTS) drvHstAudOssHA_GetStatus(PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir)
    250248{
    251249    AssertPtrReturn(pInterface, PDMAUDIOBACKENDSTS_UNKNOWN);
     
    256254
    257255
    258 static int ossStreamConfigure(int hFile, bool fInput, POSSAUDIOSTREAMCFG pOSSReq, POSSAUDIOSTREAMCFG pOSSAcq)
     256static int drvHstAudOssStreamConfigure(int hFile, bool fInput, PDRVHSTAUDOSSSTREAMCFG pOSSReq, PDRVHSTAUDOSSSTREAMCFG pOSSAcq)
    259257{
    260258    /*
     
    334332                          RTErrConvertFromErrno(errno));
    335333
    336     int rc = ossOSSToAudioProps(&pOSSAcq->Props, iFormat, cChannels, iFrequenc);
     334    int rc = drvHstAudOssToPdmAudioProps(&pOSSAcq->Props, iFormat, cChannels, iFrequenc);
    337335    if (RT_SUCCESS(rc))
    338336    {
     
    353351 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamCreate}
    354352 */
    355 static DECLCALLBACK(int) drvHostOssAudioHA_StreamCreate(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
    356                                                         PPDMAUDIOSTREAMCFG pCfgReq, PPDMAUDIOSTREAMCFG pCfgAcq)
     353static DECLCALLBACK(int) drvHstAudOssHA_StreamCreate(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
     354                                                     PPDMAUDIOSTREAMCFG pCfgReq, PPDMAUDIOSTREAMCFG pCfgAcq)
    357355{
    358356    AssertPtr(pInterface); RT_NOREF(pInterface);
    359     POSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream;
     357    PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream;
    360358    AssertPtrReturn(pStreamOSS, VERR_INVALID_POINTER);
    361359    AssertPtrReturn(pCfgReq, VERR_INVALID_POINTER);
     
    383381         *       channel mappings and whatnot.
    384382         */
    385         OSSAUDIOSTREAMCFG ReqOssCfg;
     383        DRVHSTAUDOSSSTREAMCFG ReqOssCfg;
    386384        RT_ZERO(ReqOssCfg);
    387385
     
    399397        AssertLogRelStmt(cbBuffer < ((uint32_t)0x7ffe << ReqOssCfg.cbFragmentLog2), ReqOssCfg.cFragments = 0x7ffe);
    400398
    401         rc = ossStreamConfigure(pStreamOSS->hFile, pCfgReq->enmDir == PDMAUDIODIR_IN, &ReqOssCfg, &pStreamOSS->OssCfg);
     399        rc = drvHstAudOssStreamConfigure(pStreamOSS->hFile, pCfgReq->enmDir == PDMAUDIODIR_IN, &ReqOssCfg, &pStreamOSS->OssCfg);
    402400        if (RT_SUCCESS(rc))
    403401        {
     
    412410
    413411            memcpy(&pCfgAcq->Props, &pStreamOSS->OssCfg.Props, sizeof(PDMAUDIOPCMPROPS));
    414             pCfgAcq->Backend.cFramesPeriod     = PDMAudioPropsBytesToFrames(&pCfgAcq->Props, pStreamOSS->OssCfg.cbFragment);
    415             pCfgAcq->Backend.cFramesBufferSize = pCfgAcq->Backend.cFramesPeriod * pStreamOSS->OssCfg.cFragments;
    416             if (pCfgReq->enmDir == PDMAUDIODIR_OUT)
    417                 pCfgAcq->Backend.cFramesPreBuffering = (uint64_t)pCfgReq->Backend.cFramesPreBuffering
    418                                                      * pCfgAcq->Backend.cFramesBufferSize
    419                                                      / RT_MAX(pCfgReq->Backend.cFramesBufferSize, 1);
    420             else
    421                 pCfgAcq->Backend.cFramesPreBuffering = 0; /** @todo is this sane? */
     412            pCfgAcq->Backend.cFramesPeriod       = PDMAudioPropsBytesToFrames(&pCfgAcq->Props, pStreamOSS->OssCfg.cbFragment);
     413            pCfgAcq->Backend.cFramesBufferSize   = pCfgAcq->Backend.cFramesPeriod * pStreamOSS->OssCfg.cFragments;
     414            pCfgAcq->Backend.cFramesPreBuffering = (uint64_t)pCfgReq->Backend.cFramesPreBuffering
     415                                                 * pCfgAcq->Backend.cFramesBufferSize
     416                                                 / RT_MAX(pCfgReq->Backend.cFramesBufferSize, 1);
    422417
    423418            /*
     
    427422            return VINF_SUCCESS;
    428423        }
    429         ossStreamClose(&pStreamOSS->hFile);
     424        drvHstAudOssStreamClose(&pStreamOSS->hFile);
    430425    }
    431426    else
     
    442437 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDestroy}
    443438 */
    444 static DECLCALLBACK(int) drvHostOssAudioHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
    445                                                          bool fImmediate)
     439static DECLCALLBACK(int) drvHstAudOssHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, bool fImmediate)
    446440{
    447441    RT_NOREF(pInterface, fImmediate);
    448     POSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream;
     442    PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream;
    449443    AssertPtrReturn(pStreamOSS, VERR_INVALID_POINTER);
    450444
    451     ossStreamClose(&pStreamOSS->hFile);
     445    drvHstAudOssStreamClose(&pStreamOSS->hFile);
    452446
    453447    if (pStreamOSS->hThreadDrain != NIL_RTTHREAD)
     
    465459 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
    466460 */
    467 static DECLCALLBACK(int) drvHostOssAudioHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     461static DECLCALLBACK(int) drvHstAudOssHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    468462{
    469463    RT_NOREF(pInterface);
    470     POSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream;
     464    PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream;
    471465
    472466    /** @todo this might be a little optimisitic...   */
     
    496490 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable}
    497491 */
    498 static DECLCALLBACK(int) drvHostOssAudioHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     492static DECLCALLBACK(int) drvHstAudOssHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    499493{
    500494    RT_NOREF(pInterface);
    501     POSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream;
     495    PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream;
    502496
    503497    int rc;
     
    548542 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause}
    549543 */
    550 static DECLCALLBACK(int) drvHostOssAudioHA_StreamPause(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    551 {
    552     return drvHostOssAudioHA_StreamDisable(pInterface, pStream);
     544static DECLCALLBACK(int) drvHstAudOssHA_StreamPause(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     545{
     546    return drvHstAudOssHA_StreamDisable(pInterface, pStream);
    553547}
    554548
     
    557551 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume}
    558552 */
    559 static DECLCALLBACK(int) drvHostOssAudioHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    560 {
    561     return drvHostOssAudioHA_StreamEnable(pInterface, pStream);
     553static DECLCALLBACK(int) drvHstAudOssHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     554{
     555    return drvHstAudOssHA_StreamEnable(pInterface, pStream);
    562556}
    563557
     
    567561 * Thread for calling SNDCTL_DSP_SYNC (blocking) on an output stream.}
    568562 */
    569 static DECLCALLBACK(int) drvHostOssAudioDrainThread(RTTHREAD ThreadSelf, void *pvUser)
     563static DECLCALLBACK(int) drvHstAudOssDrainThread(RTTHREAD ThreadSelf, void *pvUser)
    570564{
    571565    RT_NOREF(ThreadSelf);
    572     POSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pvUser;
     566    PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pvUser;
    573567    int rc;
    574568
     
    609603 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable}
    610604 */
    611 static DECLCALLBACK(int) drvHostOssAudioHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    612 {
    613     PDRVHOSTOSSAUDIO pThis      = RT_FROM_MEMBER(pInterface, DRVHOSTOSSAUDIO, IHostAudio);
    614     POSSAUDIOSTREAM  pStreamOSS = (POSSAUDIOSTREAM)pStream;
     605static DECLCALLBACK(int) drvHstAudOssHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     606{
     607    PDRVHSTAUDOSS       pThis      = RT_FROM_MEMBER(pInterface, DRVHSTAUDOSS, IHostAudio);
     608    PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream;
    615609    AssertReturn(pStreamOSS->Cfg.enmDir == PDMAUDIODIR_OUT, VERR_WRONG_ORDER);
    616610
     
    638632    }
    639633
    640     int rc = RTThreadCreateF(&pStreamOSS->hThreadDrain, drvHostOssAudioDrainThread, pStreamOSS, 0,
     634    int rc = RTThreadCreateF(&pStreamOSS->hThreadDrain, drvHstAudOssDrainThread, pStreamOSS, 0,
    641635                             RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, "ossdrai%u", pThis->pDrvIns->iInstance);
    642636    LogFunc(("Started drain thread: %Rrc\n", rc));
     
    647641
    648642
    649 
    650643/**
    651644 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamControl}
    652645 */
    653 static DECLCALLBACK(int) drvHostOssAudioHA_StreamControl(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
    654                                                          PDMAUDIOSTREAMCMD enmStreamCmd)
     646static DECLCALLBACK(int) drvHstAudOssHA_StreamControl(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
     647                                                      PDMAUDIOSTREAMCMD enmStreamCmd)
    655648{
    656649    /** @todo r=bird: I'd like to get rid of this pfnStreamControl method,
     
    661654    {
    662655        case PDMAUDIOSTREAMCMD_ENABLE:
    663             return drvHostOssAudioHA_StreamEnable(pInterface, pStream);
     656            return drvHstAudOssHA_StreamEnable(pInterface, pStream);
    664657        case PDMAUDIOSTREAMCMD_DISABLE:
    665             return drvHostOssAudioHA_StreamDisable(pInterface, pStream);
     658            return drvHstAudOssHA_StreamDisable(pInterface, pStream);
    666659        case PDMAUDIOSTREAMCMD_PAUSE:
    667             return drvHostOssAudioHA_StreamPause(pInterface, pStream);
     660            return drvHstAudOssHA_StreamPause(pInterface, pStream);
    668661        case PDMAUDIOSTREAMCMD_RESUME:
    669             return drvHostOssAudioHA_StreamResume(pInterface, pStream);
     662            return drvHstAudOssHA_StreamResume(pInterface, pStream);
    670663        case PDMAUDIOSTREAMCMD_DRAIN:
    671             return drvHostOssAudioHA_StreamDrain(pInterface, pStream);
     664            return drvHstAudOssHA_StreamDrain(pInterface, pStream);
    672665            /** @todo the drain call for OSS is SNDCTL_DSP_SYNC, however in the non-ALSA
    673666             *        implementation of OSS it is probably blocking.  Also, it comes with
     
    686679 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetReadable}
    687680 */
    688 static DECLCALLBACK(uint32_t) drvHostOssAudioHA_StreamGetReadable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     681static DECLCALLBACK(uint32_t) drvHstAudOssHA_StreamGetReadable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    689682{
    690683    RT_NOREF(pInterface, pStream);
     
    697690 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetWritable}
    698691 */
    699 static DECLCALLBACK(uint32_t) drvHostOssAudioHA_StreamGetWritable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     692static DECLCALLBACK(uint32_t) drvHstAudOssHA_StreamGetWritable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    700693{
    701694    RT_NOREF(pInterface);
    702     POSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream;
     695    PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream;
    703696    AssertPtr(pStreamOSS);
    704697
     
    733726 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetState}
    734727 */
    735 static DECLCALLBACK(PDMHOSTAUDIOSTREAMSTATE) drvHostOssAudioHA_StreamGetState(PPDMIHOSTAUDIO pInterface,
    736                                                                               PPDMAUDIOBACKENDSTREAM pStream)
     728static DECLCALLBACK(PDMHOSTAUDIOSTREAMSTATE) drvHstAudOssHA_StreamGetState(PPDMIHOSTAUDIO pInterface,
     729                                                                           PPDMAUDIOBACKENDSTREAM pStream)
    737730{
    738731    RT_NOREF(pInterface);
    739     POSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream;
     732    PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream;
    740733    AssertPtrReturn(pStreamOSS, PDMHOSTAUDIOSTREAMSTATE_INVALID);
    741734    if (!pStreamOSS->fDraining)
     
    748741 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPlay}
    749742 */
    750 static DECLCALLBACK(int) drvHostOssAudioHA_StreamPlay(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
    751                                                       const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten)
     743static DECLCALLBACK(int) drvHstAudOssHA_StreamPlay(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
     744                                                   const void *pvBuf, uint32_t cbBuf, uint32_t *pcbWritten)
    752745{
    753746    RT_NOREF(pInterface);
    754     POSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream;
     747    PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream;
    755748    AssertPtrReturn(pStreamOSS, VERR_INVALID_POINTER);
    756749
     
    833826 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamCapture}
    834827 */
    835 static DECLCALLBACK(int) drvHostOssAudioHA_StreamCapture(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
    836                                                          void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead)
     828static DECLCALLBACK(int) drvHstAudOssHA_StreamCapture(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,
     829                                                      void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead)
    837830{
    838831    RT_NOREF(pInterface);
    839     POSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream;
     832    PDRVHSTAUDOSSSTREAM pStreamOSS = (PDRVHSTAUDOSSSTREAM)pStream;
    840833    AssertPtrReturn(pStreamOSS, VERR_INVALID_POINTER);
    841834    Log3Func(("@%#RX64 cbBuf=%#x %s\n", pStreamOSS->offInternal, cbBuf, pStreamOSS->Cfg.szName));
     
    876869
    877870
    878 
    879871/**
    880872 * @interface_method_impl{PDMIBASE,pfnQueryInterface}
    881873 */
    882 static DECLCALLBACK(void *) drvHostOSSAudioQueryInterface(PPDMIBASE pInterface, const char *pszIID)
    883 {
    884     PPDMDRVINS       pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
    885     PDRVHOSTOSSAUDIO pThis   = PDMINS_2_DATA(pDrvIns, PDRVHOSTOSSAUDIO);
     874static DECLCALLBACK(void *) drvHstAudOssQueryInterface(PPDMIBASE pInterface, const char *pszIID)
     875{
     876    PPDMDRVINS    pDrvIns = PDMIBASE_2_PDMDRV(pInterface);
     877    PDRVHSTAUDOSS pThis   = PDMINS_2_DATA(pDrvIns, PDRVHSTAUDOSS);
    886878
    887879    PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDrvIns->IBase);
     
    891883}
    892884
    893 /**
    894  * Constructs an OSS audio driver instance.
    895  *
    896  * @copydoc FNPDMDRVCONSTRUCT
    897  */
    898 static DECLCALLBACK(int) drvHostOSSAudioConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
     885
     886/**
     887 * @interface_method_impl{PDMDRVREG,pfnConstruct,
     888 *      Constructs an OSS audio driver instance.}
     889 */
     890static DECLCALLBACK(int) drvHstAudOssConstruct(PPDMDRVINS pDrvIns, PCFGMNODE pCfg, uint32_t fFlags)
    899891{
    900892    RT_NOREF(pCfg, fFlags);
    901893    PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
    902     PDRVHOSTOSSAUDIO pThis = PDMINS_2_DATA(pDrvIns, PDRVHOSTOSSAUDIO);
     894    PDRVHSTAUDOSS pThis = PDMINS_2_DATA(pDrvIns, PDRVHSTAUDOSS);
    903895    LogRel(("Audio: Initializing OSS driver\n"));
    904896
     
    908900    pThis->pDrvIns                   = pDrvIns;
    909901    /* IBase */
    910     pDrvIns->IBase.pfnQueryInterface = drvHostOSSAudioQueryInterface;
     902    pDrvIns->IBase.pfnQueryInterface = drvHstAudOssQueryInterface;
    911903    /* IHostAudio */
    912     pThis->IHostAudio.pfnGetConfig                  = drvHostOssAudioHA_GetConfig;
     904    pThis->IHostAudio.pfnGetConfig                  = drvHstAudOssHA_GetConfig;
    913905    pThis->IHostAudio.pfnGetDevices                 = NULL;
    914906    pThis->IHostAudio.pfnSetDevice                  = NULL;
    915     pThis->IHostAudio.pfnGetStatus                  = drvHostOssAudioHA_GetStatus;
     907    pThis->IHostAudio.pfnGetStatus                  = drvHstAudOssHA_GetStatus;
    916908    pThis->IHostAudio.pfnDoOnWorkerThread           = NULL;
    917909    pThis->IHostAudio.pfnStreamConfigHint           = NULL;
    918     pThis->IHostAudio.pfnStreamCreate               = drvHostOssAudioHA_StreamCreate;
     910    pThis->IHostAudio.pfnStreamCreate               = drvHstAudOssHA_StreamCreate;
    919911    pThis->IHostAudio.pfnStreamInitAsync            = NULL;
    920     pThis->IHostAudio.pfnStreamDestroy              = drvHostOssAudioHA_StreamDestroy;
     912    pThis->IHostAudio.pfnStreamDestroy              = drvHstAudOssHA_StreamDestroy;
    921913    pThis->IHostAudio.pfnStreamNotifyDeviceChanged  = NULL;
    922     pThis->IHostAudio.pfnStreamControl              = drvHostOssAudioHA_StreamControl;
    923     pThis->IHostAudio.pfnStreamGetReadable          = drvHostOssAudioHA_StreamGetReadable;
    924     pThis->IHostAudio.pfnStreamGetWritable          = drvHostOssAudioHA_StreamGetWritable;
     914    pThis->IHostAudio.pfnStreamControl              = drvHstAudOssHA_StreamControl;
     915    pThis->IHostAudio.pfnStreamGetReadable          = drvHstAudOssHA_StreamGetReadable;
     916    pThis->IHostAudio.pfnStreamGetWritable          = drvHstAudOssHA_StreamGetWritable;
    925917    pThis->IHostAudio.pfnStreamGetPending           = NULL;
    926     pThis->IHostAudio.pfnStreamGetState             = drvHostOssAudioHA_StreamGetState;
    927     pThis->IHostAudio.pfnStreamPlay                 = drvHostOssAudioHA_StreamPlay;
    928     pThis->IHostAudio.pfnStreamCapture              = drvHostOssAudioHA_StreamCapture;
     918    pThis->IHostAudio.pfnStreamGetState             = drvHstAudOssHA_StreamGetState;
     919    pThis->IHostAudio.pfnStreamPlay                 = drvHstAudOssHA_StreamPlay;
     920    pThis->IHostAudio.pfnStreamCapture              = drvHstAudOssHA_StreamCapture;
    929921
    930922    return VINF_SUCCESS;
     
    954946    ~0U,
    955947    /* cbInstance */
    956     sizeof(DRVHOSTOSSAUDIO),
     948    sizeof(DRVHSTAUDOSS),
    957949    /* pfnConstruct */
    958     drvHostOSSAudioConstruct,
     950    drvHstAudOssConstruct,
    959951    /* pfnDestruct */
    960952    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