Changeset 89213 in vbox for trunk/src/VBox/Devices
- Timestamp:
- May 21, 2021 10:00:12 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144554
- Location:
- trunk/src/VBox/Devices/Audio
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/AudioMixer.cpp
r89190 r89213 112 112 113 113 static int audioMixerStreamCtlInternal(PAUDMIXSTREAM pMixStream, PDMAUDIOSTREAMCMD enmCmd); 114 static void audioMixerStreamDestroyInternal(PAUDMIXSTREAM pStream, PPDMDEVINS pDevIns );114 static void audioMixerStreamDestroyInternal(PAUDMIXSTREAM pStream, PPDMDEVINS pDevIns, bool fImmediate); 115 115 static int audioMixerStreamUpdateStatus(PAUDMIXSTREAM pMixStream); 116 116 … … 663 663 } 664 664 665 rc = pConn->pfnStreamDestroy(pConn, pStream );665 rc = pConn->pfnStreamDestroy(pConn, pStream, true /*fImmediate*/); 666 666 } 667 667 … … 1000 1000 { 1001 1001 audioMixerSinkRemoveStreamInternal(pSink, pStream); 1002 audioMixerStreamDestroyInternal(pStream, pDevIns ); /* (Unlike the other two, this frees the stream structure.) */1002 audioMixerStreamDestroyInternal(pStream, pDevIns, true /*fImmediate*/); /* (Unlike the other two, this frees the stream structure.) */ 1003 1003 } 1004 1004 … … 2735 2735 * @param pMixStream Mixer stream to destroy. 2736 2736 * @param pDevIns The device instance the statistics are registered with. 2737 */ 2738 static void audioMixerStreamDestroyInternal(PAUDMIXSTREAM pMixStream, PPDMDEVINS pDevIns) 2737 * @param fImmediate How to handle still draining streams, whether to let 2738 * them complete (@c false) or destroy them immediately (@c 2739 * true). 2740 */ 2741 static void audioMixerStreamDestroyInternal(PAUDMIXSTREAM pMixStream, PPDMDEVINS pDevIns, bool fImmediate) 2739 2742 { 2740 2743 AssertPtrReturnVoid(pMixStream); … … 2748 2751 { 2749 2752 pMixStream->pConn->pfnStreamRelease(pMixStream->pConn, pMixStream->pStream); 2750 pMixStream->pConn->pfnStreamDestroy(pMixStream->pConn, pMixStream->pStream );2753 pMixStream->pConn->pfnStreamDestroy(pMixStream->pConn, pMixStream->pStream, fImmediate); 2751 2754 2752 2755 pMixStream->pStream = NULL; … … 2776 2779 * Destroys a mixer stream. 2777 2780 * 2778 * @param pMixStream Mixer stream to destroy. 2779 * @param pDevIns The device instance statistics are registered with. 2780 */ 2781 void AudioMixerStreamDestroy(PAUDMIXSTREAM pMixStream, PPDMDEVINS pDevIns) 2781 * @param pMixStream Mixer stream to destroy. 2782 * @param pDevIns The device instance statistics are registered with. 2783 * @param fImmediate How to handle still draining streams, whether to let 2784 * them complete (@c false) or destroy them immediately (@c 2785 * true). 2786 */ 2787 void AudioMixerStreamDestroy(PAUDMIXSTREAM pMixStream, PPDMDEVINS pDevIns, bool fImmediate) 2782 2788 { 2783 2789 if (!pMixStream) … … 2811 2817 if (RT_SUCCESS(rc2)) 2812 2818 { 2813 audioMixerStreamDestroyInternal(pMixStream, pDevIns );2819 audioMixerStreamDestroyInternal(pMixStream, pDevIns, fImmediate); 2814 2820 pMixStream = NULL; 2815 2821 } -
trunk/src/VBox/Devices/Audio/AudioMixer.h
r88991 r89213 324 324 int AudioMixerSinkUnlock(PAUDMIXSINK pSink); 325 325 326 void AudioMixerStreamDestroy(PAUDMIXSTREAM pStream, PPDMDEVINS pDevIns );326 void AudioMixerStreamDestroy(PAUDMIXSTREAM pStream, PPDMDEVINS pDevIns, bool fImmediate); 327 327 328 328 #endif /* !VBOX_INCLUDED_SRC_Audio_AudioMixer_h */ -
trunk/src/VBox/Devices/Audio/DevHda.cpp
r88941 r89213 1786 1786 * Removes an audio stream from the device setup using the given configuration. 1787 1787 * 1788 * Used by hdaRegWriteSDCTL(). 1789 * 1788 1790 * @returns VBox status code. 1789 1791 * @param pThisCC The ring-3 HDA device state. … … 1845 1847 && enmMixerCtl != PDMAUDIOMIXERCTL_UNKNOWN) 1846 1848 { 1847 rc = hdaR3CodecRemoveStream(pThisCC->pCodec, enmMixerCtl );1849 rc = hdaR3CodecRemoveStream(pThisCC->pCodec, enmMixerCtl, false /*fImmediate*/); 1848 1850 } 1849 1851 … … 2214 2216 2215 2217 AudioMixerSinkRemoveStream(pThisCC->SinkLineIn.pMixSink, pDrv->LineIn.pMixStrm); 2216 AudioMixerStreamDestroy(pDrv->LineIn.pMixStrm, pDevIns );2218 AudioMixerStreamDestroy(pDrv->LineIn.pMixStrm, pDevIns, true /*fImmediate*/); 2217 2219 pDrv->LineIn.pMixStrm = NULL; 2218 2220 } … … 2225 2227 2226 2228 AudioMixerSinkRemoveStream(pThisCC->SinkMicIn.pMixSink, pDrv->MicIn.pMixStrm); 2227 AudioMixerStreamDestroy(pDrv->MicIn.pMixStrm, pDevIns );2229 AudioMixerStreamDestroy(pDrv->MicIn.pMixStrm, pDevIns, true /*fImmediate*/); 2228 2230 pDrv->MicIn.pMixStrm = NULL; 2229 2231 } … … 2233 2235 { 2234 2236 AudioMixerSinkRemoveStream(pThisCC->SinkFront.pMixSink, pDrv->Front.pMixStrm); 2235 AudioMixerStreamDestroy(pDrv->Front.pMixStrm, pDevIns );2237 AudioMixerStreamDestroy(pDrv->Front.pMixStrm, pDevIns, true /*fImmediate*/); 2236 2238 pDrv->Front.pMixStrm = NULL; 2237 2239 } … … 2241 2243 { 2242 2244 AudioMixerSinkRemoveStream(pThisCC->SinkCenterLFE.pMixSink, pDrv->CenterLFE.pMixStrm); 2243 AudioMixerStreamDestroy(pDrv->CenterLFE.pMixStrm, pDevIns );2245 AudioMixerStreamDestroy(pDrv->CenterLFE.pMixStrm, pDevIns, true /*fImmediate*/); 2244 2246 pDrv->CenterLFE.pMixStrm = NULL; 2245 2247 } … … 2248 2250 { 2249 2251 AudioMixerSinkRemoveStream(pThisCC->SinkRear.pMixSink, pDrv->Rear.pMixStrm); 2250 AudioMixerStreamDestroy(pDrv->Rear.pMixStrm, pDevIns );2252 AudioMixerStreamDestroy(pDrv->Rear.pMixStrm, pDevIns, true /*fImmediate*/); 2251 2253 pDrv->Rear.pMixStrm = NULL; 2252 2254 } … … 2367 2369 } 2368 2370 if (RT_FAILURE(rc)) 2369 AudioMixerStreamDestroy(pMixStrm, pDevIns );2371 AudioMixerStreamDestroy(pMixStrm, pDevIns, true /*fImmediate*/); 2370 2372 } 2371 2373 … … 2440 2442 * @interface_method_impl{HDACODECR3,pfnCbMixerRemoveStream} 2441 2443 */ 2442 static DECLCALLBACK(int) hdaR3MixerRemoveStream(PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl )2444 static DECLCALLBACK(int) hdaR3MixerRemoveStream(PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, bool fImmediate) 2443 2445 { 2444 2446 PHDASTATER3 pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PHDASTATER3); … … 2492 2494 { 2493 2495 AudioMixerSinkRemoveStream(pSink->pMixSink, pMixStream); 2494 AudioMixerStreamDestroy(pMixStream, pDevIns );2496 AudioMixerStreamDestroy(pMixStream, pDevIns, fImmediate); 2495 2497 2496 2498 pMixStream = NULL; -
trunk/src/VBox/Devices/Audio/DevHdaCodec.cpp
r88504 r89213 2471 2471 } 2472 2472 2473 int hdaR3CodecRemoveStream(PHDACODECR3 pThisCC, PDMAUDIOMIXERCTL enmMixerCtl )2473 int hdaR3CodecRemoveStream(PHDACODECR3 pThisCC, PDMAUDIOMIXERCTL enmMixerCtl, bool fImmediate) 2474 2474 { 2475 2475 AssertPtrReturn(pThisCC, VERR_INVALID_POINTER); 2476 2476 2477 int rc = pThisCC->pfnCbMixerRemoveStream(pThisCC->pDevIns, enmMixerCtl );2477 int rc = pThisCC->pfnCbMixerRemoveStream(pThisCC->pDevIns, enmMixerCtl, fImmediate); 2478 2478 2479 2479 LogFlowFuncLeaveRC(rc); … … 2572 2572 LogRel2(("HDA: Powering off codec ...\n")); 2573 2573 2574 int rc2 = hdaR3CodecRemoveStream(pThisCC, PDMAUDIOMIXERCTL_FRONT );2574 int rc2 = hdaR3CodecRemoveStream(pThisCC, PDMAUDIOMIXERCTL_FRONT, true /*fImmediate*/); 2575 2575 AssertRC(rc2); 2576 2576 #ifdef VBOX_WITH_AUDIO_HDA_51_SURROUND 2577 rc2 = hdaR3CodecRemoveStream(pThisCC, PDMAUDIOMIXERCTL_CENTER_LFE );2577 rc2 = hdaR3CodecRemoveStream(pThisCC, PDMAUDIOMIXERCTL_CENTER_LFE, true /*fImmediate*/); 2578 2578 AssertRC(rc2); 2579 rc2 = hdaR3CodecRemoveStream(pThisCC, PDMAUDIOMIXERCTL_REAR );2579 rc2 = hdaR3CodecRemoveStream(pThisCC, PDMAUDIOMIXERCTL_REAR, true /*fImmediate*/); 2580 2580 AssertRC(rc2); 2581 2581 #endif 2582 2582 2583 2583 #ifdef VBOX_WITH_AUDIO_HDA_MIC_IN 2584 rc2 = hdaR3CodecRemoveStream(pThisCC, PDMAUDIOMIXERCTL_MIC_IN );2584 rc2 = hdaR3CodecRemoveStream(pThisCC, PDMAUDIOMIXERCTL_MIC_IN, true /*fImmediate*/); 2585 2585 AssertRC(rc2); 2586 2586 #endif 2587 rc2 = hdaR3CodecRemoveStream(pThisCC, PDMAUDIOMIXERCTL_LINE_IN );2587 rc2 = hdaR3CodecRemoveStream(pThisCC, PDMAUDIOMIXERCTL_LINE_IN, true /*fImmediate*/); 2588 2588 AssertRC(rc2); 2589 2589 } -
trunk/src/VBox/Devices/Audio/DevHdaCodec.h
r88503 r89213 923 923 * @param pDevIns The device instance. 924 924 * @param enmMixerCtl Mixer control to remove. 925 * @param fImmediate Whether the backend should be allowed to 926 * finished draining (@c false) or if it must be 927 * destroyed immediately (@c true). 925 928 */ 926 DECLR3CALLBACKMEMBER(int, pfnCbMixerRemoveStream, (PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl ));929 DECLR3CALLBACKMEMBER(int, pfnCbMixerRemoveStream, (PPDMDEVINS pDevIns, PDMAUDIOMIXERCTL enmMixerCtl, bool fImmediate)); 927 930 /** 928 931 * Controls an input / output converter widget, that is, which converter is … … 952 955 int hdaR3CodecLoadState(PPDMDEVINS pDevIns, PHDACODEC pThis, PHDACODECR3 pThisCC, PSSMHANDLE pSSM, uint32_t uVersion); 953 956 int hdaR3CodecAddStream(PHDACODECR3 pThisCC, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOSTREAMCFG pCfg); 954 int hdaR3CodecRemoveStream(PHDACODECR3 pThisCC, PDMAUDIOMIXERCTL enmMixerCtl );957 int hdaR3CodecRemoveStream(PHDACODECR3 pThisCC, PDMAUDIOMIXERCTL enmMixerCtl, bool fImmediate); 955 958 956 959 int hdaCodecSaveState(PPDMDEVINS pDevIns, PHDACODEC pThis, PSSMHANDLE pSSM); -
trunk/src/VBox/Devices/Audio/DevIchAc97.cpp
r89189 r89213 1547 1547 } 1548 1548 if (RT_FAILURE(rc)) 1549 AudioMixerStreamDestroy(pMixStrm, pDevIns );1549 AudioMixerStreamDestroy(pMixStrm, pDevIns, true /*fImmediate*/); 1550 1550 } 1551 1551 … … 1648 1648 1649 1649 AudioMixerSinkRemoveStream(pThisCC->pSinkMicIn, pDrv->MicIn.pMixStrm); 1650 AudioMixerStreamDestroy(pDrv->MicIn.pMixStrm, pDevIns );1650 AudioMixerStreamDestroy(pDrv->MicIn.pMixStrm, pDevIns, true /*fImmediate*/); 1651 1651 pDrv->MicIn.pMixStrm = NULL; 1652 1652 } … … 1658 1658 1659 1659 AudioMixerSinkRemoveStream(pThisCC->pSinkLineIn, pDrv->LineIn.pMixStrm); 1660 AudioMixerStreamDestroy(pDrv->LineIn.pMixStrm, pDevIns );1660 AudioMixerStreamDestroy(pDrv->LineIn.pMixStrm, pDevIns, true /*fImmediate*/); 1661 1661 pDrv->LineIn.pMixStrm = NULL; 1662 1662 } … … 1665 1665 { 1666 1666 AudioMixerSinkRemoveStream(pThisCC->pSinkOut, pDrv->Out.pMixStrm); 1667 AudioMixerStreamDestroy(pDrv->Out.pMixStrm, pDevIns );1667 AudioMixerStreamDestroy(pDrv->Out.pMixStrm, pDevIns, true /*fImmediate*/); 1668 1668 pDrv->Out.pMixStrm = NULL; 1669 1669 } … … 1691 1691 AudioMixerSinkRemoveStream(pMixSink, pDrvStream->pMixStrm); 1692 1692 1693 AudioMixerStreamDestroy(pDrvStream->pMixStrm, pDevIns );1693 AudioMixerStreamDestroy(pDrvStream->pMixStrm, pDevIns, false /*fImmediate*/); 1694 1694 pDrvStream->pMixStrm = NULL; 1695 1695 } -
trunk/src/VBox/Devices/Audio/DevSB16.cpp
r88991 r89213 1815 1815 pDrvStream->pMixStrm = pMixStrm; 1816 1816 else 1817 AudioMixerStreamDestroy(pMixStrm, pDevIns );1817 AudioMixerStreamDestroy(pMixStrm, pDevIns, true /*fImmediate*/); 1818 1818 } 1819 1819 } … … 1883 1883 AudioMixerSinkRemoveStream(pMixSink, pDrvStream->pMixStrm); 1884 1884 1885 AudioMixerStreamDestroy(pDrvStream->pMixStrm, pDevIns );1885 AudioMixerStreamDestroy(pDrvStream->pMixStrm, pDevIns, false /*fImmediate*/); 1886 1886 pDrvStream->pMixStrm = NULL; 1887 1887 } … … 1905 1905 PSB16DRIVER pDrv; 1906 1906 RTListForEach(&pThis->lstDrv, pDrv, SB16DRIVER, Node) 1907 { 1907 1908 sb16RemoveDrvStream(pDevIns, pMixSink, enmDir, dstSrc, pDrv); 1909 } 1908 1910 } 1909 1911 … … 1953 1955 { 1954 1956 AudioMixerSinkRemoveStream(pThis->pSinkOut, pDrv->Out.pMixStrm); 1955 AudioMixerStreamDestroy(pDrv->Out.pMixStrm, pDevIns );1957 AudioMixerStreamDestroy(pDrv->Out.pMixStrm, pDevIns, true /*fImmediate*/); 1956 1958 pDrv->Out.pMixStrm = NULL; 1957 1959 } -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r89210 r89213 170 170 /** Set if pfnStreamCreate returned VINF_AUDIO_STREAM_ASYNC_INIT_NEEDED. */ 171 171 bool fNeedAsyncInit; 172 bool afPadding[2]; 172 /** The fImmediate parameter value for pfnStreamDestroy. */ 173 bool fDestroyImmediate; 174 bool fPadding; 173 175 174 176 /** Number of (re-)tries while re-initializing the stream. */ … … 1803 1805 { 1804 1806 PPDMAUDIOBACKENDSTREAM pBackend = (PPDMAUDIOBACKENDSTREAM)(pStreamEx + 1); 1805 pBackend->uMagic = PDMAUDIOBACKENDSTREAM_MAGIC; 1806 pBackend->pStream = &pStreamEx->Core; 1807 1808 pStreamEx->pBackend = pBackend; 1809 pStreamEx->Core.enmDir = pCfgHost->enmDir; 1810 pStreamEx->Core.cbBackend = (uint32_t)cbHstStrm; 1811 pStreamEx->fNoMixBufs = RT_BOOL(fFlags & PDMAUDIOSTREAM_CREATE_F_NO_MIXBUF); 1812 pStreamEx->hReqInitAsync = NIL_RTREQ; 1813 pStreamEx->uMagic = DRVAUDIOSTREAM_MAGIC; 1807 pBackend->uMagic = PDMAUDIOBACKENDSTREAM_MAGIC; 1808 pBackend->pStream = &pStreamEx->Core; 1809 1810 pStreamEx->pBackend = pBackend; 1811 pStreamEx->Core.enmDir = pCfgHost->enmDir; 1812 pStreamEx->Core.cbBackend = (uint32_t)cbHstStrm; 1813 pStreamEx->fNoMixBufs = RT_BOOL(fFlags & PDMAUDIOSTREAM_CREATE_F_NO_MIXBUF); 1814 pStreamEx->fDestroyImmediate = true; 1815 pStreamEx->hReqInitAsync = NIL_RTREQ; 1816 pStreamEx->uMagic = DRVAUDIOSTREAM_MAGIC; 1814 1817 1815 1818 /* Make a unqiue stream name including the host (backend) driver name. */ … … 1971 1974 RTCritSectRwEnterShared(&pThis->CritSectHotPlug); /** @todo needed? */ 1972 1975 if (pThis->pHostDrvAudio) 1973 rc = pThis->pHostDrvAudio->pfnStreamDestroy(pThis->pHostDrvAudio, pStreamEx->pBackend );1976 rc = pThis->pHostDrvAudio->pfnStreamDestroy(pThis->pHostDrvAudio, pStreamEx->pBackend, pStreamEx->fDestroyImmediate); 1974 1977 RTCritSectRwLeaveShared(&pThis->CritSectHotPlug); 1975 1978 … … 2004 2007 * ... 2005 2008 */ 2006 i nt rc = drvAudioStreamControlInternal(pThis, pStreamEx, PDMAUDIOSTREAMCMD_DISABLE);2007 if (RT_SUCCESS(rc))2008 2009 if (pStreamEx->fDestroyImmediate) 2010 drvAudioStreamControlInternal(pThis, pStreamEx, PDMAUDIOSTREAMCMD_DISABLE); 2011 int rc = drvAudioStreamDestroyInternalBackend(pThis, pStreamEx); 2009 2012 2010 2013 /* Destroy mixing buffers. */ … … 2137 2140 * @param pThis Pointer to the DrvAudio instance data. 2138 2141 * @param pStreamEx The stream. One reference for us to release. 2139 */ 2140 static DECLCALLBACK(void) drvAudioStreamDestroyAsync(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx) 2141 { 2142 LogFlowFunc(("pThis=%p pStreamEx=%p (%s)\n", pThis, pStreamEx, pStreamEx->Core.szName)); 2142 * @param fImmediate How to treat draining streams. 2143 */ 2144 static DECLCALLBACK(void) drvAudioStreamDestroyAsync(PDRVAUDIO pThis, PDRVAUDIOSTREAM pStreamEx, bool fImmediate) 2145 { 2146 LogFlowFunc(("pThis=%p pStreamEx=%p (%s) fImmediate=%RTbool\n", pThis, pStreamEx, pStreamEx->Core.szName, fImmediate)); 2143 2147 #ifdef LOG_ENABLED 2144 2148 uint64_t const nsStart = RTTimeNanoTS(); 2145 2149 #endif 2146 2147 2150 RTCritSectEnter(&pStreamEx->Core.CritSect); 2148 2151 2149 /** @todo can we somehow drain it instead? 2150 * Would need to know if the destroying is happening at runtime or when powering 2151 * off the VM, as we don't care for draining the latter case. */ 2152 int rc2 = drvAudioStreamControlInternal(pThis, pStreamEx, PDMAUDIOSTREAMCMD_DISABLE); 2153 LogFlowFunc(("DISABLE done: %Rrc\n", rc2)); 2154 AssertRC(rc2); 2152 pStreamEx->fDestroyImmediate = fImmediate; /* Do NOT adjust for draining status, just pass it as-is. CoreAudio needs this. */ 2153 2154 if (!fImmediate && (pStreamEx->fStatus & PDMAUDIOSTREAM_STS_PENDING_DISABLE)) 2155 LogFlowFunc(("No DISABLE\n")); 2156 else 2157 { 2158 int rc2 = drvAudioStreamControlInternal(pThis, pStreamEx, PDMAUDIOSTREAMCMD_DISABLE); 2159 LogFlowFunc(("DISABLE done: %Rrc\n", rc2)); 2160 AssertRC(rc2); 2161 } 2155 2162 2156 2163 RTCritSectLeave(&pStreamEx->Core.CritSect); … … 2165 2172 * @interface_method_impl{PDMIAUDIOCONNECTOR,pfnStreamDestroy} 2166 2173 */ 2167 static DECLCALLBACK(int) drvAudioStreamDestroy(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAM pStream )2174 static DECLCALLBACK(int) drvAudioStreamDestroy(PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAM pStream, bool fImmediate) 2168 2175 { 2169 2176 PDRVAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVAUDIO, IAudioConnector); … … 2176 2183 PDRVAUDIOSTREAM pStreamEx = (PDRVAUDIOSTREAM)pStream; /* Note! Do not touch pStream after this! */ 2177 2184 AssertPtrReturn(pStreamEx, VERR_INVALID_POINTER); 2178 LogFlowFunc(("ENTER - %p %s\n", pStreamEx, pStreamEx->Core.szName));2185 LogFlowFunc(("ENTER - %p (%s) fImmediate=%RTbool\n", pStreamEx, pStreamEx->Core.szName, fImmediate)); 2179 2186 AssertReturn(pStreamEx->Core.uMagic == PDMAUDIOSTREAM_MAGIC, VERR_INVALID_MAGIC); 2180 2187 AssertReturn(pStreamEx->uMagic == DRVAUDIOSTREAM_MAGIC, VERR_INVALID_MAGIC); … … 2233 2240 */ 2234 2241 if (!(pThis->BackendCfg.fFlags & PDMAUDIOBACKEND_F_ASYNC_STREAM_DESTROY)) 2235 drvAudioStreamDestroyAsync(pThis, pStreamEx );2242 drvAudioStreamDestroyAsync(pThis, pStreamEx, fImmediate); 2236 2243 else 2237 2244 { 2238 2245 int rc2 = RTReqPoolCallEx(pThis->hReqPool, 0 /*cMillies*/, NULL /*phReq*/, 2239 2246 RTREQFLAGS_VOID | RTREQFLAGS_NO_WAIT, 2240 (PFNRT)drvAudioStreamDestroyAsync, 2, pThis, pStreamEx);2247 (PFNRT)drvAudioStreamDestroyAsync, 3, pThis, pStreamEx, fImmediate); 2241 2248 LogFlowFunc(("hReqInitAsync=%p rc2=%Rrc\n", pStreamEx->hReqInitAsync, rc2)); 2242 AssertRCStmt(rc2, drvAudioStreamDestroyAsync(pThis, pStreamEx ));2249 AssertRCStmt(rc2, drvAudioStreamDestroyAsync(pThis, pStreamEx, fImmediate)); 2243 2250 } 2244 2251 } -
trunk/src/VBox/Devices/Audio/DrvHostAudioAlsa.cpp
r89055 r89213 789 789 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDestroy} 790 790 */ 791 static DECLCALLBACK(int) drvHostAlsaAudioHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 791 static DECLCALLBACK(int) drvHostAlsaAudioHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 792 bool fImmediate) 792 793 { 793 794 RT_NOREF(pInterface); 794 795 PALSAAUDIOSTREAM pStreamALSA = (PALSAAUDIOSTREAM)pStream; 795 796 AssertPtrReturn(pStreamALSA, VERR_INVALID_POINTER); 797 RT_NOREF(fImmediate); 796 798 797 799 /** @todo r=bird: It's not like we can do much with a bad status... Check -
trunk/src/VBox/Devices/Audio/DrvHostAudioCoreAudio.cpp
r89212 r89213 1642 1642 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDestroy} 1643 1643 */ 1644 static DECLCALLBACK(int) drvHostAudioCaHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 1644 static DECLCALLBACK(int) drvHostAudioCaHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 1645 bool fImmediate) 1645 1646 { 1646 1647 RT_NOREF(pInterface); 1647 1648 PCOREAUDIOSTREAM pStreamCA = (PCOREAUDIOSTREAM)pStream; 1648 1649 AssertPtrReturn(pStreamCA, VERR_INVALID_POINTER); 1649 LogFunc(("%p: %s \n", pStreamCA, pStreamCA->Cfg.szName));1650 LogFunc(("%p: %s fImmediate=%RTbool\n", pStreamCA, pStreamCA->Cfg.szName, fImmediate)); 1650 1651 #ifdef LOG_ENABLED 1651 1652 uint64_t const nsStart = RTTimeNanoTS(); … … 1668 1669 if (pStreamCA->hAudioQueue) 1669 1670 { 1670 orc = AudioQueueStop(pStreamCA->hAudioQueue, TRUE /*inImmediate/synchronously*/);1671 orc = AudioQueueStop(pStreamCA->hAudioQueue, fImmediate ? TRUE : FALSE /*inImmediate/synchronously*/); 1671 1672 LogFlowFunc(("AudioQueueStop -> %#x\n", orc)); 1672 1673 } … … 1691 1692 #endif 1692 1693 1693 /* Resetting the queue helps prevent AudioQueueDispose from taking a long time. */1694 if (pStreamCA->hAudioQueue )1694 #if 0 /* This seems to work even when doing a non-immediate stop&dispose. However, it doesn't make sense conceptually. */ 1695 if (pStreamCA->hAudioQueue /*&& fImmediate*/) 1695 1696 { 1696 1697 LogFlowFunc(("Calling AudioQueueReset ...\n")); … … 1698 1699 LogFlowFunc(("AudioQueueReset -> %#x\n", orc)); 1699 1700 } 1700 1701 if (pStreamCA->paBuffers) 1701 #endif 1702 1703 if (pStreamCA->paBuffers && fImmediate) 1702 1704 { 1703 1705 LogFlowFunc(("Freeing %u buffers ...\n", pStreamCA->cBuffers)); … … 1708 1710 pStreamCA->paBuffers[iBuf].pBuf = NULL; 1709 1711 } 1710 RTMemFree(pStreamCA->paBuffers); 1711 pStreamCA->paBuffers = NULL; 1712 } 1713 pStreamCA->cBuffers = 0; 1712 } 1714 1713 1715 1714 if (pStreamCA->hAudioQueue) 1716 1715 { 1717 1716 LogFlowFunc(("Disposing of the queue ...\n")); 1718 orc = AudioQueueDispose(pStreamCA->hAudioQueue, TRUE /*inImmediate/synchronously*/); /* may take some time */1717 orc = AudioQueueDispose(pStreamCA->hAudioQueue, fImmediate ? TRUE : FALSE /*inImmediate/synchronously*/); /* may take some time */ 1719 1718 LogFlowFunc(("AudioQueueDispose -> %#x (%d)\n", orc, orc)); 1720 1719 AssertMsg(orc == noErr, ("AudioQueueDispose -> orc=%#x\n", orc)); 1721 1720 pStreamCA->hAudioQueue = NULL; 1722 1721 } 1722 1723 /* We should get no further buffer callbacks at this point according to the docs. */ 1724 if (pStreamCA->paBuffers) 1725 { 1726 RTMemFree(pStreamCA->paBuffers); 1727 pStreamCA->paBuffers = NULL; 1728 } 1729 pStreamCA->cBuffers = 0; 1723 1730 1724 1731 #ifdef CORE_AUDIO_WITH_BREAKPOINT_TIMER -
trunk/src/VBox/Devices/Audio/DrvHostAudioDSound.cpp
r89089 r89213 1723 1723 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDestroy} 1724 1724 */ 1725 static DECLCALLBACK(int) drvHostDSoundHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 1725 static DECLCALLBACK(int) drvHostDSoundHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 1726 bool fImmediate) 1726 1727 { 1727 1728 PDRVHOSTDSOUND pThis = RT_FROM_MEMBER(pInterface, DRVHOSTDSOUND, IHostAudio); … … 1729 1730 AssertPtrReturn(pStreamDS, VERR_INVALID_POINTER); 1730 1731 LogFlowFunc(("Stream '%s' {%s}\n", pStreamDS->Cfg.szName, drvHostDSoundStreamStatusString(pStreamDS))); 1732 RT_NOREF(fImmediate); 1731 1733 1732 1734 RTCritSectEnter(&pThis->CritSect); -
trunk/src/VBox/Devices/Audio/DrvHostAudioDebug.cpp
r89051 r89213 132 132 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDestroy} 133 133 */ 134 static DECLCALLBACK(int) drvHostDebugAudioHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 135 { 136 RT_NOREF(pInterface); 134 static DECLCALLBACK(int) drvHostDebugAudioHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 135 bool fImmediate) 136 { 137 RT_NOREF(pInterface, fImmediate); 137 138 PDEBUGAUDIOSTREAM pStreamDbg = (PDEBUGAUDIOSTREAM)pStream; 138 139 AssertPtrReturn(pStreamDbg, VERR_INVALID_POINTER); -
trunk/src/VBox/Devices/Audio/DrvHostAudioNull.cpp
r88887 r89213 99 99 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDestroy} 100 100 */ 101 static DECLCALLBACK(int) drvHostNullAudioHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 102 { 103 RT_NOREF(pInterface, pStream); 101 static DECLCALLBACK(int) drvHostNullAudioHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 102 bool fImmediate) 103 { 104 RT_NOREF(pInterface, pStream, fImmediate); 104 105 return VINF_SUCCESS; 105 106 } -
trunk/src/VBox/Devices/Audio/DrvHostAudioOss.cpp
r89055 r89213 430 430 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDestroy} 431 431 */ 432 static DECLCALLBACK(int) drvHostOssAudioHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 433 { 434 RT_NOREF(pInterface); 432 static DECLCALLBACK(int) drvHostOssAudioHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 433 bool fImmediate) 434 { 435 RT_NOREF(pInterface, fImmediate); 435 436 POSSAUDIOSTREAM pStreamOSS = (POSSAUDIOSTREAM)pStream; 436 437 AssertPtrReturn(pStreamOSS, VERR_INVALID_POINTER); -
trunk/src/VBox/Devices/Audio/DrvHostAudioPulseAudio.cpp
r89055 r89213 1161 1161 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDestroy} 1162 1162 */ 1163 static DECLCALLBACK(int) drvHostAudioPaHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 1163 static DECLCALLBACK(int) drvHostAudioPaHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 1164 bool fImmediate) 1164 1165 { 1165 1166 PDRVHOSTPULSEAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVHOSTPULSEAUDIO, IHostAudio); 1166 1167 PPULSEAUDIOSTREAM pStreamPA = (PPULSEAUDIOSTREAM)pStream; 1167 1168 AssertPtrReturn(pStreamPA, VERR_INVALID_POINTER); 1169 RT_NOREF(fImmediate); 1168 1170 1169 1171 if (pStreamPA->pStream) -
trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp
r89174 r89213 220 220 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDestroy} 221 221 */ 222 static DECLCALLBACK(int) drvHostValKitAudioHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 223 { 224 RT_NOREF(pInterface); //PDRVHOSTVAKITAUDIO pThis = RT_FROM_MEMBER(pInterface, DRVHOSTVAKITAUDIO, IHostAudio); 222 static DECLCALLBACK(int) drvHostValKitAudioHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 223 bool fImmediate) 224 { 225 RT_NOREF(pInterface, fImmediate); 225 226 PVAKITAUDIOSTREAM pStreamDbg = (PVAKITAUDIOSTREAM)pStream; 226 227 AssertPtrReturn(pStreamDbg, VERR_INVALID_POINTER); -
trunk/src/VBox/Devices/Audio/DrvHostAudioWasApi.cpp
r89129 r89213 1921 1921 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDestroy} 1922 1922 */ 1923 static DECLCALLBACK(int) drvHostAudioWasHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 1923 static DECLCALLBACK(int) drvHostAudioWasHA_StreamDestroy(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 1924 bool fImmediate) 1924 1925 { 1925 1926 PDRVHOSTAUDIOWAS pThis = RT_FROM_MEMBER(pInterface, DRVHOSTAUDIOWAS, IHostAudio); … … 1927 1928 AssertPtrReturn(pStreamWas, VERR_INVALID_POINTER); 1928 1929 LogFlowFunc(("Stream '%s'\n", pStreamWas->Cfg.szName)); 1930 RT_NOREF(fImmediate); 1929 1931 HRESULT hrc; 1930 1932
Note:
See TracChangeset
for help on using the changeset viewer.