Changeset 88887 in vbox for trunk/include
- Timestamp:
- May 5, 2021 11:38:58 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144222
- Location:
- trunk/include/VBox/vmm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmaudioifs.h
r88884 r88887 1308 1308 #define PDMAUDIOBACKENDSTREAM_MAGIC PDM_VERSION_MAKE(0xa0d4, 1, 0) 1309 1309 1310 /** 1311 * Host audio (backend) stream state returned by PDMIHOSTAUDIO::pfnStreamGetState. 1312 */ 1313 typedef enum PDMHOSTAUDIOSTREAMSTATE 1314 { 1315 /** Invalid zero value, as per usual. */ 1316 PDMHOSTAUDIOSTREAMSTATE_INVALID = 0, 1317 /** The stream is being initialized. 1318 * This should also be used when switching to a new device and the stream 1319 * stops to work with the old device while the new one being configured. */ 1320 PDMHOSTAUDIOSTREAMSTATE_INITIALIZING, 1321 /** The stream does not work (async init failed, audio subsystem gone 1322 * fishing, or similar). */ 1323 PDMHOSTAUDIOSTREAMSTATE_NOT_WORKING, 1324 /** Backend is working okay. */ 1325 PDMHOSTAUDIOSTREAMSTATE_OKAY, 1326 /** Backend is working but doesn't want any commands or data reads/writes. */ 1327 PDMHOSTAUDIOSTREAMSTATE_INACTIVE, 1328 /** End of valid values. */ 1329 PDMHOSTAUDIOSTREAMSTATE_END, 1330 /** Blow the type up to 32 bits. */ 1331 PDMHOSTAUDIOSTREAMSTATE_32BIT_HACK = 0x7fffffff 1332 } PDMHOSTAUDIOSTREAMSTATE; 1333 1310 1334 1311 1335 /** Pointer to a host audio interface. */ … … 1500 1524 1501 1525 /** 1502 * Returns the current status of the given backend stream. 1503 * 1504 * @returns PDMAUDIOSTREAM_STS_XXX 1526 * Returns the current state of the given backend stream. 1527 * 1528 * @returns PDMHOSTAUDIOSTREAMSTATE value. 1529 * @retval PDMHOSTAUDIOSTREAMSTATE_INVALID if invalid stream. 1505 1530 * @param pInterface Pointer to the interface structure containing the called function pointer. 1506 1531 * @param pStream Pointer to audio stream. 1507 1532 */ 1508 DECLR3CALLBACKMEMBER( uint32_t, pfnStreamGetStatus, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream));1533 DECLR3CALLBACKMEMBER(PDMHOSTAUDIOSTREAMSTATE, pfnStreamGetState, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)); 1509 1534 1510 1535 /** … … 1533 1558 DECLR3CALLBACKMEMBER(int, pfnStreamCapture, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 1534 1559 void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead)); 1535 1536 1560 } PDMIHOSTAUDIO; 1537 1561 1538 1562 /** PDMIHOSTAUDIO interface ID. */ 1539 #define PDMIHOSTAUDIO_IID " b320d6ab-6cbc-46a8-8011-57e7f7eb0e25"1563 #define PDMIHOSTAUDIO_IID "53949a0a-ca2d-4d25-869f-2a8357991293" 1540 1564 1541 1565 -
trunk/include/VBox/vmm/pdmaudioinline.h
r88884 r88887 1107 1107 1108 1108 /** 1109 * Converts a audio stream state enum value to a string. 1110 * 1111 * @returns Pointer to read-only audio stream state string on success, 1112 * "illegal" if invalid command value. 1113 * @param enmStreamState The state to convert. 1114 */ 1115 DECLINLINE(const char *) PDMAudioStreamStateGetName(PDMAUDIOSTREAMSTATE enmStreamState) 1116 { 1117 switch (enmStreamState) 1118 { 1119 case PDMAUDIOSTREAMSTATE_INVALID: return "invalid"; 1120 case PDMAUDIOSTREAMSTATE_NOT_WORKING: return "not-working"; 1121 case PDMAUDIOSTREAMSTATE_NEED_REINIT: return "need-reinit"; 1122 case PDMAUDIOSTREAMSTATE_INACTIVE: return "inactive"; 1123 case PDMAUDIOSTREAMSTATE_ENABLED: return "enabled"; 1124 case PDMAUDIOSTREAMSTATE_ENABLED_READABLE: return "enabled-readable"; 1125 case PDMAUDIOSTREAMSTATE_ENABLED_WRITABLE: return "enabled-writable"; 1126 /* no default: */ 1127 case PDMAUDIOSTREAMSTATE_END: 1128 case PDMAUDIOSTREAMSTATE_32BIT_HACK: 1129 break; 1130 } 1131 AssertMsgFailedReturn(("Invalid audio stream state: %d\n", enmStreamState), "illegal"); 1132 } 1133 1134 /** 1135 * Converts a host audio (backend) stream state enum value to a string. 1136 * 1137 * @returns Pointer to read-only host audio stream state string on success, 1138 * "illegal" if invalid command value. 1139 * @param enmHostAudioStreamState The state to convert. 1140 */ 1141 DECLINLINE(const char *) PDMHostAudioStreamStateGetName(PDMHOSTAUDIOSTREAMSTATE enmHostAudioStreamState) 1142 { 1143 switch (enmHostAudioStreamState) 1144 { 1145 case PDMHOSTAUDIOSTREAMSTATE_INVALID: return "invalid"; 1146 case PDMHOSTAUDIOSTREAMSTATE_INITIALIZING: return "initializing"; 1147 case PDMHOSTAUDIOSTREAMSTATE_NOT_WORKING: return "not-working"; 1148 case PDMHOSTAUDIOSTREAMSTATE_OKAY: return "okay"; 1149 case PDMHOSTAUDIOSTREAMSTATE_INACTIVE: return "inactive"; 1150 /* no default: */ 1151 case PDMHOSTAUDIOSTREAMSTATE_END: 1152 case PDMHOSTAUDIOSTREAMSTATE_32BIT_HACK: 1153 break; 1154 } 1155 AssertMsgFailedReturn(("Invalid host audio stream state: %d\n", enmHostAudioStreamState), "illegal"); 1156 } 1157 1158 /** 1109 1159 * Checks if the stream status is one that can be read from. 1110 1160 * … … 1121 1171 | PDMAUDIOSTREAM_STS_PAUSED 1122 1172 | PDMAUDIOSTREAM_STS_NEED_REINIT)) 1123 == ( PDMAUDIOSTREAM_STS_INITIALIZED1124 | PDMAUDIOSTREAM_STS_ENABLED);1125 }1126 1127 /**1128 * Checks if the stream status is one that can be read from.1129 *1130 * @returns @c true if ready to be read from, @c false if not.1131 * @param fStatus Stream status to evaluate, PDMAUDIOSTREAM_STS_XXX.1132 * @note Only for backend statuses.1133 */1134 DECLINLINE(bool) PDMAudioStrmStatusBackendCanRead(uint32_t fStatus)1135 {1136 PDMAUDIOSTREAM_STS_ASSERT_VALID_BACKEND(fStatus);1137 AssertReturn(!(fStatus & ~PDMAUDIOSTREAM_STS_VALID_MASK_BACKEND), false);1138 return (fStatus & ( PDMAUDIOSTREAM_STS_INITIALIZED1139 | PDMAUDIOSTREAM_STS_ENABLED1140 | PDMAUDIOSTREAM_STS_PAUSED1141 | PDMAUDIOSTREAM_STS_NEED_REINIT ))1142 1173 == ( PDMAUDIOSTREAM_STS_INITIALIZED 1143 1174 | PDMAUDIOSTREAM_STS_ENABLED); … … 1165 1196 1166 1197 /** 1167 * Checks if the stream status is one that can be written to, backend edition.1168 *1169 * @returns @c true if ready to be written to, @c false if not.1170 * @param fStatus Stream status to evaluate, PDMAUDIOSTREAM_STS_XXX.1171 * @note Only for backend statuses.1172 */1173 DECLINLINE(bool) PDMAudioStrmStatusBackendCanWrite(uint32_t fStatus)1174 {1175 PDMAUDIOSTREAM_STS_ASSERT_VALID_BACKEND(fStatus);1176 AssertReturn(!(fStatus & ~PDMAUDIOSTREAM_STS_VALID_MASK_BACKEND), false);1177 return (fStatus & ( PDMAUDIOSTREAM_STS_INITIALIZED1178 | PDMAUDIOSTREAM_STS_ENABLED1179 | PDMAUDIOSTREAM_STS_PAUSED1180 | PDMAUDIOSTREAM_STS_PENDING_DISABLE))1181 == ( PDMAUDIOSTREAM_STS_INITIALIZED1182 | PDMAUDIOSTREAM_STS_ENABLED);1183 }1184 1185 /**1186 1198 * Checks if the stream status is a ready-to-operate one. 1187 1199 *
Note:
See TracChangeset
for help on using the changeset viewer.