Changeset 89469 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Jun 2, 2021 1:18:42 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144824
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp
r89463 r89469 115 115 /** Pointer to host audio interface. */ 116 116 PDMIHOSTAUDIO IHostAudio; 117 /** Temporary path to use. */ 118 char szPathTemp[RTPATH_MAX]; 119 /** Output path to use. */ 120 char szPathOut[RTPATH_MAX]; 117 121 /** Current test set being handled. */ 118 122 AUDIOTESTSET Set; … … 136 140 137 141 138 142 /** 143 * Unregisters a ValKit test, common code. 144 * 145 * @param pTst Test to unregister. 146 * The pointer will be invalid afterwards. 147 */ 139 148 static void drvHostValKiUnregisterTest(PVALKITTESTDATA pTst) 140 149 { 150 AssertPtrReturnVoid(pTst); 151 141 152 RTListNodeRemove(&pTst->Node); 142 153 143 154 AudioTestSetObjClose(pTst->pObj); 144 155 pTst->pObj = NULL; 156 157 AssertPtrReturnVoid(pTst->pEntry); 145 158 AudioTestSetTestDone(pTst->pEntry); 146 159 pTst->pEntry = NULL; … … 150 163 } 151 164 165 /** 166 * Unregisters a ValKit recording test. 167 * 168 * @param pThis ValKit audio driver instance. 169 * @param pTst Test to unregister. 170 * The pointer will be invalid afterwards. 171 */ 152 172 static void drvHostValKiUnregisterRecTest(PDRVHOSTVALKITAUDIO pThis, PVALKITTESTDATA pTst) 153 173 { … … 158 178 } 159 179 180 /** 181 * Unregisters a ValKit playback test. 182 * 183 * @param pThis ValKit audio driver instance. 184 * @param pTst Test to unregister. 185 * The pointer will be invalid afterwards. 186 */ 160 187 static void drvHostValKiUnregisterPlayTest(PDRVHOSTVALKITAUDIO pThis, PVALKITTESTDATA pTst) 161 188 { … … 164 191 Assert(pThis->cTestsPlay); 165 192 pThis->cTestsPlay--; 193 } 194 195 static DECLCALLBACK(int) drvHostValKitTestSetBegin(void const *pvUser, const char *pszTag) 196 { 197 PDRVHOSTVALKITAUDIO pThis = (PDRVHOSTVALKITAUDIO)pvUser; 198 199 LogRel(("Audio: Validation Kit: Beginning test set '%s'\n", pszTag)); 200 201 return AudioTestSetCreate(&pThis->Set, pThis->szPathTemp, pszTag); 202 203 } 204 205 static DECLCALLBACK(int) drvHostValKitTestSetEnd(void const *pvUser, const char *pszTag) 206 { 207 PDRVHOSTVALKITAUDIO pThis = (PDRVHOSTVALKITAUDIO)pvUser; 208 209 const PAUDIOTESTSET pSet = &pThis->Set; 210 211 LogRel(("Audio: Validation Kit: Ending test set '%s'\n", pszTag)); 212 213 /* Close the test set first. */ 214 AudioTestSetClose(pSet); 215 216 /* Before destroying the test environment, pack up the test set so 217 * that it's ready for transmission. */ 218 char szFileOut[RTPATH_MAX]; 219 int rc = AudioTestSetPack(pSet, pThis->szPathOut, szFileOut, sizeof(szFileOut)); 220 if (RT_SUCCESS(rc)) 221 LogRel(("Audio: Validation Kit: Packed up to '%s'\n", szFileOut)); 222 223 int rc2 = AudioTestSetWipe(pSet); 224 if (RT_SUCCESS(rc)) 225 rc = rc2; 226 227 AudioTestSetDestroy(pSet); 228 229 if (RT_FAILURE(rc)) 230 LogRel(("Audio: Validation Kit: Test set prologue failed with %Rrc\n", rc)); 231 232 return rc; 166 233 } 167 234 … … 665 732 666 733 ATSCALLBACKS Callbacks; 667 Callbacks.pfnTonePlay = drvHostValKitRegisterGuestRecTest; 668 Callbacks.pfnToneRecord = drvHostValKitRegisterGuestPlayTest; 669 Callbacks.pvUser = pThis; 734 Callbacks.pfnTestSetBegin = drvHostValKitTestSetBegin; 735 Callbacks.pfnTestSetEnd = drvHostValKitTestSetEnd; 736 Callbacks.pfnTonePlay = drvHostValKitRegisterGuestRecTest; 737 Callbacks.pfnToneRecord = drvHostValKitRegisterGuestPlayTest; 738 Callbacks.pvUser = pThis; 670 739 671 740 LogRel(("Audio: Validation Kit: Starting Audio Test Service (ATS) ...\n")); … … 675 744 rc = AudioTestSvcStart(&pThis->Srv); 676 745 746 if (RT_SUCCESS(rc)) 747 { 748 LogRel(("Audio: Validation Kit: Audio Test Service (ATS) running\n")); 749 750 /** @todo Let the following be customizable by CFGM later. */ 751 rc = AudioTestPathCreateTemp(pThis->szPathTemp, sizeof(pThis->szPathTemp), "ValKitAudio"); 752 if (RT_SUCCESS(rc)) 753 { 754 LogRel(("Audio: Validation Kit: Using temp dir '%s'\n", pThis->szPathTemp)); 755 rc = AudioTestPathGetTemp(pThis->szPathOut, sizeof(pThis->szPathOut)); 756 if (RT_SUCCESS(rc)) 757 LogRel(("Audio: Validation Kit: Using output dir '%s'\n", pThis->szPathOut)); 758 } 759 } 760 761 if (RT_SUCCESS(rc)) 762 rc = RTCritSectInit(&pThis->CritSect); 763 677 764 if (RT_FAILURE(rc)) 678 { 679 LogRel(("Audio: Validation Kit: Starting Audio Test Service (ATS) failed, rc=%Rrc\n", rc)); 680 } 681 else 682 LogRel(("Audio: Validation Kit: Audio Test Service (ATS) running\n")); 683 684 if (RT_SUCCESS(rc)) 685 rc = RTCritSectInit(&pThis->CritSect); 765 LogRel(("Audio: Validation Kit: Initialization failed, rc=%Rrc\n", rc)); 686 766 687 767 return rc; … … 721 801 LogRel(("Audio: Validation Kit: Shutdown of Audio Test Service failed, rc=%Rrc\n", rc)); 722 802 723 rc = RTCritSectDelete(&pThis->CritSect); 724 AssertRC(rc); 803 int rc2 = RTCritSectDelete(&pThis->CritSect); 804 if (RT_SUCCESS(rc)) 805 rc = rc2; 806 807 if (RT_FAILURE(rc)) 808 LogRel(("Audio: Validation Kit: Destruction failed, rc=%Rrc\n", rc)); 725 809 } 726 810
Note:
See TracChangeset
for help on using the changeset viewer.