VirtualBox

Changeset 68488 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Aug 21, 2017 2:13:51 PM (7 years ago)
Author:
vboxsync
Message:

Audio/DrvAudio: A bit of parameter grouping; no actual code changes.

Location:
trunk/src/VBox/Devices/Audio
Files:
2 edited

Legend:

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

    r68486 r68488  
    19521952                {
    19531953                    case PDMAUDIODEVICECBTYPE_DATA_INPUT:
    1954                         RTListAppend(&pThis->lstCBIn, &pCB->Node);
     1954                        RTListAppend(&pThis->In.lstCB, &pCB->Node);
    19551955                        break;
    19561956
    19571957                    case PDMAUDIODEVICECBTYPE_DATA_OUTPUT:
    1958                         RTListAppend(&pThis->lstCBOut, &pCB->Node);
     1958                        RTListAppend(&pThis->Out.lstCB, &pCB->Node);
    19591959                        break;
    19601960
     
    22152215    }
    22162216
    2217     pThis->cStreamsFreeIn  = pThis->BackendCfg.cMaxStreamsIn;
    2218     pThis->cStreamsFreeOut = pThis->BackendCfg.cMaxStreamsOut;
    2219 
    2220     LogFlowFunc(("cStreamsFreeIn=%RU8, cStreamsFreeOut=%RU8\n", pThis->cStreamsFreeIn, pThis->cStreamsFreeOut));
     2217    pThis->In.cStreamsFree  = pThis->BackendCfg.cMaxStreamsIn;
     2218    pThis->Out.cStreamsFree = pThis->BackendCfg.cMaxStreamsOut;
     2219
     2220    LogFlowFunc(("cStreamsFreeIn=%RU8, cStreamsFreeOut=%RU8\n", pThis->In.cStreamsFree, pThis->Out.cStreamsFree));
    22212221
    22222222    LogRel2(("Audio: Host audio backend supports %RU32 input streams and %RU32 output streams at once\n",
    22232223             /* Clamp for logging. Unlimited streams are defined by UINT32_MAX. */
    2224              RT_MIN(64, pThis->cStreamsFreeIn), RT_MIN(64, pThis->cStreamsFreeOut)));
     2224             RT_MIN(64, pThis->In.cStreamsFree), RT_MIN(64, pThis->Out.cStreamsFree)));
    22252225
    22262226#ifdef VBOX_WITH_AUDIO_ENUM
     
    24902490        if (pCfgHost->enmDir == PDMAUDIODIR_IN)
    24912491        {
    2492             if (!pThis->cStreamsFreeIn)
     2492            if (!pThis->In.cStreamsFree)
    24932493                LogFunc(("Warning: No more input streams free to use\n"));
    24942494
     
    24972497        else /* Out */
    24982498        {
    2499             if (!pThis->cStreamsFreeOut)
     2499            if (!pThis->Out.cStreamsFree)
    25002500            {
    25012501                LogFlowFunc(("Maximum number of host output streams reached\n"));
     
    26392639        if (pCfgHost->enmDir == PDMAUDIODIR_IN)
    26402640        {
    2641             if (pThis->cStreamsFreeIn)
    2642                 pThis->cStreamsFreeIn--;
     2641            if (pThis->In.cStreamsFree)
     2642                pThis->In.cStreamsFree--;
    26432643        }
    26442644        else /* Out */
    26452645        {
    2646             if (pThis->cStreamsFreeOut)
    2647                 pThis->cStreamsFreeOut--;
     2646            if (pThis->Out.cStreamsFree)
     2647                pThis->Out.cStreamsFree--;
    26482648        }
    26492649
     
    30293029        if (enmDir == PDMAUDIODIR_IN)
    30303030        {
    3031             pThis->cStreamsFreeIn++;
     3031            pThis->In.cStreamsFree++;
    30323032        }
    30333033        else /* Out */
    30343034        {
    3035             pThis->cStreamsFreeOut++;
     3035            pThis->Out.cStreamsFree++;
    30363036        }
    30373037    }
     
    32713271    RTListInit(&pThis->lstGstStreams);
    32723272#ifdef VBOX_WITH_AUDIO_CALLBACKS
    3273     RTListInit(&pThis->lstCBIn);
    3274     RTListInit(&pThis->lstCBOut);
     3273    RTListInit(&pThis->In.lstCB);
     3274    RTListInit(&pThis->Out.lstCB);
    32753275#endif
    32763276
     
    34363436     */
    34373437    PPDMAUDIOCBRECORD pCB, pCBNext;
    3438     RTListForEachSafe(&pThis->lstCBIn, pCB, pCBNext, PDMAUDIOCBRECORD, Node)
     3438    RTListForEachSafe(&pThis->In.lstCB, pCB, pCBNext, PDMAUDIOCBRECORD, Node)
    34393439        drvAudioCallbackDestroy(pCB);
    34403440
    3441     RTListForEachSafe(&pThis->lstCBOut, pCB, pCBNext, PDMAUDIOCBRECORD, Node)
     3441    RTListForEachSafe(&pThis->Out.lstCB, pCB, pCBNext, PDMAUDIOCBRECORD, Node)
    34423442        drvAudioCallbackDestroy(pCB);
    34433443#endif
  • trunk/src/VBox/Devices/Audio/DrvAudio.h

    r68485 r68488  
    109109    /** List of guest input/output audio streams. */
    110110    RTLISTANCHOR            lstGstStreams;
    111     /** Max. number of free input streams.
    112      *  UINT32_MAX for unlimited streams. */
    113     uint32_t                cStreamsFreeIn;
    114     /** Max. number of free output streams.
    115      *  UINT32_MAX for unlimited streams. */
    116     uint32_t                cStreamsFreeOut;
    117111#ifdef VBOX_WITH_AUDIO_ENUM
    118112    /** Flag indicating to perform an (re-)enumeration of the host audio devices. */
     
    121115    /** Audio configuration settings retrieved from the backend. */
    122116    PDMAUDIOBACKENDCFG      BackendCfg;
    123 #ifdef VBOX_WITH_AUDIO_CALLBACKS
    124     /** @todo Use a map with primary key set to the callback type? */
    125     RTLISTANCHOR            lstCBIn;
    126     RTLISTANCHOR            lstCBOut;
    127 #endif
    128117#ifdef VBOX_WITH_STATISTICS
    129118    /** Statistics for the statistics manager (STAM). */
     
    135124         *  This flag overrides all the attached stream statuses. */
    136125        bool                fEnabled;
     126        /** Max. number of free input streams.
     127         *  UINT32_MAX for unlimited streams. */
     128        uint32_t            cStreamsFree;
     129#ifdef VBOX_WITH_AUDIO_CALLBACKS
     130        RTLISTANCHOR        lstCB;
     131#endif
    137132    } In;
    138133    struct
     
    141136         *  This flag overrides all the attached stream statuses. */
    142137        bool                fEnabled;
     138        /** Max. number of free output streams.
     139         *  UINT32_MAX for unlimited streams. */
     140    uint32_t                cStreamsFree;
     141#ifdef VBOX_WITH_AUDIO_CALLBACKS
     142        RTLISTANCHOR        lstCB;
     143#endif
    143144    } Out;
    144145} DRVAUDIO, *PDRVAUDIO;
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