VirtualBox

Ignore:
Timestamp:
Apr 27, 2021 10:24:18 AM (4 years ago)
Author:
vboxsync
Message:

Audio: PDMAUDIOSTREAMSTS_FLAGS_XXX -> PDMAUDIOSTREAM_STS_XXX. bugref:9890

File:
1 edited

Legend:

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

    r88723 r88724  
    326326 * @param   fStatus     Stream status flags to convert.
    327327 */
    328 static const char *dbgAudioStreamStatusToStr(char pszDst[DRVAUDIO_STATUS_STR_MAX], PDMAUDIOSTREAMSTS fStatus)
     328static const char *dbgAudioStreamStatusToStr(char pszDst[DRVAUDIO_STATUS_STR_MAX], uint32_t fStatus)
    329329{
    330330    static const struct
     
    332332        const char         *pszMnemonic;
    333333        uint32_t            cchMnemnonic;
    334         PDMAUDIOSTREAMSTS   fFlag;
     334        uint32_t   fFlag;
    335335    } s_aFlags[] =
    336336    {
    337         { RT_STR_TUPLE("INITIALIZED "),     PDMAUDIOSTREAMSTS_FLAGS_INITIALIZED     },
    338         { RT_STR_TUPLE("ENABLED "),         PDMAUDIOSTREAMSTS_FLAGS_ENABLED         },
    339         { RT_STR_TUPLE("PAUSED "),          PDMAUDIOSTREAMSTS_FLAGS_PAUSED          },
    340         { RT_STR_TUPLE("PENDING_DISABLE "), PDMAUDIOSTREAMSTS_FLAGS_PENDING_DISABLE },
    341         { RT_STR_TUPLE("NEED_REINIT "),     PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT     },
     337        { RT_STR_TUPLE("INITIALIZED "),     PDMAUDIOSTREAM_STS_INITIALIZED     },
     338        { RT_STR_TUPLE("ENABLED "),         PDMAUDIOSTREAM_STS_ENABLED         },
     339        { RT_STR_TUPLE("PAUSED "),          PDMAUDIOSTREAM_STS_PAUSED          },
     340        { RT_STR_TUPLE("PENDING_DISABLE "), PDMAUDIOSTREAM_STS_PENDING_DISABLE },
     341        { RT_STR_TUPLE("NEED_REINIT "),     PDMAUDIOSTREAM_STS_NEED_REINIT     },
    342342    };
    343343    if (!fStatus)
     
    428428    LogFunc(("[%s]\n", pStreamEx->Core.szName));
    429429
    430     pStreamEx->Core.fStatus        = PDMAUDIOSTREAMSTS_FLAGS_INITIALIZED;
     430    pStreamEx->Core.fStatus        = PDMAUDIOSTREAM_STS_INITIALIZED;
    431431    pStreamEx->Core.fWarningsShown = PDMAUDIOSTREAM_WARN_FLAGS_NONE;
    432432
     
    469469            && pStreamEx->Core.cRefs >= 1)
    470470        {
    471             if (pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_PENDING_DISABLE)
     471            if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PENDING_DISABLE)
    472472            {
    473473                drvAudioStreamIterateInternal(pThis, pStreamEx);
    474474
    475                 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_PENDING_DISABLE)
     475                if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PENDING_DISABLE)
    476476                    cMilliesToNext = 10;
    477477            }
     
    995995                                               PPDMAUDIOSTREAMCFG pCfgReq, PPDMAUDIOSTREAMCFG pCfgAcq)
    996996{
    997     AssertMsg((pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_INITIALIZED) == 0,
     997    AssertMsg((pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_INITIALIZED) == 0,
    998998              ("Stream '%s' already initialized in backend\n", pStreamEx->Core.szName));
    999999
     
    10831083                    VERR_INVALID_PARAMETER);
    10841084
    1085     pStreamEx->Core.fStatus |= PDMAUDIOSTREAMSTS_FLAGS_INITIALIZED;
     1085    pStreamEx->Core.fStatus |= PDMAUDIOSTREAM_STS_INITIALIZED;
    10861086
    10871087    return VINF_SUCCESS;
     
    14871487    LogFunc(("[%s] fStatus=%s\n", pStreamEx->Core.szName, dbgAudioStreamStatusToStr(szStreamSts, pStreamEx->Core.fStatus)));
    14881488
    1489     if (pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_INITIALIZED)
     1489    if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_INITIALIZED)
    14901490    {
    14911491        AssertPtr(pStreamEx->pBackend);
     
    14961496            rc = pThis->pHostDrvAudio->pfnStreamDestroy(pThis->pHostDrvAudio, pStreamEx->pBackend);
    14971497
    1498         pStreamEx->Core.fStatus &= ~PDMAUDIOSTREAMSTS_FLAGS_INITIALIZED;
     1498        pStreamEx->Core.fStatus &= ~PDMAUDIOSTREAM_STS_INITIALIZED;
    14991499    }
    15001500
     
    15461546    {
    15471547#ifdef LOG_ENABLED
    1548         if (pStreamEx->Core.fStatus != PDMAUDIOSTREAMSTS_FLAGS_NONE)
     1548        if (pStreamEx->Core.fStatus != PDMAUDIOSTREAM_STS_NONE)
    15491549        {
    15501550            char szStreamSts[DRVAUDIO_STATUS_STR_MAX];
     
    15531553        }
    15541554#endif
    1555         pStreamEx->Core.fStatus = PDMAUDIOSTREAMSTS_FLAGS_NONE;
     1555        pStreamEx->Core.fStatus = PDMAUDIOSTREAM_STS_NONE;
    15561556    }
    15571557
     
    16611661     * Gather current stream status.
    16621662     */
    1663     const bool fIsEnabled = RT_BOOL(pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_ENABLED); /* Stream is enabled? */
     1663    const bool fIsEnabled = RT_BOOL(pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_ENABLED); /* Stream is enabled? */
    16641664
    16651665    /*
     
    17121712    AssertReturn(pStreamEx->Core.uMagic == PDMAUDIOSTREAM_MAGIC, VERR_INVALID_MAGIC);
    17131713    AssertReturn(pStreamEx->uMagic == DRVAUDIOSTREAM_MAGIC, VERR_INVALID_MAGIC);
    1714     AssertReturn(pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT, VERR_INVALID_STATE);
     1714    AssertReturn(pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_NEED_REINIT, VERR_INVALID_STATE);
    17151715    LogFlowFunc(("\n"));
    17161716
     
    17181718    AssertRCReturn(rc, rc);
    17191719
    1720     if (pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT)
     1720    if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_NEED_REINIT)
    17211721    {
    17221722        const unsigned cMaxTries = 3; /** @todo Make this configurable? */
     
    17491749            {
    17501750                /* Remove the pending re-init flag on success. */
    1751                 pStreamEx->Core.fStatus &= ~PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT;
     1751                pStreamEx->Core.fStatus &= ~PDMAUDIOSTREAM_STS_NEED_REINIT;
    17521752            }
    17531753            else
     
    17671767
    17681768                /* Don't try to re-initialize anymore and mark as disabled. */
    1769                 pStreamEx->Core.fStatus &= ~(PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT | PDMAUDIOSTREAMSTS_FLAGS_ENABLED);
     1769                pStreamEx->Core.fStatus &= ~(PDMAUDIOSTREAM_STS_NEED_REINIT | PDMAUDIOSTREAM_STS_ENABLED);
    17701770
    17711771                /* Note: Further writes to this stream go to / will be read from the bit bucket (/dev/null) from now on. */
     
    19551955        case PDMAUDIOSTREAMCMD_ENABLE:
    19561956        {
    1957             if (!(pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_ENABLED))
     1957            if (!(pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_ENABLED))
    19581958            {
    19591959                /* Is a pending disable outstanding? Then disable first. */
    1960                 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_PENDING_DISABLE)
     1960                if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PENDING_DISABLE)
    19611961                    rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_DISABLE);
    19621962
     
    19651965
    19661966                if (RT_SUCCESS(rc))
    1967                     pStreamEx->Core.fStatus |= PDMAUDIOSTREAMSTS_FLAGS_ENABLED;
     1967                    pStreamEx->Core.fStatus |= PDMAUDIOSTREAM_STS_ENABLED;
    19681968            }
    19691969            break;
     
    19721972        case PDMAUDIOSTREAMCMD_DISABLE:
    19731973        {
    1974             if (pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_ENABLED)
     1974            if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_ENABLED)
    19751975            {
    19761976                /*
     
    19821982                {
    19831983                    LogFunc(("[%s] Pending disable/pause\n", pStreamEx->Core.szName));
    1984                     pStreamEx->Core.fStatus |= PDMAUDIOSTREAMSTS_FLAGS_PENDING_DISABLE;
     1984                    pStreamEx->Core.fStatus |= PDMAUDIOSTREAM_STS_PENDING_DISABLE;
    19851985
    19861986                    /* Schedule a follow up timer to the pending-disable state.  We cannot rely
     
    19981998
    19991999                /* Can we close the host stream as well (not in pending disable mode)? */
    2000                 if (!(pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_PENDING_DISABLE))
     2000                if (!(pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PENDING_DISABLE))
    20012001                {
    20022002                    rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_DISABLE);
     
    20102010        case PDMAUDIOSTREAMCMD_PAUSE:
    20112011        {
    2012             if (!(pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_PAUSED))
     2012            if (!(pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PAUSED))
    20132013            {
    20142014                rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_PAUSE);
    20152015                if (RT_SUCCESS(rc))
    2016                     pStreamEx->Core.fStatus |= PDMAUDIOSTREAMSTS_FLAGS_PAUSED;
     2016                    pStreamEx->Core.fStatus |= PDMAUDIOSTREAM_STS_PAUSED;
    20172017            }
    20182018            break;
     
    20212021        case PDMAUDIOSTREAMCMD_RESUME:
    20222022        {
    2023             if (pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_PAUSED)
     2023            if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PAUSED)
    20242024            {
    20252025                rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_RESUME);
    20262026                if (RT_SUCCESS(rc))
    2027                     pStreamEx->Core.fStatus &= ~PDMAUDIOSTREAMSTS_FLAGS_PAUSED;
     2027                    pStreamEx->Core.fStatus &= ~PDMAUDIOSTREAM_STS_PAUSED;
    20282028            }
    20292029            break;
     
    21462146         * Try play "Windows Navigation Start.wav" on Windows 7 (2824 samples).
    21472147         */
    2148         else if (   (pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_PENDING_DISABLE)
     2148        else if (   (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PENDING_DISABLE)
    21492149                 && pStreamEx->Out.cbPreBuffered > 0)
    21502150        {
     
    22782278
    22792279    /* Not enabled or paused? Skip iteration. */
    2280     if (   !(pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_ENABLED)
    2281         ||  (pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_PAUSED))
     2280    if (   !(pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_ENABLED)
     2281        ||  (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PAUSED))
    22822282    {
    22832283        return VINF_SUCCESS;
     
    22882288     */
    22892289    int rc = VINF_SUCCESS;
    2290     if (!(pStreamEx->Core.fStatus & PDMAUDIOSTREAMSTS_FLAGS_PENDING_DISABLE))
     2290    if (!(pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PENDING_DISABLE))
    22912291    { /* likely until we get to the end of the stream at least. */ }
    22922292    else
     
    23482348                    if (RT_SUCCESS(rc))
    23492349                    {
    2350                         pStreamEx->Core.fStatus &= ~(PDMAUDIOSTREAMSTS_FLAGS_ENABLED | PDMAUDIOSTREAMSTS_FLAGS_PENDING_DISABLE);
     2350                        pStreamEx->Core.fStatus &= ~(PDMAUDIOSTREAM_STS_ENABLED | PDMAUDIOSTREAM_STS_PENDING_DISABLE);
    23512351                        drvAudioStreamDropInternal(pThis, pStreamEx); /* Not a DROP command, just a stream reset. */
    23522352                    }
     
    24412441             * Reading the actual data from a stream then will return silence then.
    24422442             */
    2443             PDMAUDIOSTREAMSTS fStatus = PDMAUDIOSTREAMSTS_FLAGS_NONE;
     2443            uint32_t fStatus = PDMAUDIOSTREAM_STS_NONE;
    24442444            if (pThis->pHostDrvAudio->pfnStreamGetStatus)
    24452445                fStatus = pThis->pHostDrvAudio->pfnStreamGetStatus(pThis->pHostDrvAudio, pStreamEx->pBackend);
     
    25452545 * @interface_method_impl{PDMIAUDIOCONNECTOR,pfnStreamGetStatus}
    25462546 */
    2547 static DECLCALLBACK(PDMAUDIOSTREAMSTS) drvAudioStreamGetStatus(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAM pStream)
     2547static DECLCALLBACK(uint32_t) drvAudioStreamGetStatus(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAM pStream)
    25482548{
    25492549    PDRVAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVAUDIO, IAudioConnector);
     
    25532553     *        this necessary? */
    25542554    if (!pStream)
    2555         return PDMAUDIOSTREAMSTS_FLAGS_NONE;
     2555        return PDMAUDIOSTREAM_STS_NONE;
    25562556    PDRVAUDIOSTREAM pStreamEx = (PDRVAUDIOSTREAM)pStream;
    2557     AssertPtrReturn(pStreamEx, PDMAUDIOSTREAMSTS_FLAGS_NONE);
    2558     AssertReturn(pStreamEx->Core.uMagic == PDMAUDIOSTREAM_MAGIC, PDMAUDIOSTREAMSTS_FLAGS_NONE);
    2559     AssertReturn(pStreamEx->uMagic      == DRVAUDIOSTREAM_MAGIC, PDMAUDIOSTREAMSTS_FLAGS_NONE);
     2557    AssertPtrReturn(pStreamEx, PDMAUDIOSTREAM_STS_NONE);
     2558    AssertReturn(pStreamEx->Core.uMagic == PDMAUDIOSTREAM_MAGIC, PDMAUDIOSTREAM_STS_NONE);
     2559    AssertReturn(pStreamEx->uMagic      == DRVAUDIOSTREAM_MAGIC, PDMAUDIOSTREAM_STS_NONE);
    25602560
    25612561    int rc = RTCritSectEnter(&pThis->CritSect);
    2562     AssertRCReturn(rc, PDMAUDIOSTREAMSTS_FLAGS_NONE);
    2563 
    2564     PDMAUDIOSTREAMSTS fStrmStatus = pStreamEx->Core.fStatus;
     2562    AssertRCReturn(rc, PDMAUDIOSTREAM_STS_NONE);
     2563
     2564    uint32_t fStrmStatus = pStreamEx->Core.fStatus;
    25652565
    25662566    RTCritSectLeave(&pThis->CritSect);
     
    30473047    RTListForEach(&pThis->lstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry)
    30483048    {
    3049         pStreamEx->Core.fStatus |= PDMAUDIOSTREAMSTS_FLAGS_NEED_REINIT;
     3049        pStreamEx->Core.fStatus |= PDMAUDIOSTREAM_STS_NEED_REINIT;
    30503050        pStreamEx->cTriesReInit  = 0;
    30513051        pStreamEx->nsLastReInit  = 0;
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