Changeset 64967 in vbox
- Timestamp:
- Dec 20, 2016 6:52:11 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 112443
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r64956 r64967 137 137 # endif /* unused */ 138 138 139 #ifdef LOG_ENABLED 140 /** 141 * Converts an audio stream status to a string. 142 * 143 * @returns Stringified stream status flags. Must be free'd with RTStrFree(). 144 * "NONE" if no flags set. 145 * @param fFlags Stream status flags to convert. 146 */ 147 char *dbgAudioStreamStatusToStr(PDMAUDIOSTRMSTS fStatus) 148 { 149 #define APPEND_FLAG_TO_STR(_aFlag) \ 150 if (fStatus & PDMAUDIOSTRMSTS_FLAG_##_aFlag) \ 151 { \ 152 if (pszFlags) \ 153 { \ 154 rc2 = RTStrAAppend(&pszFlags, " "); \ 155 if (RT_FAILURE(rc2)) \ 156 break; \ 157 } \ 158 \ 159 rc2 = RTStrAAppend(&pszFlags, #_aFlag); \ 160 if (RT_FAILURE(rc2)) \ 161 break; \ 162 } \ 163 164 char *pszFlags = NULL; 165 int rc2 = VINF_SUCCESS; 166 167 do 168 { 169 APPEND_FLAG_TO_STR(NONE ); 170 APPEND_FLAG_TO_STR(INITIALIZED ); 171 APPEND_FLAG_TO_STR(ENABLED ); 172 APPEND_FLAG_TO_STR(PAUSED ); 173 APPEND_FLAG_TO_STR(PENDING_DISABLE); 174 APPEND_FLAG_TO_STR(DATA_READABLE ); 175 APPEND_FLAG_TO_STR(DATA_WRITABLE ); 176 APPEND_FLAG_TO_STR(PENDING_REINIT ); 177 } while (0); 178 179 if ( RT_FAILURE(rc2) 180 && pszFlags) 181 { 182 RTStrFree(pszFlags); 183 pszFlags = NULL; 184 } 185 186 #undef APPEND_FLAG_TO_STR 187 188 return pszFlags; 189 } 190 #endif /* LOG_ENABLED */ 191 139 192 /** 140 193 * Returns the host stream part of an audio stream pair, or NULL … … 311 364 AssertPtr(pGstStream); 312 365 313 LogFlowFunc(("Status host=0x%x, guest=0x%x\n", pHstStream->fStatus, pGstStream->fStatus)); 366 #ifdef LOG_ENABLED 367 char *pszHstFlags = dbgAudioStreamStatusToStr(pHstStream->fStatus); 368 char *pszGstFlags = dbgAudioStreamStatusToStr(pHstStream->fStatus); 369 LogFlowFunc(("Status host=%s, guest=%s\n", pszHstFlags, pszGstFlags)); 370 RTStrFree(pszGstFlags); 371 RTStrFree(pszHstFlags); 372 #endif /* LOG_ENABLED */ 314 373 315 374 int rc = VINF_SUCCESS; … … 421 480 return VERR_NOT_FOUND; 422 481 423 LogFlowFunc(("[%s] enmStreamCmd=%RU32, fStatus=0x%x\n", pHstStream->szName, enmStreamCmd, pHstStream->fStatus)); 482 #ifdef LOG_ENABLED 483 char *pszHstFlags = dbgAudioStreamStatusToStr(pHstStream->fStatus); 484 LogFlowFunc(("[%s] enmStreamCmd=%RU32, fStatus=%s\n", pHstStream->szName, enmStreamCmd, pszHstFlags)); 485 RTStrFree(pszHstFlags); 486 #endif /* LOG_ENABLED */ 424 487 425 488 AssertPtr(pThis->pHostDrvAudio); … … 993 1056 } 994 1057 995 Log3Func(("[%s] fStatus=0x%x\n", pHstStream->szName, pHstStream->fStatus)); 1058 #ifdef LOG_ENABLED 1059 char *pszHstFlags = dbgAudioStreamStatusToStr(pHstStream->fStatus); 1060 Log3Func(("[%s] fStatus=%s\n", pHstStream->szName, pszHstFlags)); 1061 RTStrFree(pszHstFlags); 1062 #endif /* LOG_ENABLED */ 996 1063 997 1064 /* Not enabled or paused? Skip iteration. */ … … 1274 1341 STAM_COUNTER_ADD(&pHstStream->In.StatSamplesCaptured, cSamplesCaptured); 1275 1342 #endif 1343 Log3Func(("[%s] %RU32 samples captured\n", pHstStream->szName, cSamplesCaptured)); 1276 1344 } 1277 1345 } 1278 } 1279 1280 Log3Func(("[%s] stsBackend=0x%x, cSamplesLive=%RU32, cSamplesCaptured=%RU32, rc=%Rrc\n", 1281 pHstStream->szName, stsBackend, cSamplesLive, cSamplesCaptured, rc)); 1346 else 1347 Log3Func(("[%s] Skipping (backend status 0x%x)\n", pHstStream->szName, stsBackend)); 1348 } 1349 else 1350 Log3Func(("[%s] Skipping (still has %RU32 live samples)\n", pHstStream->szName, cSamplesLive)); 1282 1351 1283 1352 } while (0); … … 1288 1357 *pcSamplesCaptured = cSamplesCaptured; 1289 1358 } 1359 else 1360 LogFunc(("[%s] Failed with %Rrc\n", rc)); 1290 1361 1291 1362 int rc2 = RTCritSectLeave(&pThis->CritSect); … … 2365 2436 int rc = VINF_SUCCESS; 2366 2437 2367 LogFlowFunc(("%s: fStatus=0x%x\n", pHstStream->szName, pHstStream->fStatus)); 2438 #ifdef LOG_ENABLED 2439 char *pszHstFlags = dbgAudioStreamStatusToStr(pHstStream->fStatus); 2440 LogFunc(("%s: fStatus=%s\n", pHstStream->szName, pszHstFlags)); 2441 RTStrFree(pszHstFlags); 2442 #endif /* LOG_ENABLED */ 2368 2443 2369 2444 if (pHstStream->fStatus & PDMAUDIOSTRMSTS_FLAG_INITIALIZED)
Note:
See TracChangeset
for help on using the changeset viewer.