VirtualBox

Changeset 88892 in vbox for trunk/include/VBox


Ignore:
Timestamp:
May 6, 2021 1:08:15 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144227
Message:

Audio: Moved the PDMAUDIOSTREAM_STS_XXX stuff into DrvAudio as it's no longer used by any public interfaces any more. bugref:9890

Location:
trunk/include/VBox/vmm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmaudioifs.h

    r88887 r88892  
    907907
    908908
    909 /** @name PDMAUDIOSTREAM_STS_XXX
    910  * @sa PDMIAUDIOCONNECTOR::pfnStreamGetStatus, PDMIHOSTAUDIO::pfnStreamGetStatus
    911  * @{ */
    912 /** No flags being set. */
    913 #define PDMAUDIOSTREAM_STS_NONE                 UINT32_C(0)
    914 /** Set if the backend for the stream has been created.
    915  *
    916  * PDMIAUDIOCONNECTOR: This is generally always set after stream creation, but
    917  * can be cleared if the re-initialization of the stream fails later on.
    918  * Asynchronous init may still be incomplete, see
    919  *
    920  * PDMIHOSTAUDIO: This may not be set immediately if the backend is doing some
    921  * of the stream creation asynchronously via PDMIHOSTAUDIO::pfnStreamInitAsync.
    922  * The DrvAudio code will not report this to the devices, but keep on
    923  * prebuffering till pfnStreamInitAsync is done and this bit is set. */
    924 #define PDMAUDIOSTREAM_STS_INITIALIZED          RT_BIT_32(0)
    925 /** Set if the stream is enabled, clear if disabled. */
    926 #define PDMAUDIOSTREAM_STS_ENABLED              RT_BIT_32(1)
    927 /** Set if the stream is paused.
    928  * Requires the ENABLED status to be set when used. */
    929 #define PDMAUDIOSTREAM_STS_PAUSED               RT_BIT_32(2)
    930 /** Output only: Set when the stream is draining.
    931  * Requires the ENABLED status to be set when used.
    932  * @todo See todo in drvAudioStreamPlay() regarding the suitability of this
    933  *       for PDMIHOSTAUDIO. */
    934 #define PDMAUDIOSTREAM_STS_PENDING_DISABLE      RT_BIT_32(3)
    935 
    936 /** PDMIAUDIOCONNECTOR: Set if the stream needs to be re-initialized by the
    937  * device (i.e. call PDMIAUDIOCONNECTOR::pfnStreamReInit). (The other status
    938  * bits are preserved and are worked as normal while in this state, so that the
    939  * stream can resume operation where it left off.)  */
    940 #define PDMAUDIOSTREAM_STS_NEED_REINIT          RT_BIT_32(8)
    941 /** PDMIAUDIOCONNECTOR: The backend is ready (PDMIHOSTAUDIO::pfnStreamInitAsync  done).
    942  * Requires the INITIALIZED status to be set.  */
    943 #define PDMAUDIOSTREAM_STS_BACKEND_READY        RT_BIT_32(9)
    944 /** Validation mask for PDMIAUDIOCONNECTOR. */
    945 #define PDMAUDIOSTREAM_STS_VALID_MASK           UINT32_C(0x0000030f)
    946 /** Asserts the validity of the given stream status mask for PDMIAUDIOCONNECTOR. */
    947 #define PDMAUDIOSTREAM_STS_ASSERT_VALID(a_fStreamStatus) do { \
    948         AssertMsg(!((a_fStreamStatus) & ~PDMAUDIOSTREAM_STS_VALID_MASK), ("%#x\n", (a_fStreamStatus))); \
    949         Assert(!((a_fStreamStatus) & PDMAUDIOSTREAM_STS_PAUSED)          || ((a_fStreamStatus) & PDMAUDIOSTREAM_STS_ENABLED)); \
    950         Assert(!((a_fStreamStatus) & PDMAUDIOSTREAM_STS_PENDING_DISABLE) || ((a_fStreamStatus) & PDMAUDIOSTREAM_STS_ENABLED)); \
    951         Assert(!((a_fStreamStatus) & PDMAUDIOSTREAM_STS_BACKEND_READY)   || ((a_fStreamStatus) & PDMAUDIOSTREAM_STS_INITIALIZED)); \
    952     } while (0)
    953 
    954 /** PDMIHOSTAUDIO: Backend is preparing a device switch, DrvAudio should
    955  * pre-buffer to make that smoother and quicker.
    956  * Call PDMIHOSTAUDIOPORT::pfnStreamNotifyDeviceChanged when clearing. */
    957 #define PDMAUDIOSTREAM_STS_PREPARING_SWITCH     RT_BIT_32(16)
    958 /** Validation mask for PDMIHOSTAUDIO. */
    959 #define PDMAUDIOSTREAM_STS_VALID_MASK_BACKEND   UINT32_C(0x0001000f)
    960 /** Asserts the validity of the given stream status mask for PDMIHOSTAUDIO. */
    961 #define PDMAUDIOSTREAM_STS_ASSERT_VALID_BACKEND(a_fStreamStatus) do { \
    962         AssertMsg(!((a_fStreamStatus) & ~PDMAUDIOSTREAM_STS_VALID_MASK_BACKEND), ("%#x\n", (a_fStreamStatus))); \
    963         Assert(!((a_fStreamStatus) & PDMAUDIOSTREAM_STS_PAUSED)          || ((a_fStreamStatus) & PDMAUDIOSTREAM_STS_ENABLED)); \
    964         Assert(!((a_fStreamStatus) & PDMAUDIOSTREAM_STS_PENDING_DISABLE) || ((a_fStreamStatus) & PDMAUDIOSTREAM_STS_ENABLED)); \
    965     } while (0)
    966 /** @} */
    967 
    968909/**
    969910 * Backend status.
  • trunk/include/VBox/vmm/pdmaudioinline.h

    r88887 r88892  
    11561156}
    11571157
    1158 /**
    1159  * Checks if the stream status is one that can be read from.
    1160  *
    1161  * @returns @c true if ready to be read from, @c false if not.
    1162  * @param   fStatus     Stream status to evaluate, PDMAUDIOSTREAM_STS_XXX.
    1163  * @note    Not for backend statuses (use PDMAudioStrmStatusBackendCanRead)!
    1164  */
    1165 DECLINLINE(bool) PDMAudioStrmStatusCanRead(uint32_t fStatus)
    1166 {
    1167     PDMAUDIOSTREAM_STS_ASSERT_VALID(fStatus);
    1168     AssertReturn(!(fStatus & ~PDMAUDIOSTREAM_STS_VALID_MASK), false);
    1169     return (fStatus & (  PDMAUDIOSTREAM_STS_INITIALIZED
    1170                        | PDMAUDIOSTREAM_STS_ENABLED
    1171                        | PDMAUDIOSTREAM_STS_PAUSED
    1172                        | PDMAUDIOSTREAM_STS_NEED_REINIT))
    1173         == (  PDMAUDIOSTREAM_STS_INITIALIZED
    1174             | PDMAUDIOSTREAM_STS_ENABLED);
    1175 }
    1176 
    1177 /**
    1178  * Checks if the stream status is one that can be written to.
    1179  *
    1180  * @returns @c true if ready to be written to, @c false if not.
    1181  * @param   fStatus     Stream status to evaluate, PDMAUDIOSTREAM_STS_XXX.
    1182  * @note    Not for backend statuses (use PDMAudioStrmStatusBackendCanWrite)!
    1183  */
    1184 DECLINLINE(bool) PDMAudioStrmStatusCanWrite(uint32_t fStatus)
    1185 {
    1186     PDMAUDIOSTREAM_STS_ASSERT_VALID(fStatus);
    1187     AssertReturn(!(fStatus & ~PDMAUDIOSTREAM_STS_VALID_MASK), false);
    1188     return (fStatus & (  PDMAUDIOSTREAM_STS_INITIALIZED
    1189                        | PDMAUDIOSTREAM_STS_ENABLED
    1190                        | PDMAUDIOSTREAM_STS_PAUSED
    1191                        | PDMAUDIOSTREAM_STS_PENDING_DISABLE
    1192                        | PDMAUDIOSTREAM_STS_NEED_REINIT))
    1193         == (  PDMAUDIOSTREAM_STS_INITIALIZED
    1194             | PDMAUDIOSTREAM_STS_ENABLED);
    1195 }
    1196 
    1197 /**
    1198  * Checks if the stream status is a ready-to-operate one.
    1199  *
    1200  * @returns @c true if ready to operate, @c false if not.
    1201  * @param   fStatus     Stream status to evaluate, PDMAUDIOSTREAM_STS_XXX.
    1202  * @note    Not for backend statuses!
    1203  */
    1204 DECLINLINE(bool) PDMAudioStrmStatusIsReady(uint32_t fStatus)
    1205 {
    1206     PDMAUDIOSTREAM_STS_ASSERT_VALID(fStatus);
    1207     AssertReturn(!(fStatus & ~PDMAUDIOSTREAM_STS_VALID_MASK), false);
    1208     return (fStatus & (  PDMAUDIOSTREAM_STS_INITIALIZED
    1209                        | PDMAUDIOSTREAM_STS_ENABLED
    1210                        | PDMAUDIOSTREAM_STS_NEED_REINIT))
    1211         == (  PDMAUDIOSTREAM_STS_INITIALIZED
    1212             | PDMAUDIOSTREAM_STS_ENABLED);
    1213 }
    1214 
    1215 
    12161158/** @} */
    12171159
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