Changeset 89733 in vbox
- Timestamp:
- Jun 16, 2021 7:49:01 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r89724 r89733 1847 1847 * Adds all current driver streams to a specific mixer sink. 1848 1848 * 1849 * Called by ichac97R3Stream Open().1849 * Called by ichac97R3StreamSetUp(). 1850 1850 * 1851 1851 * @returns VBox status code. … … 1916 1916 * Removes all driver streams from a specific mixer sink. 1917 1917 * 1918 * Called by ichac97R3Stream Open() and ichac97R3StreamsDestroy().1918 * Called by ichac97R3StreamSetUp() and ichac97R3StreamsDestroy(). 1919 1919 * 1920 1920 * @param pDevIns The device instance. … … 1979 1979 1980 1980 /** 1981 * Opensan AC'97 stream with its current mixer settings.1982 * 1983 * This will openan AC'97 stream with 2 (stereo) channels, 16-bit samples and1981 * Sets up an AC'97 stream with its current mixer settings. 1982 * 1983 * This will set up an AC'97 stream with 2 (stereo) channels, 16-bit samples and 1984 1984 * the last set sample rate in the AC'97 mixer for this stream. 1985 1985 * … … 1993 1993 * Otherwise re-opening only will happen if the PCM properties have changed. 1994 1994 */ 1995 static int ichac97R3Stream Open(PPDMDEVINS pDevIns, PAC97STATE pThis, PAC97STATER3 pThisCC, PAC97STREAM pStream,1996 PAC97STREAMR3 pStreamCC, bool fForce)1995 static int ichac97R3StreamSetUp(PPDMDEVINS pDevIns, PAC97STATE pThis, PAC97STATER3 pThisCC, PAC97STREAM pStream, 1996 PAC97STREAMR3 pStreamCC, bool fForce) 1997 1997 { 1998 1998 /* … … 2216 2216 2217 2217 /** 2218 * Closes an AC'97 stream.2218 * Tears down an AC'97 stream (counter part to ichac97R3StreamSetUp). 2219 2219 * 2220 2220 * Empty stub at present, nothing to do here as we reuse streams and only really … … 2223 2223 * @param pStream The AC'97 stream to close (shared). 2224 2224 */ 2225 static void ichac97R3Stream Close(PAC97STREAM pStream)2225 static void ichac97R3StreamTearDown(PAC97STREAM pStream) 2226 2226 { 2227 2227 RT_NOREF(pStream); … … 2231 2231 2232 2232 /** 2233 * Re-opens (that is, closes and opens again) an AC'97 stream on the backend2234 * side with the currentAC'97 mixer settings for this stream.2233 * Tears down and sets up an AC'97 stream on the backend side with the current 2234 * AC'97 mixer settings for this stream. 2235 2235 * 2236 2236 * @returns VBox status code. … … 2243 2243 * Otherwise re-opening only will happen if the PCM properties have changed. 2244 2244 */ 2245 static int ichac97R3StreamRe Open(PPDMDEVINS pDevIns, PAC97STATE pThis, PAC97STATER3 pThisCC,2246 PAC97STREAM pStream, PAC97STREAMR3 pStreamCC, bool fForce)2245 static int ichac97R3StreamReSetUp(PPDMDEVINS pDevIns, PAC97STATE pThis, PAC97STATER3 pThisCC, 2246 PAC97STREAM pStream, PAC97STREAMR3 pStreamCC, bool fForce) 2247 2247 { 2248 2248 LogFlowFunc(("[SD%RU8]\n", pStream->u8SD)); … … 2251 2251 Assert(pStreamCC - &pThisCC->aStreams[0] == pStream->u8SD); 2252 2252 2253 ichac97R3Stream Close(pStream);2254 return ichac97R3Stream Open(pDevIns, pThis, pThisCC, pStream, pStreamCC, fForce);2253 ichac97R3StreamTearDown(pStream); 2254 return ichac97R3StreamSetUp(pDevIns, pThis, pThisCC, pStream, pStreamCC, fForce); 2255 2255 } 2256 2256 … … 2284 2284 2285 2285 /* (Re-)Open the stream if necessary. */ 2286 rc = ichac97R3Stream Open(pDevIns, pThis, pThisCC, pStream, pStreamCC, false /* fForce */);2286 rc = ichac97R3StreamSetUp(pDevIns, pThis, pThisCC, pStream, pStreamCC, false /* fForce */); 2287 2287 2288 2288 /* Re-register the update job with the AIO thread with correct sched hint. … … 2321 2321 { 2322 2322 rc = AudioMixerSinkDrainAndStop(pSink, pStreamCC->State.pCircBuf ? (uint32_t)RTCircBufUsed(pStreamCC->State.pCircBuf) : 0); 2323 ichac97R3Stream Close(pStream);2323 ichac97R3StreamTearDown(pStream); 2324 2324 } 2325 2325 … … 2360 2360 * @param pStream The AC'97 stream to destroy (shared). 2361 2361 * @param pStreamCC The AC'97 stream to destroy (ring-3). 2362 * @sa ichac97R3StreamC reate2362 * @sa ichac97R3StreamConstruct 2363 2363 */ 2364 2364 static void ichac97R3StreamDestroy(PAC97STATER3 pThisCC, PAC97STREAM pStream, PAC97STREAMR3 pStreamCC) … … 2366 2366 LogFlowFunc(("[SD%RU8]\n", pStream->u8SD)); 2367 2367 2368 ichac97R3Stream Close(pStream);2368 ichac97R3StreamTearDown(pStream); 2369 2369 2370 2370 int rc2 = RTCritSectDelete(&pStreamCC->State.CritSect); … … 2412 2412 * @sa ichac97R3StreamDestroy 2413 2413 */ 2414 static int ichac97R3StreamC reate(PAC97STATER3 pThisCC, PAC97STREAM pStream, PAC97STREAMR3 pStreamCC, uint8_t u8SD)2414 static int ichac97R3StreamConstruct(PAC97STATER3 pThisCC, PAC97STREAM pStream, PAC97STREAMR3 pStreamCC, uint8_t u8SD) 2415 2415 { 2416 2416 LogFunc(("[SD%RU8] pStream=%p\n", u8SD, pStream)); … … 3400 3400 /** @todo r=bird: Why reopen it now? Can't we put that off till it's 3401 3401 * actually used? */ 3402 ichac97R3StreamRe Open(pDevIns, pThis, pThisCC, &pThis->aStreams[AC97SOUNDSOURCE_PO_INDEX],3402 ichac97R3StreamReSetUp(pDevIns, pThis, pThisCC, &pThis->aStreams[AC97SOUNDSOURCE_PO_INDEX], 3403 3403 &pThisCC->aStreams[AC97SOUNDSOURCE_PO_INDEX], true /* fForce */); 3404 3404 … … 3406 3406 /** @todo r=bird: Why reopen it now? Can't we put that off till it's 3407 3407 * actually used? */ 3408 ichac97R3StreamRe Open(pDevIns, pThis, pThisCC, &pThis->aStreams[AC97SOUNDSOURCE_PI_INDEX],3408 ichac97R3StreamReSetUp(pDevIns, pThis, pThisCC, &pThis->aStreams[AC97SOUNDSOURCE_PI_INDEX], 3409 3409 &pThisCC->aStreams[AC97SOUNDSOURCE_PI_INDEX], true /* fForce */); 3410 3410 } … … 3420 3420 /** @todo r=bird: Why reopen it now? Can't we put that off till it's 3421 3421 * actually used? */ 3422 ichac97R3StreamRe Open(pDevIns, pThis, pThisCC, &pThis->aStreams[AC97SOUNDSOURCE_MC_INDEX],3422 ichac97R3StreamReSetUp(pDevIns, pThis, pThisCC, &pThis->aStreams[AC97SOUNDSOURCE_MC_INDEX], 3423 3423 &pThisCC->aStreams[AC97SOUNDSOURCE_MC_INDEX], true /* fForce */); 3424 3424 } … … 3440 3440 /** @todo r=bird: Why reopen it now? Can't we put that off till it's 3441 3441 * actually used? */ 3442 ichac97R3StreamRe Open(pDevIns, pThis, pThisCC, &pThis->aStreams[AC97SOUNDSOURCE_PO_INDEX],3442 ichac97R3StreamReSetUp(pDevIns, pThis, pThisCC, &pThis->aStreams[AC97SOUNDSOURCE_PO_INDEX], 3443 3443 &pThisCC->aStreams[AC97SOUNDSOURCE_PO_INDEX], true /* fForce */); 3444 3444 } … … 3457 3457 /** @todo r=bird: Why reopen it now? Can't we put that off till it's 3458 3458 * actually used? */ 3459 ichac97R3StreamRe Open(pDevIns, pThis, pThisCC, &pThis->aStreams[AC97SOUNDSOURCE_MC_INDEX],3459 ichac97R3StreamReSetUp(pDevIns, pThis, pThisCC, &pThis->aStreams[AC97SOUNDSOURCE_MC_INDEX], 3460 3460 &pThisCC->aStreams[AC97SOUNDSOURCE_MC_INDEX], true /* fForce */); 3461 3461 } … … 3474 3474 /** @todo r=bird: Why reopen it now? Can't we put that off till it's 3475 3475 * actually used? */ 3476 ichac97R3StreamRe Open(pDevIns, pThis, pThisCC, &pThis->aStreams[AC97SOUNDSOURCE_PI_INDEX],3476 ichac97R3StreamReSetUp(pDevIns, pThis, pThisCC, &pThis->aStreams[AC97SOUNDSOURCE_PI_INDEX], 3477 3477 &pThisCC->aStreams[AC97SOUNDSOURCE_PI_INDEX], true /* fForce */); 3478 3478 } … … 4393 4393 for (unsigned i = 0; i < AC97_MAX_STREAMS; i++) 4394 4394 { 4395 rc = ichac97R3StreamC reate(pThisCC, &pThis->aStreams[i], &pThisCC->aStreams[i], i /* SD# */);4395 rc = ichac97R3StreamConstruct(pThisCC, &pThis->aStreams[i], &pThisCC->aStreams[i], i /* SD# */); 4396 4396 AssertRCReturn(rc, rc); 4397 4397 }
Note:
See TracChangeset
for help on using the changeset viewer.