Changeset 88724 in vbox
- Timestamp:
- Apr 27, 2021 10:24:18 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmaudioifs.h
r88723 r88724 899 899 900 900 901 /** @name PDMAUDIOSTREAM STS_FLAGS_XXX901 /** @name PDMAUDIOSTREAM_STS_XXX 902 902 * @{ */ 903 903 /** No flags being set. */ 904 #define PDMAUDIOSTREAM STS_FLAGS_NONEUINT32_C(0)904 #define PDMAUDIOSTREAM_STS_NONE UINT32_C(0) 905 905 /** Whether this stream has been initialized by the backend or not. */ 906 #define PDMAUDIOSTREAM STS_FLAGS_INITIALIZEDRT_BIT_32(0)906 #define PDMAUDIOSTREAM_STS_INITIALIZED RT_BIT_32(0) 907 907 /** Whether this stream is enabled or disabled. */ 908 #define PDMAUDIOSTREAM STS_FLAGS_ENABLEDRT_BIT_32(1)908 #define PDMAUDIOSTREAM_STS_ENABLED RT_BIT_32(1) 909 909 /** Whether this stream has been paused or not. This also implies 910 910 * that this is an enabled stream! */ 911 #define PDMAUDIOSTREAM STS_FLAGS_PAUSEDRT_BIT_32(2)911 #define PDMAUDIOSTREAM_STS_PAUSED RT_BIT_32(2) 912 912 /** Indicates that the stream is draining (output only). 913 913 * Whether this stream was marked as being disabled 914 914 * but there are still associated guest output streams 915 915 * which rely on its data. */ 916 #define PDMAUDIOSTREAM STS_FLAGS_PENDING_DISABLERT_BIT_32(3)916 #define PDMAUDIOSTREAM_STS_PENDING_DISABLE RT_BIT_32(3) 917 917 /** Whether this stream is in re-initialization phase and requires the device 918 918 * to call pfnStreamReInit. … … 920 920 * All other bits remain untouched to be able to restore the stream's state 921 921 * after the re-initialization has been completed. */ 922 #define PDMAUDIOSTREAM STS_FLAGS_NEED_REINITRT_BIT_32(4)922 #define PDMAUDIOSTREAM_STS_NEED_REINIT RT_BIT_32(4) 923 923 /** Validation mask. */ 924 #define PDMAUDIOSTREAM STS_VALID_MASKUINT32_C(0x0000001F)925 /** Stream status flag, PDMAUDIOSTREAM STS_FLAGS_XXX. */926 typedef uint32_t PDMAUDIOSTREAMSTS;924 #define PDMAUDIOSTREAM_STS_VALID_MASK UINT32_C(0x0000001F) 925 /** Stream status flag, PDMAUDIOSTREAM_STS_XXX. */ 926 typedef uint32_t uint32_t; 927 927 /** @} */ 928 928 … … 975 975 uint32_t volatile cRefs; 976 976 /** Stream status flag. */ 977 PDMAUDIOSTREAMSTSfStatus;977 uint32_t fStatus; 978 978 /** Audio direction of this stream. */ 979 979 PDMAUDIODIR enmDir; … … 1092 1092 1093 1093 /** 1094 * Re-initializes the stream in response to PDMAUDIOSTREAM STS_FLAGS_NEED_REINIT.1094 * Re-initializes the stream in response to PDMAUDIOSTREAM_STS_NEED_REINIT. 1095 1095 * 1096 1096 * @returns VBox status code. … … 1162 1162 * @param pStream Pointer to audio stream. 1163 1163 */ 1164 DECLR3CALLBACKMEMBER( PDMAUDIOSTREAMSTS, pfnStreamGetStatus, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAM pStream));1164 DECLR3CALLBACKMEMBER(uint32_t, pfnStreamGetStatus, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAM pStream)); 1165 1165 1166 1166 /** … … 1375 1375 * Returns the current status of the given backend stream. 1376 1376 * 1377 * @returns PDMAUDIOSTREAMSTS1377 * @returns uint32_t 1378 1378 * @param pInterface Pointer to the interface structure containing the called function pointer. 1379 1379 * @param pStream Pointer to audio stream. 1380 1380 */ 1381 DECLR3CALLBACKMEMBER( PDMAUDIOSTREAMSTS, pfnStreamGetStatus, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream));1381 DECLR3CALLBACKMEMBER(uint32_t, pfnStreamGetStatus, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)); 1382 1382 1383 1383 /** -
trunk/include/VBox/vmm/pdmaudioinline.h
r88723 r88724 422 422 * 423 423 * @returns @c true if ready to be read from, @c false if not. 424 * @param fStatus Stream status to evaluate, PDMAUDIOSTREAM STS_FLAGS_XXX.425 */ 426 DECLINLINE(bool) PDMAudioStrmStatusCanRead( PDMAUDIOSTREAMSTSfStatus)427 { 428 AssertReturn(fStatus & PDMAUDIOSTREAM STS_VALID_MASK, false);424 * @param fStatus Stream status to evaluate, PDMAUDIOSTREAM_STS_XXX. 425 */ 426 DECLINLINE(bool) PDMAudioStrmStatusCanRead(uint32_t fStatus) 427 { 428 AssertReturn(fStatus & PDMAUDIOSTREAM_STS_VALID_MASK, false); 429 429 /* 430 return fStatus & PDMAUDIOSTREAM STS_FLAGS_INITIALIZED431 && fStatus & PDMAUDIOSTREAM STS_FLAGS_ENABLED432 && !(fStatus & PDMAUDIOSTREAM STS_FLAGS_PAUSED)430 return fStatus & PDMAUDIOSTREAM_STS_INITIALIZED 431 && fStatus & PDMAUDIOSTREAM_STS_ENABLED 432 && !(fStatus & PDMAUDIOSTREAM_STS_PAUSED) 433 433 && !(fStatus & PDMAUDIOSTREAMSTS_FLAGS_PENDING_REINIT);*/ 434 return (fStatus & ( PDMAUDIOSTREAM STS_FLAGS_INITIALIZED435 | PDMAUDIOSTREAM STS_FLAGS_ENABLED436 | PDMAUDIOSTREAM STS_FLAGS_PAUSED437 | PDMAUDIOSTREAM STS_FLAGS_NEED_REINIT ))438 == ( PDMAUDIOSTREAM STS_FLAGS_INITIALIZED439 | PDMAUDIOSTREAM STS_FLAGS_ENABLED);434 return (fStatus & ( PDMAUDIOSTREAM_STS_INITIALIZED 435 | PDMAUDIOSTREAM_STS_ENABLED 436 | PDMAUDIOSTREAM_STS_PAUSED 437 | PDMAUDIOSTREAM_STS_NEED_REINIT )) 438 == ( PDMAUDIOSTREAM_STS_INITIALIZED 439 | PDMAUDIOSTREAM_STS_ENABLED); 440 440 } 441 441 … … 444 444 * 445 445 * @returns @c true if ready to be written to, @c false if not. 446 * @param fStatus Stream status to evaluate, PDMAUDIOSTREAM STS_FLAGS_XXX.447 */ 448 DECLINLINE(bool) PDMAudioStrmStatusCanWrite( PDMAUDIOSTREAMSTSfStatus)449 { 450 AssertReturn(fStatus & PDMAUDIOSTREAM STS_VALID_MASK, false);446 * @param fStatus Stream status to evaluate, PDMAUDIOSTREAM_STS_XXX. 447 */ 448 DECLINLINE(bool) PDMAudioStrmStatusCanWrite(uint32_t fStatus) 449 { 450 AssertReturn(fStatus & PDMAUDIOSTREAM_STS_VALID_MASK, false); 451 451 /* 452 return fStatus & PDMAUDIOSTREAM STS_FLAGS_INITIALIZED453 && fStatus & PDMAUDIOSTREAM STS_FLAGS_ENABLED454 && !(fStatus & PDMAUDIOSTREAM STS_FLAGS_PAUSED)455 && !(fStatus & PDMAUDIOSTREAM STS_FLAGS_PENDING_DISABLE)452 return fStatus & PDMAUDIOSTREAM_STS_INITIALIZED 453 && fStatus & PDMAUDIOSTREAM_STS_ENABLED 454 && !(fStatus & PDMAUDIOSTREAM_STS_PAUSED) 455 && !(fStatus & PDMAUDIOSTREAM_STS_PENDING_DISABLE) 456 456 && !(fStatus & PDMAUDIOSTREAMSTS_FLAGS_PENDING_REINIT);*/ 457 return (fStatus & ( PDMAUDIOSTREAM STS_FLAGS_INITIALIZED458 | PDMAUDIOSTREAM STS_FLAGS_ENABLED459 | PDMAUDIOSTREAM STS_FLAGS_PAUSED460 | PDMAUDIOSTREAM STS_FLAGS_PENDING_DISABLE461 | PDMAUDIOSTREAM STS_FLAGS_NEED_REINIT))462 == ( PDMAUDIOSTREAM STS_FLAGS_INITIALIZED463 | PDMAUDIOSTREAM STS_FLAGS_ENABLED);457 return (fStatus & ( PDMAUDIOSTREAM_STS_INITIALIZED 458 | PDMAUDIOSTREAM_STS_ENABLED 459 | PDMAUDIOSTREAM_STS_PAUSED 460 | PDMAUDIOSTREAM_STS_PENDING_DISABLE 461 | PDMAUDIOSTREAM_STS_NEED_REINIT)) 462 == ( PDMAUDIOSTREAM_STS_INITIALIZED 463 | PDMAUDIOSTREAM_STS_ENABLED); 464 464 } 465 465 … … 468 468 * 469 469 * @returns @c true if ready to operate, @c false if not. 470 * @param fStatus Stream status to evaluate, PDMAUDIOSTREAM STS_FLAGS_XXX.471 */ 472 DECLINLINE(bool) PDMAudioStrmStatusIsReady( PDMAUDIOSTREAMSTSfStatus)473 { 474 AssertReturn(fStatus & PDMAUDIOSTREAM STS_VALID_MASK, false);470 * @param fStatus Stream status to evaluate, PDMAUDIOSTREAM_STS_XXX. 471 */ 472 DECLINLINE(bool) PDMAudioStrmStatusIsReady(uint32_t fStatus) 473 { 474 AssertReturn(fStatus & PDMAUDIOSTREAM_STS_VALID_MASK, false); 475 475 /* 476 return fStatus & PDMAUDIOSTREAM STS_FLAGS_INITIALIZED477 && fStatus & PDMAUDIOSTREAM STS_FLAGS_ENABLED476 return fStatus & PDMAUDIOSTREAM_STS_INITIALIZED 477 && fStatus & PDMAUDIOSTREAM_STS_ENABLED 478 478 && !(fStatus & PDMAUDIOSTREAMSTS_FLAGS_PENDING_REINIT);*/ 479 return (fStatus & ( PDMAUDIOSTREAM STS_FLAGS_INITIALIZED480 | PDMAUDIOSTREAM STS_FLAGS_ENABLED481 | PDMAUDIOSTREAM STS_FLAGS_NEED_REINIT))482 == ( PDMAUDIOSTREAM STS_FLAGS_INITIALIZED483 | PDMAUDIOSTREAM STS_FLAGS_ENABLED);479 return (fStatus & ( PDMAUDIOSTREAM_STS_INITIALIZED 480 | PDMAUDIOSTREAM_STS_ENABLED 481 | PDMAUDIOSTREAM_STS_NEED_REINIT)) 482 == ( PDMAUDIOSTREAM_STS_INITIALIZED 483 | PDMAUDIOSTREAM_STS_ENABLED); 484 484 } 485 485 -
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r88723 r88724 1734 1734 if (pMixStream->fStatus & AUDMIXSTREAM_STATUS_ENABLED) 1735 1735 { 1736 PDMAUDIOSTREAMSTSconst fSts = pMixStream->pConn->pfnStreamGetStatus(pMixStream->pConn, pMixStream->pStream);1737 if (fSts & (PDMAUDIOSTREAM STS_FLAGS_ENABLED | PDMAUDIOSTREAMSTS_FLAGS_PENDING_DISABLE))1736 uint32_t const fSts = pMixStream->pConn->pfnStreamGetStatus(pMixStream->pConn, pMixStream->pStream); 1737 if (fSts & (PDMAUDIOSTREAM_STS_ENABLED | PDMAUDIOSTREAM_STS_PENDING_DISABLE)) 1738 1738 cStreamsDisabled--; 1739 1739 } … … 1899 1899 if (pMixStream->fStatus & AUDMIXSTREAM_STATUS_ENABLED) 1900 1900 { 1901 PDMAUDIOSTREAMSTSconst fSts = pMixStream->pConn->pfnStreamGetStatus(pMixStream->pConn, pMixStream->pStream);1902 if (fSts & (PDMAUDIOSTREAM STS_FLAGS_ENABLED | PDMAUDIOSTREAMSTS_FLAGS_PENDING_DISABLE))1901 uint32_t const fSts = pMixStream->pConn->pfnStreamGetStatus(pMixStream->pConn, pMixStream->pStream); 1902 if (fSts & (PDMAUDIOSTREAM_STS_ENABLED | PDMAUDIOSTREAM_STS_PENDING_DISABLE)) 1903 1903 cStreamsDisabled--; 1904 1904 } … … 2103 2103 */ 2104 2104 uint32_t fStreamStatus = pConn->pfnStreamGetStatus(pConn, pStream); 2105 if (!(fStreamStatus & PDMAUDIOSTREAM STS_FLAGS_NEED_REINIT))2105 if (!(fStreamStatus & PDMAUDIOSTREAM_STS_NEED_REINIT)) 2106 2106 { /* likely */ } 2107 2107 else … … 2279 2279 if ( pMixStream->pConn 2280 2280 && pMixStream->pStream 2281 && RT_BOOL(pMixStream->pConn->pfnStreamGetStatus(pMixStream->pConn, pMixStream->pStream) & PDMAUDIOSTREAMSTS_FLAGS_ENABLED)) 2282 { 2281 && (pMixStream->pConn->pfnStreamGetStatus(pMixStream->pConn, pMixStream->pStream) & PDMAUDIOSTREAM_STS_ENABLED)) 2283 2282 fIsActive = true; 2284 }2285 2283 else 2286 2284 fIsActive = false; … … 2311 2309 if ( pMixStream->pConn 2312 2310 && pMixStream->pStream 2313 && RT_BOOL(pMixStream->pConn->pfnStreamGetStatus(pMixStream->pConn, pMixStream->pStream) & PDMAUDIOSTREAMSTS_FLAGS_INITIALIZED)) 2314 { 2311 && (pMixStream->pConn->pfnStreamGetStatus(pMixStream->pConn, pMixStream->pStream) & PDMAUDIOSTREAM_STS_INITIALIZED)) 2315 2312 fIsValid = true; 2316 }2317 2313 else 2318 2314 fIsValid = false; -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r88723 r88724 326 326 * @param fStatus Stream status flags to convert. 327 327 */ 328 static const char *dbgAudioStreamStatusToStr(char pszDst[DRVAUDIO_STATUS_STR_MAX], PDMAUDIOSTREAMSTSfStatus)328 static const char *dbgAudioStreamStatusToStr(char pszDst[DRVAUDIO_STATUS_STR_MAX], uint32_t fStatus) 329 329 { 330 330 static const struct … … 332 332 const char *pszMnemonic; 333 333 uint32_t cchMnemnonic; 334 PDMAUDIOSTREAMSTSfFlag;334 uint32_t fFlag; 335 335 } s_aFlags[] = 336 336 { 337 { RT_STR_TUPLE("INITIALIZED "), PDMAUDIOSTREAM STS_FLAGS_INITIALIZED },338 { RT_STR_TUPLE("ENABLED "), PDMAUDIOSTREAM STS_FLAGS_ENABLED },339 { RT_STR_TUPLE("PAUSED "), PDMAUDIOSTREAM STS_FLAGS_PAUSED },340 { RT_STR_TUPLE("PENDING_DISABLE "), PDMAUDIOSTREAM STS_FLAGS_PENDING_DISABLE },341 { RT_STR_TUPLE("NEED_REINIT "), PDMAUDIOSTREAM STS_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 }, 342 342 }; 343 343 if (!fStatus) … … 428 428 LogFunc(("[%s]\n", pStreamEx->Core.szName)); 429 429 430 pStreamEx->Core.fStatus = PDMAUDIOSTREAM STS_FLAGS_INITIALIZED;430 pStreamEx->Core.fStatus = PDMAUDIOSTREAM_STS_INITIALIZED; 431 431 pStreamEx->Core.fWarningsShown = PDMAUDIOSTREAM_WARN_FLAGS_NONE; 432 432 … … 469 469 && pStreamEx->Core.cRefs >= 1) 470 470 { 471 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM STS_FLAGS_PENDING_DISABLE)471 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PENDING_DISABLE) 472 472 { 473 473 drvAudioStreamIterateInternal(pThis, pStreamEx); 474 474 475 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM STS_FLAGS_PENDING_DISABLE)475 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PENDING_DISABLE) 476 476 cMilliesToNext = 10; 477 477 } … … 995 995 PPDMAUDIOSTREAMCFG pCfgReq, PPDMAUDIOSTREAMCFG pCfgAcq) 996 996 { 997 AssertMsg((pStreamEx->Core.fStatus & PDMAUDIOSTREAM STS_FLAGS_INITIALIZED) == 0,997 AssertMsg((pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_INITIALIZED) == 0, 998 998 ("Stream '%s' already initialized in backend\n", pStreamEx->Core.szName)); 999 999 … … 1083 1083 VERR_INVALID_PARAMETER); 1084 1084 1085 pStreamEx->Core.fStatus |= PDMAUDIOSTREAM STS_FLAGS_INITIALIZED;1085 pStreamEx->Core.fStatus |= PDMAUDIOSTREAM_STS_INITIALIZED; 1086 1086 1087 1087 return VINF_SUCCESS; … … 1487 1487 LogFunc(("[%s] fStatus=%s\n", pStreamEx->Core.szName, dbgAudioStreamStatusToStr(szStreamSts, pStreamEx->Core.fStatus))); 1488 1488 1489 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM STS_FLAGS_INITIALIZED)1489 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_INITIALIZED) 1490 1490 { 1491 1491 AssertPtr(pStreamEx->pBackend); … … 1496 1496 rc = pThis->pHostDrvAudio->pfnStreamDestroy(pThis->pHostDrvAudio, pStreamEx->pBackend); 1497 1497 1498 pStreamEx->Core.fStatus &= ~PDMAUDIOSTREAM STS_FLAGS_INITIALIZED;1498 pStreamEx->Core.fStatus &= ~PDMAUDIOSTREAM_STS_INITIALIZED; 1499 1499 } 1500 1500 … … 1546 1546 { 1547 1547 #ifdef LOG_ENABLED 1548 if (pStreamEx->Core.fStatus != PDMAUDIOSTREAM STS_FLAGS_NONE)1548 if (pStreamEx->Core.fStatus != PDMAUDIOSTREAM_STS_NONE) 1549 1549 { 1550 1550 char szStreamSts[DRVAUDIO_STATUS_STR_MAX]; … … 1553 1553 } 1554 1554 #endif 1555 pStreamEx->Core.fStatus = PDMAUDIOSTREAM STS_FLAGS_NONE;1555 pStreamEx->Core.fStatus = PDMAUDIOSTREAM_STS_NONE; 1556 1556 } 1557 1557 … … 1661 1661 * Gather current stream status. 1662 1662 */ 1663 const bool fIsEnabled = RT_BOOL(pStreamEx->Core.fStatus & PDMAUDIOSTREAM STS_FLAGS_ENABLED); /* Stream is enabled? */1663 const bool fIsEnabled = RT_BOOL(pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_ENABLED); /* Stream is enabled? */ 1664 1664 1665 1665 /* … … 1712 1712 AssertReturn(pStreamEx->Core.uMagic == PDMAUDIOSTREAM_MAGIC, VERR_INVALID_MAGIC); 1713 1713 AssertReturn(pStreamEx->uMagic == DRVAUDIOSTREAM_MAGIC, VERR_INVALID_MAGIC); 1714 AssertReturn(pStreamEx->Core.fStatus & PDMAUDIOSTREAM STS_FLAGS_NEED_REINIT, VERR_INVALID_STATE);1714 AssertReturn(pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_NEED_REINIT, VERR_INVALID_STATE); 1715 1715 LogFlowFunc(("\n")); 1716 1716 … … 1718 1718 AssertRCReturn(rc, rc); 1719 1719 1720 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM STS_FLAGS_NEED_REINIT)1720 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_NEED_REINIT) 1721 1721 { 1722 1722 const unsigned cMaxTries = 3; /** @todo Make this configurable? */ … … 1749 1749 { 1750 1750 /* Remove the pending re-init flag on success. */ 1751 pStreamEx->Core.fStatus &= ~PDMAUDIOSTREAM STS_FLAGS_NEED_REINIT;1751 pStreamEx->Core.fStatus &= ~PDMAUDIOSTREAM_STS_NEED_REINIT; 1752 1752 } 1753 1753 else … … 1767 1767 1768 1768 /* Don't try to re-initialize anymore and mark as disabled. */ 1769 pStreamEx->Core.fStatus &= ~(PDMAUDIOSTREAM STS_FLAGS_NEED_REINIT | PDMAUDIOSTREAMSTS_FLAGS_ENABLED);1769 pStreamEx->Core.fStatus &= ~(PDMAUDIOSTREAM_STS_NEED_REINIT | PDMAUDIOSTREAM_STS_ENABLED); 1770 1770 1771 1771 /* Note: Further writes to this stream go to / will be read from the bit bucket (/dev/null) from now on. */ … … 1955 1955 case PDMAUDIOSTREAMCMD_ENABLE: 1956 1956 { 1957 if (!(pStreamEx->Core.fStatus & PDMAUDIOSTREAM STS_FLAGS_ENABLED))1957 if (!(pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_ENABLED)) 1958 1958 { 1959 1959 /* Is a pending disable outstanding? Then disable first. */ 1960 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM STS_FLAGS_PENDING_DISABLE)1960 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PENDING_DISABLE) 1961 1961 rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_DISABLE); 1962 1962 … … 1965 1965 1966 1966 if (RT_SUCCESS(rc)) 1967 pStreamEx->Core.fStatus |= PDMAUDIOSTREAM STS_FLAGS_ENABLED;1967 pStreamEx->Core.fStatus |= PDMAUDIOSTREAM_STS_ENABLED; 1968 1968 } 1969 1969 break; … … 1972 1972 case PDMAUDIOSTREAMCMD_DISABLE: 1973 1973 { 1974 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM STS_FLAGS_ENABLED)1974 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_ENABLED) 1975 1975 { 1976 1976 /* … … 1982 1982 { 1983 1983 LogFunc(("[%s] Pending disable/pause\n", pStreamEx->Core.szName)); 1984 pStreamEx->Core.fStatus |= PDMAUDIOSTREAM STS_FLAGS_PENDING_DISABLE;1984 pStreamEx->Core.fStatus |= PDMAUDIOSTREAM_STS_PENDING_DISABLE; 1985 1985 1986 1986 /* Schedule a follow up timer to the pending-disable state. We cannot rely … … 1998 1998 1999 1999 /* Can we close the host stream as well (not in pending disable mode)? */ 2000 if (!(pStreamEx->Core.fStatus & PDMAUDIOSTREAM STS_FLAGS_PENDING_DISABLE))2000 if (!(pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PENDING_DISABLE)) 2001 2001 { 2002 2002 rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_DISABLE); … … 2010 2010 case PDMAUDIOSTREAMCMD_PAUSE: 2011 2011 { 2012 if (!(pStreamEx->Core.fStatus & PDMAUDIOSTREAM STS_FLAGS_PAUSED))2012 if (!(pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PAUSED)) 2013 2013 { 2014 2014 rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_PAUSE); 2015 2015 if (RT_SUCCESS(rc)) 2016 pStreamEx->Core.fStatus |= PDMAUDIOSTREAM STS_FLAGS_PAUSED;2016 pStreamEx->Core.fStatus |= PDMAUDIOSTREAM_STS_PAUSED; 2017 2017 } 2018 2018 break; … … 2021 2021 case PDMAUDIOSTREAMCMD_RESUME: 2022 2022 { 2023 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM STS_FLAGS_PAUSED)2023 if (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PAUSED) 2024 2024 { 2025 2025 rc = drvAudioStreamControlInternalBackend(pThis, pStreamEx, PDMAUDIOSTREAMCMD_RESUME); 2026 2026 if (RT_SUCCESS(rc)) 2027 pStreamEx->Core.fStatus &= ~PDMAUDIOSTREAM STS_FLAGS_PAUSED;2027 pStreamEx->Core.fStatus &= ~PDMAUDIOSTREAM_STS_PAUSED; 2028 2028 } 2029 2029 break; … … 2146 2146 * Try play "Windows Navigation Start.wav" on Windows 7 (2824 samples). 2147 2147 */ 2148 else if ( (pStreamEx->Core.fStatus & PDMAUDIOSTREAM STS_FLAGS_PENDING_DISABLE)2148 else if ( (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PENDING_DISABLE) 2149 2149 && pStreamEx->Out.cbPreBuffered > 0) 2150 2150 { … … 2278 2278 2279 2279 /* Not enabled or paused? Skip iteration. */ 2280 if ( !(pStreamEx->Core.fStatus & PDMAUDIOSTREAM STS_FLAGS_ENABLED)2281 || (pStreamEx->Core.fStatus & PDMAUDIOSTREAM STS_FLAGS_PAUSED))2280 if ( !(pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_ENABLED) 2281 || (pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PAUSED)) 2282 2282 { 2283 2283 return VINF_SUCCESS; … … 2288 2288 */ 2289 2289 int rc = VINF_SUCCESS; 2290 if (!(pStreamEx->Core.fStatus & PDMAUDIOSTREAM STS_FLAGS_PENDING_DISABLE))2290 if (!(pStreamEx->Core.fStatus & PDMAUDIOSTREAM_STS_PENDING_DISABLE)) 2291 2291 { /* likely until we get to the end of the stream at least. */ } 2292 2292 else … … 2348 2348 if (RT_SUCCESS(rc)) 2349 2349 { 2350 pStreamEx->Core.fStatus &= ~(PDMAUDIOSTREAM STS_FLAGS_ENABLED | PDMAUDIOSTREAMSTS_FLAGS_PENDING_DISABLE);2350 pStreamEx->Core.fStatus &= ~(PDMAUDIOSTREAM_STS_ENABLED | PDMAUDIOSTREAM_STS_PENDING_DISABLE); 2351 2351 drvAudioStreamDropInternal(pThis, pStreamEx); /* Not a DROP command, just a stream reset. */ 2352 2352 } … … 2441 2441 * Reading the actual data from a stream then will return silence then. 2442 2442 */ 2443 PDMAUDIOSTREAMSTS fStatus = PDMAUDIOSTREAMSTS_FLAGS_NONE;2443 uint32_t fStatus = PDMAUDIOSTREAM_STS_NONE; 2444 2444 if (pThis->pHostDrvAudio->pfnStreamGetStatus) 2445 2445 fStatus = pThis->pHostDrvAudio->pfnStreamGetStatus(pThis->pHostDrvAudio, pStreamEx->pBackend); … … 2545 2545 * @interface_method_impl{PDMIAUDIOCONNECTOR,pfnStreamGetStatus} 2546 2546 */ 2547 static DECLCALLBACK( PDMAUDIOSTREAMSTS) drvAudioStreamGetStatus(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAM pStream)2547 static DECLCALLBACK(uint32_t) drvAudioStreamGetStatus(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAM pStream) 2548 2548 { 2549 2549 PDRVAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVAUDIO, IAudioConnector); … … 2553 2553 * this necessary? */ 2554 2554 if (!pStream) 2555 return PDMAUDIOSTREAM STS_FLAGS_NONE;2555 return PDMAUDIOSTREAM_STS_NONE; 2556 2556 PDRVAUDIOSTREAM pStreamEx = (PDRVAUDIOSTREAM)pStream; 2557 AssertPtrReturn(pStreamEx, PDMAUDIOSTREAM STS_FLAGS_NONE);2558 AssertReturn(pStreamEx->Core.uMagic == PDMAUDIOSTREAM_MAGIC, PDMAUDIOSTREAM STS_FLAGS_NONE);2559 AssertReturn(pStreamEx->uMagic == DRVAUDIOSTREAM_MAGIC, PDMAUDIOSTREAM STS_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); 2560 2560 2561 2561 int rc = RTCritSectEnter(&pThis->CritSect); 2562 AssertRCReturn(rc, PDMAUDIOSTREAM STS_FLAGS_NONE);2563 2564 PDMAUDIOSTREAMSTSfStrmStatus = pStreamEx->Core.fStatus;2562 AssertRCReturn(rc, PDMAUDIOSTREAM_STS_NONE); 2563 2564 uint32_t fStrmStatus = pStreamEx->Core.fStatus; 2565 2565 2566 2566 RTCritSectLeave(&pThis->CritSect); … … 3047 3047 RTListForEach(&pThis->lstStreams, pStreamEx, DRVAUDIOSTREAM, ListEntry) 3048 3048 { 3049 pStreamEx->Core.fStatus |= PDMAUDIOSTREAM STS_FLAGS_NEED_REINIT;3049 pStreamEx->Core.fStatus |= PDMAUDIOSTREAM_STS_NEED_REINIT; 3050 3050 pStreamEx->cTriesReInit = 0; 3051 3051 pStreamEx->nsLastReInit = 0; -
trunk/src/VBox/Devices/Audio/DrvHostAudioAlsa.cpp
r88718 r88724 1120 1120 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetStatus} 1121 1121 */ 1122 static DECLCALLBACK( PDMAUDIOSTREAMSTS) drvHostAlsaAudioHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)1122 static DECLCALLBACK(uint32_t) drvHostAlsaAudioHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 1123 1123 { 1124 1124 RT_NOREF(pInterface, pStream); 1125 1125 1126 return PDMAUDIOSTREAM STS_FLAGS_INITIALIZED | PDMAUDIOSTREAMSTS_FLAGS_ENABLED;1126 return PDMAUDIOSTREAM_STS_INITIALIZED | PDMAUDIOSTREAM_STS_ENABLED; 1127 1127 } 1128 1128 -
trunk/src/VBox/Devices/Audio/DrvHostAudioCoreAudio.cpp
r88718 r88724 2426 2426 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetStatus} 2427 2427 */ 2428 static DECLCALLBACK( PDMAUDIOSTREAMSTS) drvHostCoreAudioHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)2428 static DECLCALLBACK(uint32_t) drvHostCoreAudioHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 2429 2429 { 2430 2430 RT_NOREF(pInterface); … … 2433 2433 PCOREAUDIOSTREAM pCAStream = (PCOREAUDIOSTREAM)pStream; 2434 2434 2435 PDMAUDIOSTREAMSTS fStrmStatus = PDMAUDIOSTREAMSTS_FLAGS_NONE;2435 uint32_t fStrmStatus = PDMAUDIOSTREAM_STS_NONE; 2436 2436 2437 2437 if (pCAStream->pCfg) /* Configured? */ 2438 2438 { 2439 2439 if (ASMAtomicReadU32(&pCAStream->enmStatus) == COREAUDIOSTATUS_INIT) 2440 fStrmStatus |= PDMAUDIOSTREAM STS_FLAGS_INITIALIZED | PDMAUDIOSTREAMSTS_FLAGS_ENABLED;2440 fStrmStatus |= PDMAUDIOSTREAM_STS_INITIALIZED | PDMAUDIOSTREAM_STS_ENABLED; 2441 2441 } 2442 2442 -
trunk/src/VBox/Devices/Audio/DrvHostAudioDSound.cpp
r88718 r88724 2404 2404 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetStatus} 2405 2405 */ 2406 static DECLCALLBACK( PDMAUDIOSTREAMSTS) drvHostDSoundHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)2406 static DECLCALLBACK(uint32_t) drvHostDSoundHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 2407 2407 { 2408 2408 RT_NOREF(pInterface); 2409 2409 PDSOUNDSTREAM pStreamDS = (PDSOUNDSTREAM)pStream; 2410 AssertPtrReturn(pStreamDS, PDMAUDIOSTREAM STS_FLAGS_NONE);2411 2412 PDMAUDIOSTREAMSTS fStrmStatus = PDMAUDIOSTREAMSTS_FLAGS_INITIALIZED;2410 AssertPtrReturn(pStreamDS, PDMAUDIOSTREAM_STS_NONE); 2411 2412 uint32_t fStrmStatus = PDMAUDIOSTREAM_STS_INITIALIZED; 2413 2413 if (pStreamDS->fEnabled) 2414 fStrmStatus |= PDMAUDIOSTREAM STS_FLAGS_ENABLED;2414 fStrmStatus |= PDMAUDIOSTREAM_STS_ENABLED; 2415 2415 2416 2416 LogFlowFunc(("returns %#x for '%s' {%s}\n", fStrmStatus, pStreamDS->Cfg.szName, drvHostDSoundStreamStatusString(pStreamDS))); -
trunk/src/VBox/Devices/Audio/DrvHostAudioDebug.cpp
r88718 r88724 263 263 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetWritable} 264 264 */ 265 static DECLCALLBACK( PDMAUDIOSTREAMSTS) drvHostDebugAudioHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)265 static DECLCALLBACK(uint32_t) drvHostDebugAudioHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 266 266 { 267 267 RT_NOREF(pInterface, pStream); 268 return PDMAUDIOSTREAM STS_FLAGS_INITIALIZED | PDMAUDIOSTREAMSTS_FLAGS_ENABLED;268 return PDMAUDIOSTREAM_STS_INITIALIZED | PDMAUDIOSTREAM_STS_ENABLED; 269 269 } 270 270 -
trunk/src/VBox/Devices/Audio/DrvHostAudioNull.cpp
r88718 r88724 183 183 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetStatus} 184 184 */ 185 static DECLCALLBACK( PDMAUDIOSTREAMSTS) drvHostNullAudioHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)186 { 187 RT_NOREF(pInterface, pStream); 188 return PDMAUDIOSTREAM STS_FLAGS_INITIALIZED | PDMAUDIOSTREAMSTS_FLAGS_ENABLED;185 static DECLCALLBACK(uint32_t) drvHostNullAudioHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 186 { 187 RT_NOREF(pInterface, pStream); 188 return PDMAUDIOSTREAM_STS_INITIALIZED | PDMAUDIOSTREAM_STS_ENABLED; 189 189 } 190 190 -
trunk/src/VBox/Devices/Audio/DrvHostAudioOss.cpp
r88718 r88724 701 701 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetStatus} 702 702 */ 703 static DECLCALLBACK( PDMAUDIOSTREAMSTS) drvHostOssAudioHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)703 static DECLCALLBACK(uint32_t) drvHostOssAudioHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 704 704 { 705 705 RT_NOREF(pInterface, pStream); 706 return PDMAUDIOSTREAM STS_FLAGS_INITIALIZED | PDMAUDIOSTREAMSTS_FLAGS_ENABLED;706 return PDMAUDIOSTREAM_STS_INITIALIZED | PDMAUDIOSTREAM_STS_ENABLED; 707 707 } 708 708 -
trunk/src/VBox/Devices/Audio/DrvHostAudioPulseAudio.cpp
r88718 r88724 1549 1549 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetStatus} 1550 1550 */ 1551 static DECLCALLBACK( PDMAUDIOSTREAMSTS) drvHostAudioPaHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)1551 static DECLCALLBACK(uint32_t) drvHostAudioPaHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 1552 1552 { 1553 1553 PDRVHOSTPULSEAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVHOSTPULSEAUDIO, IHostAudio); … … 1561 1561 { 1562 1562 /** @todo should we check the actual stream state? */ 1563 return PDMAUDIOSTREAM STS_FLAGS_INITIALIZED | PDMAUDIOSTREAMSTS_FLAGS_ENABLED;1563 return PDMAUDIOSTREAM_STS_INITIALIZED | PDMAUDIOSTREAM_STS_ENABLED; 1564 1564 } 1565 1565 LogFunc(("non-good context state: %d\n", enmState)); … … 1567 1567 else 1568 1568 LogFunc(("No context!\n")); 1569 return PDMAUDIOSTREAM STS_FLAGS_NONE;1569 return PDMAUDIOSTREAM_STS_NONE; 1570 1570 } 1571 1571 -
trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp
r88718 r88724 334 334 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetStatus} 335 335 */ 336 static DECLCALLBACK(PDMAUDIOSTREAMSTS) drvHostValKitAudioHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, 337 PPDMAUDIOBACKENDSTREAM pStream) 336 static DECLCALLBACK(uint32_t) drvHostValKitAudioHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 338 337 { 339 338 RT_NOREF(pInterface, pStream); 340 return PDMAUDIOSTREAM STS_FLAGS_INITIALIZED | PDMAUDIOSTREAMSTS_FLAGS_ENABLED;339 return PDMAUDIOSTREAM_STS_INITIALIZED | PDMAUDIOSTREAM_STS_ENABLED; 341 340 } 342 341 -
trunk/src/VBox/Devices/Audio/DrvHostAudioWasApi.cpp
r88718 r88724 2081 2081 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetStatus} 2082 2082 */ 2083 static DECLCALLBACK( PDMAUDIOSTREAMSTS) drvHostAudioWasHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)2083 static DECLCALLBACK(uint32_t) drvHostAudioWasHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 2084 2084 { 2085 2085 RT_NOREF(pInterface); 2086 2086 PDRVHOSTAUDIOWASSTREAM pStreamWas = (PDRVHOSTAUDIOWASSTREAM)pStream; 2087 AssertPtrReturn(pStreamWas, PDMAUDIOSTREAM STS_FLAGS_NONE);2088 2089 PDMAUDIOSTREAMSTS fStrmStatus = PDMAUDIOSTREAMSTS_FLAGS_INITIALIZED;2087 AssertPtrReturn(pStreamWas, PDMAUDIOSTREAM_STS_NONE); 2088 2089 uint32_t fStrmStatus = PDMAUDIOSTREAM_STS_INITIALIZED; 2090 2090 if (pStreamWas->fEnabled) 2091 fStrmStatus |= PDMAUDIOSTREAM STS_FLAGS_ENABLED;2091 fStrmStatus |= PDMAUDIOSTREAM_STS_ENABLED; 2092 2092 if (pStreamWas->fDraining) 2093 fStrmStatus |= PDMAUDIOSTREAM STS_FLAGS_PENDING_DISABLE;2093 fStrmStatus |= PDMAUDIOSTREAM_STS_PENDING_DISABLE; 2094 2094 if (pStreamWas->fRestartOnResume) 2095 fStrmStatus |= PDMAUDIOSTREAM STS_FLAGS_PAUSED;2095 fStrmStatus |= PDMAUDIOSTREAM_STS_PAUSED; 2096 2096 2097 2097 LogFlowFunc(("returns %#x for '%s' {%s}\n", fStrmStatus, pStreamWas->Cfg.szName, drvHostWasStreamStatusString(pStreamWas))); -
trunk/src/VBox/Main/src-client/DrvAudioRec.cpp
r88718 r88724 611 611 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetStatus} 612 612 */ 613 static DECLCALLBACK(PDMAUDIOSTREAMSTS) drvAudioVideoRecHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, 614 PPDMAUDIOBACKENDSTREAM pStream) 613 static DECLCALLBACK(uint32_t) drvAudioVideoRecHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 615 614 { 616 615 RT_NOREF(pInterface, pStream); 617 return PDMAUDIOSTREAM STS_FLAGS_INITIALIZED | PDMAUDIOSTREAMSTS_FLAGS_ENABLED;616 return PDMAUDIOSTREAM_STS_INITIALIZED | PDMAUDIOSTREAM_STS_ENABLED; 618 617 } 619 618 -
trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp
r88718 r88724 531 531 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetStatus} 532 532 */ 533 static DECLCALLBACK( PDMAUDIOSTREAMSTS) drvAudioVrdeHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)533 static DECLCALLBACK(uint32_t) drvAudioVrdeHA_StreamGetStatus(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 534 534 { 535 535 PDRVAUDIOVRDE pDrv = RT_FROM_MEMBER(pInterface, DRVAUDIOVRDE, IHostAudio); 536 536 RT_NOREF(pStream); 537 537 538 PDMAUDIOSTREAMSTS fStrmStatus = PDMAUDIOSTREAMSTS_FLAGS_INITIALIZED; 539 538 uint32_t fStrmStatus = PDMAUDIOSTREAM_STS_INITIALIZED; 540 539 if (pDrv->cClients) /* If any clients are connected, flag the stream as enabled. */ 541 fStrmStatus |= PDMAUDIOSTREAM STS_FLAGS_ENABLED;540 fStrmStatus |= PDMAUDIOSTREAM_STS_ENABLED; 542 541 543 542 return fStrmStatus;
Note:
See TracChangeset
for help on using the changeset viewer.