Changeset 67441 in vbox for trunk/src/VBox/Devices/Audio
- Timestamp:
- Jun 16, 2017 2:01:05 PM (8 years ago)
- svn:sync-xref-src-repo-rev:
- 116172
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r65742 r67441 137 137 138 138 # endif /* unused */ 139 140 static void drvAudioDbgPCMDumpA(PDRVAUDIO pThis, const char *pszPath, const char *pszSuffix, const void *pvData, size_t cbData); 139 141 140 142 #ifdef LOG_ENABLED … … 1316 1318 break; 1317 1319 1320 #ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA 1321 drvAudioDbgPCMDumpA(pThis, VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH, "PlayNonInterleaved.pcm", 1322 auBuf, cbPlayed); 1323 #endif 1318 1324 AssertMsg(cbPlayed <= cbRead, ("Played more than available (%RU32 available but got %RU32)\n", cbRead, cbPlayed)); 1319 1325 AssertMsg(cbPlayed % 2 == 0, … … 1596 1602 else if (cbCaptured) 1597 1603 { 1604 #ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA 1605 drvAudioDbgPCMDumpA(pThis, VBOX_AUDIO_DEBUG_DUMP_PCM_DATA_PATH, "CaptureNonInterleaved.pcm", 1606 auBuf, cbCaptured); 1607 #endif 1598 1608 Assert(cbCaptured <= cbBuf); 1599 1609 if (cbCaptured > cbBuf) /* Paranoia. */ … … 2059 2069 } 2060 2070 #endif /* VBOX_WITH_AUDIO_ENUM */ 2071 2072 #ifdef VBOX_AUDIO_DEBUG_DUMP_PCM_DATA 2073 /** 2074 * Dumps (raw) PCM audio data into a file by appending. 2075 * 2076 * @returns IPRT status code. 2077 * @param pThis Driver inststance. 2078 * @param pszPath Path name to save file to. The path must exist. 2079 * @param pszFileName File name suffix to use. 2080 * @param pvData Pointer to PCM data to dump. 2081 * @param cbData Size (in bytes) of PCM data to dump. 2082 */ 2083 static void drvAudioDbgPCMDumpA(PDRVAUDIO pThis, 2084 const char *pszPath, const char *pszSuffix, const void *pvData, size_t cbData) 2085 { 2086 if (!pvData || !cbData) 2087 return; 2088 2089 AssertPtr(pThis->pDrvIns); 2090 2091 char szFileName[64]; 2092 RTStrPrintf(szFileName, sizeof(szFileName), "drvAudio%RU32-%s", pThis->pDrvIns->iInstance, pszSuffix); 2093 2094 char szFilePath[RTPATH_MAX]; 2095 int rc2 = RTStrCopy(szFilePath, sizeof(szFilePath), pszPath); 2096 AssertRC(rc2); 2097 rc2 = RTPathAppend(szFilePath, sizeof(szFilePath), szFileName); 2098 AssertRC(rc2); 2099 2100 RTFILE fh; 2101 rc2 = RTFileOpen(&fh, szFilePath, 2102 RTFILE_O_OPEN_CREATE | RTFILE_O_APPEND | RTFILE_O_WRITE | RTFILE_O_DENY_NONE); 2103 AssertRC(rc2); 2104 if (RT_SUCCESS(rc2)) 2105 { 2106 RTFileWrite(fh, pvData, cbData, NULL); 2107 RTFileClose(fh); 2108 } 2109 } 2110 #endif /* VBOX_AUDIO_DEBUG_DUMP_PCM_DATA */ 2061 2111 2062 2112 /**
Note:
See TracChangeset
for help on using the changeset viewer.