Changeset 89510 in vbox
- Timestamp:
- Jun 4, 2021 1:20:02 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/vmm/pdmaudioifs.h
r89500 r89510 1300 1300 1301 1301 /** 1302 * Controls an audio stream. 1303 * 1304 * @returns VBox status code. 1305 * @retval VERR_AUDIO_STREAM_NOT_READY if stream is not ready for required operation (yet). 1306 * @param pInterface Pointer to the interface structure containing the called function pointer. 1307 * @param pStream Pointer to audio stream. 1308 * @param enmStreamCmd The stream command to issue. 1309 */ 1310 DECLR3CALLBACKMEMBER(int, pfnStreamControl, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, 1311 PDMAUDIOSTREAMCMD enmStreamCmd)); 1312 1302 * Enables (starts) the stream. 1303 * 1304 * @returns VBox status code. 1305 * @param pInterface Pointer to this interface. 1306 * @param pStream Pointer to the audio stream to enable. 1307 * @sa PDMAUDIOSTREAMCMD_ENABLE 1308 */ 1309 DECLR3CALLBACKMEMBER(int, pfnStreamEnable, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)); 1310 1311 /** 1312 * Disables (stops) the stream immediately. 1313 * 1314 * @returns VBox status code. 1315 * @param pInterface Pointer to this interface. 1316 * @param pStream Pointer to the audio stream to disable. 1317 * @sa PDMAUDIOSTREAMCMD_DISABLE 1318 */ 1319 DECLR3CALLBACKMEMBER(int, pfnStreamDisable, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)); 1320 1321 /** 1322 * Pauses the stream - called when the VM is suspended. 1323 * 1324 * @returns VBox status code. 1325 * @param pInterface Pointer to this interface. 1326 * @param pStream Pointer to the audio stream to pause. 1327 * @sa PDMAUDIOSTREAMCMD_PAUSE 1328 */ 1329 DECLR3CALLBACKMEMBER(int, pfnStreamPause, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)); 1330 1331 /** 1332 * Resumes a paused stream - called when the VM is resumed. 1333 * 1334 * @returns VBox status code. 1335 * @param pInterface Pointer to this interface. 1336 * @param pStream Pointer to the audio stream to resume. 1337 * @sa PDMAUDIOSTREAMCMD_RESUME 1338 */ 1339 DECLR3CALLBACKMEMBER(int, pfnStreamResume, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)); 1340 1341 /** 1342 * Drain the stream, that is, play what's in the buffers and then stop. 1343 * 1344 * There will be no more samples written after this command is issued. 1345 * PDMIHOSTAUDIO::pfnStreamPlay with a zero sized buffer will provide the 1346 * backend with a way to drive it forwards. These calls will come at a 1347 * frequency set by the device and be on an asynchronous I/O thread. 1348 * 1349 * The PDMIHOSTAUDIO::pfnStreamDisable method maybe called if the device/mixer 1350 * wants to re-enable the stream while it's still draining or if it gets 1351 * impatient and thinks the draining has been going on too long, in which case 1352 * the stream should stop immediately. 1353 * 1354 * @note This should not wait for the stream to finish draining, just change 1355 * the state. (The caller could be an EMT and it must not block for 1356 * hundreds of milliseconds of buffer to finish draining.) 1357 * 1358 * @note Does not apply to input streams. Backends should refuse such 1359 * requests. 1360 * 1361 * @returns VBox status code. 1362 * @retval VERR_WRONG_ORDER if not output stream. 1363 * @param pInterface Pointer to this interface. 1364 * @param pStream Pointer to the audio stream to drain. 1365 * @sa PDMAUDIOSTREAMCMD_DRAIN 1366 */ 1367 DECLR3CALLBACKMEMBER(int, pfnStreamDrain, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)); 1313 1368 1314 1369 /** … … 1329 1384 * @returns Number of pending bytes. 1330 1385 * @param pInterface Pointer to this interface. 1331 * @param pStream Pointer to audio stream.1386 * @param pStream Pointer to the audio stream. 1332 1387 * 1333 1388 * @todo This is no longer not used by DrvAudio and can probably be removed. … … 1389 1444 1390 1445 /** PDMIHOSTAUDIO interface ID. */ 1391 #define PDMIHOSTAUDIO_IID " 2d57627f-6f47-4669-a2fa-93a5f1cb6e51"1446 #define PDMIHOSTAUDIO_IID "c0875b91-a4f9-48be-8595-31d27048432d" 1392 1447 1393 1448 -
trunk/src/VBox/Devices/Audio/DrvAudio.cpp
r89500 r89510 2499 2499 || enmBackendState == PDMHOSTAUDIOSTREAMSTATE_DRAINING) ) 2500 2500 { 2501 /** @todo Backend will change to explicit methods here, so please don't simplify2502 * the switch. */2503 2501 switch (enmStreamCmd) 2504 2502 { 2505 2503 case PDMAUDIOSTREAMCMD_ENABLE: 2506 rc = pThis->pHostDrvAudio->pfnStreamControl(pThis->pHostDrvAudio, pStreamEx->pBackend, 2507 PDMAUDIOSTREAMCMD_ENABLE); 2504 rc = pThis->pHostDrvAudio->pfnStreamEnable(pThis->pHostDrvAudio, pStreamEx->pBackend); 2508 2505 break; 2509 2506 2510 2507 case PDMAUDIOSTREAMCMD_DISABLE: 2511 rc = pThis->pHostDrvAudio->pfnStreamControl(pThis->pHostDrvAudio, pStreamEx->pBackend, 2512 PDMAUDIOSTREAMCMD_DISABLE); 2508 rc = pThis->pHostDrvAudio->pfnStreamDisable(pThis->pHostDrvAudio, pStreamEx->pBackend); 2513 2509 break; 2514 2510 2515 2511 case PDMAUDIOSTREAMCMD_PAUSE: 2516 rc = pThis->pHostDrvAudio->pfnStreamControl(pThis->pHostDrvAudio, pStreamEx->pBackend, 2517 PDMAUDIOSTREAMCMD_PAUSE); 2512 rc = pThis->pHostDrvAudio->pfnStreamPause(pThis->pHostDrvAudio, pStreamEx->pBackend); 2518 2513 break; 2519 2514 2520 2515 case PDMAUDIOSTREAMCMD_RESUME: 2521 rc = pThis->pHostDrvAudio->pfnStreamControl(pThis->pHostDrvAudio, pStreamEx->pBackend, 2522 PDMAUDIOSTREAMCMD_RESUME); 2516 rc = pThis->pHostDrvAudio->pfnStreamResume(pThis->pHostDrvAudio, pStreamEx->pBackend); 2523 2517 break; 2524 2518 2525 2519 case PDMAUDIOSTREAMCMD_DRAIN: 2526 rc = pThis->pHostDrvAudio->pfnStreamControl(pThis->pHostDrvAudio, pStreamEx->pBackend, 2527 PDMAUDIOSTREAMCMD_DRAIN); 2520 if (pThis->pHostDrvAudio->pfnStreamDrain) 2521 rc = pThis->pHostDrvAudio->pfnStreamDrain(pThis->pHostDrvAudio, pStreamEx->pBackend); 2522 else 2523 rc = VERR_NOT_SUPPORTED; 2528 2524 break; 2529 2525 … … 4305 4301 AssertPtrReturn(pIHostDrvAudio->pfnStreamDestroy, VERR_INVALID_POINTER); 4306 4302 AssertPtrNullReturn(pIHostDrvAudio->pfnStreamNotifyDeviceChanged, VERR_INVALID_POINTER); 4307 AssertPtrReturn(pIHostDrvAudio->pfnStreamControl, VERR_INVALID_POINTER); 4303 AssertPtrReturn(pIHostDrvAudio->pfnStreamEnable, VERR_INVALID_POINTER); 4304 AssertPtrReturn(pIHostDrvAudio->pfnStreamDisable, VERR_INVALID_POINTER); 4305 AssertPtrReturn(pIHostDrvAudio->pfnStreamPause, VERR_INVALID_POINTER); 4306 AssertPtrReturn(pIHostDrvAudio->pfnStreamResume, VERR_INVALID_POINTER); 4307 AssertPtrNullReturn(pIHostDrvAudio->pfnStreamDrain, VERR_INVALID_POINTER); 4308 4308 AssertPtrReturn(pIHostDrvAudio->pfnStreamGetReadable, VERR_INVALID_POINTER); 4309 4309 AssertPtrReturn(pIHostDrvAudio->pfnStreamGetWritable, VERR_INVALID_POINTER); -
trunk/src/VBox/Devices/Audio/DrvHostAudioAlsa.cpp
r89508 r89510 836 836 837 837 /** 838 * @ 838 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable} 839 839 */ 840 840 static DECLCALLBACK(int) drvHstAudAlsaHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 880 880 881 881 /** 882 * @ 882 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable} 883 883 */ 884 884 static DECLCALLBACK(int) drvHstAudAlsaHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 901 901 902 902 /** 903 * @ 903 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause} 904 904 */ 905 905 static DECLCALLBACK(int) drvHstAudAlsaHA_StreamPause(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 913 913 914 914 /** 915 * @ 915 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume} 916 916 */ 917 917 static DECLCALLBACK(int) drvHstAudAlsaHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 923 923 924 924 /** 925 * @ 925 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain} 926 926 */ 927 927 static DECLCALLBACK(int) drvHstAudAlsaHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 982 982 983 983 /** 984 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamControl}985 */986 static DECLCALLBACK(int) drvHstAudAlsaHA_StreamControl(PPDMIHOSTAUDIO pInterface,987 PPDMAUDIOBACKENDSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd)988 {989 /** @todo r=bird: I'd like to get rid of this pfnStreamControl method,990 * replacing it with individual StreamXxxx methods. That would save us991 * potentally huge switches and more easily see which drivers implement992 * which operations (grep for pfnStreamXxxx). */993 switch (enmStreamCmd)994 {995 case PDMAUDIOSTREAMCMD_ENABLE:996 return drvHstAudAlsaHA_StreamEnable(pInterface, pStream);997 case PDMAUDIOSTREAMCMD_DISABLE:998 return drvHstAudAlsaHA_StreamDisable(pInterface, pStream);999 case PDMAUDIOSTREAMCMD_PAUSE:1000 return drvHstAudAlsaHA_StreamPause(pInterface, pStream);1001 case PDMAUDIOSTREAMCMD_RESUME:1002 return drvHstAudAlsaHA_StreamResume(pInterface, pStream);1003 case PDMAUDIOSTREAMCMD_DRAIN:1004 return drvHstAudAlsaHA_StreamDrain(pInterface, pStream);1005 1006 case PDMAUDIOSTREAMCMD_END:1007 case PDMAUDIOSTREAMCMD_32BIT_HACK:1008 case PDMAUDIOSTREAMCMD_INVALID:1009 /* no default*/1010 break;1011 }1012 return VERR_NOT_SUPPORTED;1013 }1014 1015 1016 /**1017 984 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetState} 1018 985 */ … … 1518 1485 pThis->IHostAudio.pfnStreamDestroy = drvHstAudAlsaHA_StreamDestroy; 1519 1486 pThis->IHostAudio.pfnStreamNotifyDeviceChanged = NULL; 1520 pThis->IHostAudio.pfnStreamControl = drvHstAudAlsaHA_StreamControl; 1487 pThis->IHostAudio.pfnStreamEnable = drvHstAudAlsaHA_StreamEnable; 1488 pThis->IHostAudio.pfnStreamDisable = drvHstAudAlsaHA_StreamDisable; 1489 pThis->IHostAudio.pfnStreamPause = drvHstAudAlsaHA_StreamPause; 1490 pThis->IHostAudio.pfnStreamResume = drvHstAudAlsaHA_StreamResume; 1491 pThis->IHostAudio.pfnStreamDrain = drvHstAudAlsaHA_StreamDrain; 1521 1492 pThis->IHostAudio.pfnStreamGetPending = drvHstAudAlsaHA_StreamGetPending; 1522 1493 pThis->IHostAudio.pfnStreamGetState = drvHstAudAlsaHA_StreamGetState; -
trunk/src/VBox/Devices/Audio/DrvHostAudioCoreAudio.cpp
r89502 r89510 2108 2108 2109 2109 /** 2110 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamControl}2111 */2112 static DECLCALLBACK(int) drvHstAudCaHA_StreamControl(PPDMIHOSTAUDIO pInterface,2113 PPDMAUDIOBACKENDSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd)2114 {2115 /** @todo r=bird: I'd like to get rid of this pfnStreamControl method,2116 * replacing it with individual StreamXxxx methods. That would save us2117 * potentally huge switches and more easily see which drivers implement2118 * which operations (grep for pfnStreamXxxx). */2119 switch (enmStreamCmd)2120 {2121 case PDMAUDIOSTREAMCMD_ENABLE:2122 return drvHstAudCaHA_StreamEnable(pInterface, pStream);2123 case PDMAUDIOSTREAMCMD_DISABLE:2124 return drvHstAudCaHA_StreamDisable(pInterface, pStream);2125 case PDMAUDIOSTREAMCMD_PAUSE:2126 return drvHstAudCaHA_StreamPause(pInterface, pStream);2127 case PDMAUDIOSTREAMCMD_RESUME:2128 return drvHstAudCaHA_StreamResume(pInterface, pStream);2129 case PDMAUDIOSTREAMCMD_DRAIN:2130 return drvHstAudCaHA_StreamDrain(pInterface, pStream);2131 2132 case PDMAUDIOSTREAMCMD_END:2133 case PDMAUDIOSTREAMCMD_32BIT_HACK:2134 case PDMAUDIOSTREAMCMD_INVALID:2135 /* no default*/2136 break;2137 }2138 return VERR_NOT_SUPPORTED;2139 }2140 2141 2142 /**2143 2110 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetReadable} 2144 2111 */ … … 2782 2749 pThis->IHostAudio.pfnStreamDestroy = drvHstAudCaHA_StreamDestroy; 2783 2750 pThis->IHostAudio.pfnStreamNotifyDeviceChanged = NULL; 2784 pThis->IHostAudio.pfnStreamControl = drvHstAudCaHA_StreamControl; 2751 pThis->IHostAudio.pfnStreamEnable = drvHstAudCaHA_StreamEnable; 2752 pThis->IHostAudio.pfnStreamDisable = drvHstAudCaHA_StreamDisable; 2753 pThis->IHostAudio.pfnStreamPause = drvHstAudCaHA_StreamPause; 2754 pThis->IHostAudio.pfnStreamResume = drvHstAudCaHA_StreamResume; 2755 pThis->IHostAudio.pfnStreamDrain = drvHstAudCaHA_StreamDrain; 2785 2756 pThis->IHostAudio.pfnStreamGetReadable = drvHstAudCaHA_StreamGetReadable; 2786 2757 pThis->IHostAudio.pfnStreamGetWritable = drvHstAudCaHA_StreamGetWritable; -
trunk/src/VBox/Devices/Audio/DrvHostAudioDSound.cpp
r89504 r89510 1910 1910 1911 1911 /** 1912 * @ 1912 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable} 1913 1913 */ 1914 1914 static DECLCALLBACK(int) drvHostDSoundHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 1973 1973 1974 1974 /** 1975 * @ 1975 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable} 1976 1976 */ 1977 1977 static DECLCALLBACK(int) drvHostDSoundHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 2026 2026 2027 2027 /** 2028 * @ 2028 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause} 2029 2029 * 2030 2030 * @note Basically the same as drvHostDSoundHA_StreamDisable, just w/o the … … 2114 2114 2115 2115 /** 2116 * @ 2116 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume} 2117 2117 */ 2118 2118 static DECLCALLBACK(int) drvHostDSoundHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 2142 2142 2143 2143 /** 2144 * @ 2144 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain} 2145 2145 */ 2146 2146 static DECLCALLBACK(int) drvHostDSoundHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 2191 2191 LogFlowFunc(("returns %Rrc {%s}\n", rc, drvHostDSoundStreamStatusString(pStreamDS))); 2192 2192 return rc; 2193 }2194 2195 2196 /**2197 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamControl}2198 */2199 static DECLCALLBACK(int) drvHostDSoundHA_StreamControl(PPDMIHOSTAUDIO pInterface,2200 PPDMAUDIOBACKENDSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd)2201 {2202 /** @todo r=bird: I'd like to get rid of this pfnStreamControl method,2203 * replacing it with individual StreamXxxx methods. That would save us2204 * potentally huge switches and more easily see which drivers implement2205 * which operations (grep for pfnStreamXxxx). */2206 switch (enmStreamCmd)2207 {2208 case PDMAUDIOSTREAMCMD_ENABLE:2209 return drvHostDSoundHA_StreamEnable(pInterface, pStream);2210 case PDMAUDIOSTREAMCMD_DISABLE:2211 return drvHostDSoundHA_StreamDisable(pInterface, pStream);2212 case PDMAUDIOSTREAMCMD_PAUSE:2213 return drvHostDSoundHA_StreamPause(pInterface, pStream);2214 case PDMAUDIOSTREAMCMD_RESUME:2215 return drvHostDSoundHA_StreamResume(pInterface, pStream);2216 case PDMAUDIOSTREAMCMD_DRAIN:2217 return drvHostDSoundHA_StreamDrain(pInterface, pStream);2218 2219 case PDMAUDIOSTREAMCMD_END:2220 case PDMAUDIOSTREAMCMD_32BIT_HACK:2221 case PDMAUDIOSTREAMCMD_INVALID:2222 /* no default*/2223 break;2224 }2225 return VERR_NOT_SUPPORTED;2226 2193 } 2227 2194 … … 2772 2739 pThis->IHostAudio.pfnStreamDestroy = drvHostDSoundHA_StreamDestroy; 2773 2740 pThis->IHostAudio.pfnStreamNotifyDeviceChanged = NULL; 2774 pThis->IHostAudio.pfnStreamControl = drvHostDSoundHA_StreamControl; 2741 pThis->IHostAudio.pfnStreamEnable = drvHostDSoundHA_StreamEnable; 2742 pThis->IHostAudio.pfnStreamDisable = drvHostDSoundHA_StreamDisable; 2743 pThis->IHostAudio.pfnStreamPause = drvHostDSoundHA_StreamPause; 2744 pThis->IHostAudio.pfnStreamResume = drvHostDSoundHA_StreamResume; 2745 pThis->IHostAudio.pfnStreamDrain = drvHostDSoundHA_StreamDrain; 2775 2746 pThis->IHostAudio.pfnStreamGetState = drvHostDSoundHA_StreamGetState; 2776 2747 pThis->IHostAudio.pfnStreamGetPending = NULL; -
trunk/src/VBox/Devices/Audio/DrvHostAudioDebug.cpp
r89504 r89510 150 150 151 151 /** 152 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable} 153 */ 154 static DECLCALLBACK(int) drvHstAudDebugHA_StreamControlStub(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 155 { 156 RT_NOREF(pInterface, pStream); 157 return VINF_SUCCESS; 158 } 159 160 161 /** 162 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamControl} 163 */ 164 static DECLCALLBACK(int) drvHstAudDebugHA_StreamControl(PPDMIHOSTAUDIO pInterface, 165 PPDMAUDIOBACKENDSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd) 166 { 167 /** @todo r=bird: I'd like to get rid of this pfnStreamControl method, 168 * replacing it with individual StreamXxxx methods. That would save us 169 * potentally huge switches and more easily see which drivers implement 170 * which operations (grep for pfnStreamXxxx). */ 171 switch (enmStreamCmd) 172 { 173 case PDMAUDIOSTREAMCMD_ENABLE: 174 return drvHstAudDebugHA_StreamControlStub(pInterface, pStream); 175 case PDMAUDIOSTREAMCMD_DISABLE: 176 return drvHstAudDebugHA_StreamControlStub(pInterface, pStream); 177 case PDMAUDIOSTREAMCMD_PAUSE: 178 return drvHstAudDebugHA_StreamControlStub(pInterface, pStream); 179 case PDMAUDIOSTREAMCMD_RESUME: 180 return drvHstAudDebugHA_StreamControlStub(pInterface, pStream); 181 case PDMAUDIOSTREAMCMD_DRAIN: 182 return drvHstAudDebugHA_StreamControlStub(pInterface, pStream); 183 184 case PDMAUDIOSTREAMCMD_END: 185 case PDMAUDIOSTREAMCMD_32BIT_HACK: 186 case PDMAUDIOSTREAMCMD_INVALID: 187 /* no default*/ 188 break; 189 } 190 return VERR_NOT_SUPPORTED; 152 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable} 153 */ 154 static DECLCALLBACK(int) drvHstAudDebugHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 155 { 156 RT_NOREF(pInterface, pStream); 157 return VINF_SUCCESS; 158 } 159 160 161 /** 162 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable} 163 */ 164 static DECLCALLBACK(int) drvHstAudDebugHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 165 { 166 RT_NOREF(pInterface, pStream); 167 return VINF_SUCCESS; 168 } 169 170 171 /** 172 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause} 173 */ 174 static DECLCALLBACK(int) drvHstAudDebugHA_StreamPause(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 175 { 176 RT_NOREF(pInterface, pStream); 177 return VINF_SUCCESS; 178 } 179 180 181 /** 182 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume} 183 */ 184 static DECLCALLBACK(int) drvHstAudDebugHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 185 { 186 RT_NOREF(pInterface, pStream); 187 return VINF_SUCCESS; 188 } 189 190 191 /** 192 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain} 193 */ 194 static DECLCALLBACK(int) drvHstAudDebugHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 195 { 196 RT_NOREF(pInterface, pStream); 197 return VINF_SUCCESS; 191 198 } 192 199 … … 326 333 pThis->IHostAudio.pfnStreamDestroy = drvHstAudDebugHA_StreamDestroy; 327 334 pThis->IHostAudio.pfnStreamNotifyDeviceChanged = NULL; 328 pThis->IHostAudio.pfnStreamControl = drvHstAudDebugHA_StreamControl; 335 pThis->IHostAudio.pfnStreamEnable = drvHstAudDebugHA_StreamEnable; 336 pThis->IHostAudio.pfnStreamDisable = drvHstAudDebugHA_StreamDisable; 337 pThis->IHostAudio.pfnStreamPause = drvHstAudDebugHA_StreamPause; 338 pThis->IHostAudio.pfnStreamResume = drvHstAudDebugHA_StreamResume; 339 pThis->IHostAudio.pfnStreamDrain = drvHstAudDebugHA_StreamDrain; 329 340 pThis->IHostAudio.pfnStreamGetState = drvHstAudDebugHA_StreamGetState; 330 341 pThis->IHostAudio.pfnStreamGetPending = drvHstAudDebugHA_StreamGetPending; -
trunk/src/VBox/Devices/Audio/DrvHostAudioNull.cpp
r89504 r89510 107 107 108 108 /** 109 * @ 109 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable} 110 110 */ 111 111 static DECLCALLBACK(int) drvHstAudNullHA_StreamControlStub(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 113 113 RT_NOREF(pInterface, pStream); 114 114 return VINF_SUCCESS; 115 }116 117 118 /**119 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamControl}120 */121 static DECLCALLBACK(int) drvHstAudNullHA_StreamControl(PPDMIHOSTAUDIO pInterface,122 PPDMAUDIOBACKENDSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd)123 {124 /** @todo r=bird: I'd like to get rid of this pfnStreamControl method,125 * replacing it with individual StreamXxxx methods. That would save us126 * potentally huge switches and more easily see which drivers implement127 * which operations (grep for pfnStreamXxxx). */128 switch (enmStreamCmd)129 {130 case PDMAUDIOSTREAMCMD_ENABLE:131 return drvHstAudNullHA_StreamControlStub(pInterface, pStream);132 case PDMAUDIOSTREAMCMD_DISABLE:133 return drvHstAudNullHA_StreamControlStub(pInterface, pStream);134 case PDMAUDIOSTREAMCMD_PAUSE:135 return drvHstAudNullHA_StreamControlStub(pInterface, pStream);136 case PDMAUDIOSTREAMCMD_RESUME:137 return drvHstAudNullHA_StreamControlStub(pInterface, pStream);138 case PDMAUDIOSTREAMCMD_DRAIN:139 return drvHstAudNullHA_StreamControlStub(pInterface, pStream);140 141 case PDMAUDIOSTREAMCMD_END:142 case PDMAUDIOSTREAMCMD_32BIT_HACK:143 case PDMAUDIOSTREAMCMD_INVALID:144 /* no default*/145 break;146 }147 return VERR_NOT_SUPPORTED;148 115 } 149 116 … … 247 214 /* .pfnStreamDestroy =*/ drvHstAudNullHA_StreamDestroy, 248 215 /* .pfnStreamNotifyDeviceChanged =*/ NULL, 249 /* .pfnStreamControl =*/ drvHstAudNullHA_StreamControl, 216 /* .pfnStreamEnable =*/ drvHstAudNullHA_StreamControlStub, 217 /* .pfnStreamDisable =*/ drvHstAudNullHA_StreamControlStub, 218 /* .pfnStreamPause =*/ drvHstAudNullHA_StreamControlStub, 219 /* .pfnStreamResume =*/ drvHstAudNullHA_StreamControlStub, 220 /* .pfnStreamDrain =*/ drvHstAudNullHA_StreamControlStub, 250 221 /* .pfnStreamGetState =*/ drvHstAudNullHA_StreamGetState, 251 222 /* .pfnStreamGetPending =*/ drvHstAudNullHA_StreamGetPending, -
trunk/src/VBox/Devices/Audio/DrvHostAudioOss.cpp
r89504 r89510 457 457 458 458 /** 459 * @ 459 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable} 460 460 */ 461 461 static DECLCALLBACK(int) drvHstAudOssHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 488 488 489 489 /** 490 * @ 490 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable} 491 491 */ 492 492 static DECLCALLBACK(int) drvHstAudOssHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 540 540 541 541 /** 542 * @ 542 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause} 543 543 */ 544 544 static DECLCALLBACK(int) drvHstAudOssHA_StreamPause(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 549 549 550 550 /** 551 * @ 551 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume} 552 552 */ 553 553 static DECLCALLBACK(int) drvHstAudOssHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 601 601 602 602 /** 603 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable}603 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain} 604 604 */ 605 605 static DECLCALLBACK(int) drvHstAudOssHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 638 638 639 639 return VINF_SUCCESS; 640 }641 642 643 /**644 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamControl}645 */646 static DECLCALLBACK(int) drvHstAudOssHA_StreamControl(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream,647 PDMAUDIOSTREAMCMD enmStreamCmd)648 {649 /** @todo r=bird: I'd like to get rid of this pfnStreamControl method,650 * replacing it with individual StreamXxxx methods. That would save us651 * potentally huge switches and more easily see which drivers implement652 * which operations (grep for pfnStreamXxxx). */653 switch (enmStreamCmd)654 {655 case PDMAUDIOSTREAMCMD_ENABLE:656 return drvHstAudOssHA_StreamEnable(pInterface, pStream);657 case PDMAUDIOSTREAMCMD_DISABLE:658 return drvHstAudOssHA_StreamDisable(pInterface, pStream);659 case PDMAUDIOSTREAMCMD_PAUSE:660 return drvHstAudOssHA_StreamPause(pInterface, pStream);661 case PDMAUDIOSTREAMCMD_RESUME:662 return drvHstAudOssHA_StreamResume(pInterface, pStream);663 case PDMAUDIOSTREAMCMD_DRAIN:664 return drvHstAudOssHA_StreamDrain(pInterface, pStream);665 /** @todo the drain call for OSS is SNDCTL_DSP_SYNC, however in the non-ALSA666 * implementation of OSS it is probably blocking. Also, it comes with667 * caveats about clicks and silence... */668 case PDMAUDIOSTREAMCMD_END:669 case PDMAUDIOSTREAMCMD_32BIT_HACK:670 case PDMAUDIOSTREAMCMD_INVALID:671 /* no default*/672 break;673 }674 return VERR_NOT_SUPPORTED;675 640 } 676 641 … … 912 877 pThis->IHostAudio.pfnStreamDestroy = drvHstAudOssHA_StreamDestroy; 913 878 pThis->IHostAudio.pfnStreamNotifyDeviceChanged = NULL; 914 pThis->IHostAudio.pfnStreamControl = drvHstAudOssHA_StreamControl; 879 pThis->IHostAudio.pfnStreamEnable = drvHstAudOssHA_StreamEnable; 880 pThis->IHostAudio.pfnStreamDisable = drvHstAudOssHA_StreamDisable; 881 pThis->IHostAudio.pfnStreamPause = drvHstAudOssHA_StreamPause; 882 pThis->IHostAudio.pfnStreamResume = drvHstAudOssHA_StreamResume; 883 pThis->IHostAudio.pfnStreamDrain = drvHstAudOssHA_StreamDrain; 915 884 pThis->IHostAudio.pfnStreamGetState = drvHstAudOssHA_StreamGetState; 916 885 pThis->IHostAudio.pfnStreamGetPending = NULL; -
trunk/src/VBox/Devices/Audio/DrvHostAudioPulseAudio.cpp
r89504 r89510 1329 1329 1330 1330 /** 1331 * @ 1331 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable} 1332 1332 */ 1333 1333 static DECLCALLBACK(int) drvHstAudPaHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 1358 1358 1359 1359 /** 1360 * @ 1360 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable} 1361 1361 */ 1362 1362 static DECLCALLBACK(int) drvHstAudPaHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 1418 1418 1419 1419 /** 1420 * @ 1420 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause} 1421 1421 */ 1422 1422 static DECLCALLBACK(int) drvHstAudPaHA_StreamPause(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 1428 1428 1429 1429 /** 1430 * @ 1430 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume} 1431 1431 */ 1432 1432 static DECLCALLBACK(int) drvHstAudPaHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 1490 1490 1491 1491 /** 1492 * @ 1492 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain} 1493 1493 */ 1494 1494 static DECLCALLBACK(int) drvHstAudPaHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 1553 1553 LogFlowFunc(("returns %Rrc\n", rc)); 1554 1554 return rc; 1555 }1556 1557 1558 /**1559 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamControl}1560 */1561 static DECLCALLBACK(int) drvHstAudPaHA_StreamControl(PPDMIHOSTAUDIO pInterface,1562 PPDMAUDIOBACKENDSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd)1563 {1564 /** @todo r=bird: I'd like to get rid of this pfnStreamControl method,1565 * replacing it with individual StreamXxxx methods. That would save us1566 * potentally huge switches and more easily see which drivers implement1567 * which operations (grep for pfnStreamXxxx). */1568 switch (enmStreamCmd)1569 {1570 case PDMAUDIOSTREAMCMD_ENABLE:1571 return drvHstAudPaHA_StreamEnable(pInterface, pStream);1572 case PDMAUDIOSTREAMCMD_DISABLE:1573 return drvHstAudPaHA_StreamDisable(pInterface, pStream);1574 case PDMAUDIOSTREAMCMD_PAUSE:1575 return drvHstAudPaHA_StreamPause(pInterface, pStream);1576 case PDMAUDIOSTREAMCMD_RESUME:1577 return drvHstAudPaHA_StreamResume(pInterface, pStream);1578 case PDMAUDIOSTREAMCMD_DRAIN:1579 return drvHstAudPaHA_StreamDrain(pInterface, pStream);1580 1581 case PDMAUDIOSTREAMCMD_END:1582 case PDMAUDIOSTREAMCMD_32BIT_HACK:1583 case PDMAUDIOSTREAMCMD_INVALID:1584 /* no default*/1585 break;1586 }1587 return VERR_NOT_SUPPORTED;1588 1555 } 1589 1556 … … 2042 2009 pThis->IHostAudio.pfnStreamDestroy = drvHstAudPaHA_StreamDestroy; 2043 2010 pThis->IHostAudio.pfnStreamNotifyDeviceChanged = NULL; 2044 pThis->IHostAudio.pfnStreamControl = drvHstAudPaHA_StreamControl; 2011 pThis->IHostAudio.pfnStreamEnable = drvHstAudPaHA_StreamEnable; 2012 pThis->IHostAudio.pfnStreamDisable = drvHstAudPaHA_StreamDisable; 2013 pThis->IHostAudio.pfnStreamPause = drvHstAudPaHA_StreamPause; 2014 pThis->IHostAudio.pfnStreamResume = drvHstAudPaHA_StreamResume; 2015 pThis->IHostAudio.pfnStreamDrain = drvHstAudPaHA_StreamDrain; 2045 2016 pThis->IHostAudio.pfnStreamGetState = drvHstAudPaHA_StreamGetState; 2046 2017 pThis->IHostAudio.pfnStreamGetPending = NULL; -
trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp
r89487 r89510 368 368 369 369 /** 370 * @ 371 */ 372 static DECLCALLBACK(int) drvHostValKitAudioHA_Stream ControlStub(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)370 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable} 371 */ 372 static DECLCALLBACK(int) drvHostValKitAudioHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 373 373 { 374 374 RT_NOREF(pInterface, pStream); … … 378 378 379 379 /** 380 * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable} 381 */ 382 static DECLCALLBACK(int) drvHostValKitAudioHA_StreamDisableOrPauseOrDrain(PPDMIHOSTAUDIO pInterface, 383 PPDMAUDIOBACKENDSTREAM pStream) 384 { 385 RT_NOREF(pInterface); 386 PVALKITAUDIOSTREAM pStreamDbg = (PVALKITAUDIOSTREAM)pStream; 387 AssertPtrReturn(pStreamDbg, VERR_INVALID_POINTER); 388 380 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable} 381 */ 382 static DECLCALLBACK(int) drvHostValKitAudioHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 383 { 384 RT_NOREF(pInterface, pStream); 389 385 return VINF_SUCCESS; 390 386 } … … 392 388 393 389 /** 394 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamControl} 395 */ 396 static DECLCALLBACK(int) drvHostValKitAudioHA_StreamControl(PPDMIHOSTAUDIO pInterface, 397 PPDMAUDIOBACKENDSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd) 398 { 399 /** @todo r=bird: I'd like to get rid of this pfnStreamControl method, 400 * replacing it with individual StreamXxxx methods. That would save us 401 * potentally huge switches and more easily see which drivers implement 402 * which operations (grep for pfnStreamXxxx). */ 403 switch (enmStreamCmd) 404 { 405 case PDMAUDIOSTREAMCMD_ENABLE: 406 return drvHostValKitAudioHA_StreamControlStub(pInterface, pStream); 407 case PDMAUDIOSTREAMCMD_DISABLE: 408 return drvHostValKitAudioHA_StreamControlStub(pInterface, pStream); 409 case PDMAUDIOSTREAMCMD_PAUSE: 410 return drvHostValKitAudioHA_StreamDisableOrPauseOrDrain(pInterface, pStream); 411 case PDMAUDIOSTREAMCMD_RESUME: 412 return drvHostValKitAudioHA_StreamDisableOrPauseOrDrain(pInterface, pStream); 413 case PDMAUDIOSTREAMCMD_DRAIN: 414 return drvHostValKitAudioHA_StreamDisableOrPauseOrDrain(pInterface, pStream); 415 416 case PDMAUDIOSTREAMCMD_END: 417 case PDMAUDIOSTREAMCMD_32BIT_HACK: 418 case PDMAUDIOSTREAMCMD_INVALID: 419 /* no default*/ 420 break; 421 } 422 return VERR_NOT_SUPPORTED; 390 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause} 391 */ 392 static DECLCALLBACK(int) drvHostValKitAudioHA_StreamPause(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 393 { 394 RT_NOREF(pInterface, pStream); 395 return VINF_SUCCESS; 396 } 397 398 399 /** 400 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume} 401 */ 402 static DECLCALLBACK(int) drvHostValKitAudioHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 403 { 404 RT_NOREF(pInterface, pStream); 405 return VINF_SUCCESS; 406 } 407 408 409 /** 410 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain} 411 */ 412 static DECLCALLBACK(int) drvHostValKitAudioHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 413 { 414 RT_NOREF(pInterface, pStream); 415 return VINF_SUCCESS; 423 416 } 424 417 … … 697 690 pThis->IHostAudio.pfnStreamDestroy = drvHostValKitAudioHA_StreamDestroy; 698 691 pThis->IHostAudio.pfnStreamNotifyDeviceChanged = NULL; 699 pThis->IHostAudio.pfnStreamControl = drvHostValKitAudioHA_StreamControl; 692 pThis->IHostAudio.pfnStreamEnable = drvHostValKitAudioHA_StreamEnable; 693 pThis->IHostAudio.pfnStreamDisable = drvHostValKitAudioHA_StreamDisable; 694 pThis->IHostAudio.pfnStreamPause = drvHostValKitAudioHA_StreamPause; 695 pThis->IHostAudio.pfnStreamResume = drvHostValKitAudioHA_StreamResume; 696 pThis->IHostAudio.pfnStreamDrain = drvHostValKitAudioHA_StreamDrain; 700 697 pThis->IHostAudio.pfnStreamGetReadable = drvHostValKitAudioHA_StreamGetReadable; 701 698 pThis->IHostAudio.pfnStreamGetWritable = drvHostValKitAudioHA_StreamGetWritable; -
trunk/src/VBox/Devices/Audio/DrvHostAudioWasApi.cpp
r89504 r89510 2121 2121 2122 2122 /** 2123 * @ 2123 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable} 2124 2124 */ 2125 2125 static DECLCALLBACK(int) drvHostAudioWasHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 2171 2171 2172 2172 /** 2173 * @ 2173 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable} 2174 2174 */ 2175 2175 static DECLCALLBACK(int) drvHostAudioWasHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 2210 2210 2211 2211 /** 2212 * @ 2212 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause} 2213 2213 * 2214 2214 * @note Basically the same as drvHostAudioWasHA_StreamDisable, just w/o the … … 2258 2258 2259 2259 /** 2260 * @ 2260 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume} 2261 2261 */ 2262 2262 static DECLCALLBACK(int) drvHostAudioWasHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 2284 2284 2285 2285 /** 2286 * @ 2286 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain} 2287 2287 */ 2288 2288 static DECLCALLBACK(int) drvHostAudioWasHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 2338 2338 LogFlowFunc(("returns %Rrc {%s}\n", rc, drvHostWasStreamStatusString(pStreamWas))); 2339 2339 return rc; 2340 }2341 2342 2343 /**2344 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamControl}2345 */2346 static DECLCALLBACK(int) drvHostAudioWasHA_StreamControl(PPDMIHOSTAUDIO pInterface,2347 PPDMAUDIOBACKENDSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd)2348 {2349 /** @todo r=bird: I'd like to get rid of this pfnStreamControl method,2350 * replacing it with individual StreamXxxx methods. That would save us2351 * potentally huge switches and more easily see which drivers implement2352 * which operations (grep for pfnStreamXxxx). */2353 switch (enmStreamCmd)2354 {2355 case PDMAUDIOSTREAMCMD_ENABLE:2356 return drvHostAudioWasHA_StreamEnable(pInterface, pStream);2357 case PDMAUDIOSTREAMCMD_DISABLE:2358 return drvHostAudioWasHA_StreamDisable(pInterface, pStream);2359 case PDMAUDIOSTREAMCMD_PAUSE:2360 return drvHostAudioWasHA_StreamPause(pInterface, pStream);2361 case PDMAUDIOSTREAMCMD_RESUME:2362 return drvHostAudioWasHA_StreamResume(pInterface, pStream);2363 case PDMAUDIOSTREAMCMD_DRAIN:2364 return drvHostAudioWasHA_StreamDrain(pInterface, pStream);2365 2366 case PDMAUDIOSTREAMCMD_END:2367 case PDMAUDIOSTREAMCMD_32BIT_HACK:2368 case PDMAUDIOSTREAMCMD_INVALID:2369 /* no default*/2370 break;2371 }2372 return VERR_NOT_SUPPORTED;2373 2340 } 2374 2341 … … 3029 2996 pThis->IHostAudio.pfnStreamDestroy = drvHostAudioWasHA_StreamDestroy; 3030 2997 pThis->IHostAudio.pfnStreamNotifyDeviceChanged = drvHostAudioWasHA_StreamNotifyDeviceChanged; 3031 pThis->IHostAudio.pfnStreamControl = drvHostAudioWasHA_StreamControl; 2998 pThis->IHostAudio.pfnStreamEnable = drvHostAudioWasHA_StreamEnable; 2999 pThis->IHostAudio.pfnStreamDisable = drvHostAudioWasHA_StreamDisable; 3000 pThis->IHostAudio.pfnStreamPause = drvHostAudioWasHA_StreamPause; 3001 pThis->IHostAudio.pfnStreamResume = drvHostAudioWasHA_StreamResume; 3002 pThis->IHostAudio.pfnStreamDrain = drvHostAudioWasHA_StreamDrain; 3032 3003 pThis->IHostAudio.pfnStreamGetState = drvHostAudioWasHA_StreamGetState; 3033 3004 pThis->IHostAudio.pfnStreamGetPending = drvHostAudioWasHA_StreamGetPending; -
trunk/src/VBox/Main/src-client/DrvAudioRec.cpp
r89504 r89510 543 543 544 544 /** 545 * Controls an audio output stream 546 * 547 * @returns VBox status code. 548 * @param pThis Driver instance. 549 * @param pStreamAV Audio output stream to control. 550 * @param enmStreamCmd Stream command to issue. 551 */ 552 static int avRecControlStreamOut(PDRVAUDIORECORDING pThis, PAVRECSTREAM pStreamAV, PDMAUDIOSTREAMCMD enmStreamCmd) 553 { 554 RT_NOREF(pThis, pStreamAV); 555 556 int rc; 557 switch (enmStreamCmd) 558 { 559 case PDMAUDIOSTREAMCMD_ENABLE: 560 case PDMAUDIOSTREAMCMD_DISABLE: 561 case PDMAUDIOSTREAMCMD_RESUME: 562 case PDMAUDIOSTREAMCMD_PAUSE: 563 case PDMAUDIOSTREAMCMD_DRAIN: 564 rc = VINF_SUCCESS; 565 break; 566 567 default: 568 rc = VERR_NOT_SUPPORTED; 569 break; 570 } 571 572 return rc; 573 } 574 575 576 /** 577 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamControl} 578 */ 579 static DECLCALLBACK(int) drvAudioVideoRecHA_StreamControl(PPDMIHOSTAUDIO pInterface, 580 PPDMAUDIOBACKENDSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd) 581 { 582 PDRVAUDIORECORDING pThis = RT_FROM_CPP_MEMBER(pInterface, DRVAUDIORECORDING, IHostAudio); 583 PAVRECSTREAM pStreamAV = (PAVRECSTREAM)pStream; 584 AssertPtrReturn(pStreamAV, VERR_INVALID_POINTER); 585 586 if (pStreamAV->Cfg.enmDir == PDMAUDIODIR_OUT) 587 return avRecControlStreamOut(pThis, pStreamAV, enmStreamCmd); 588 545 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable} 546 */ 547 static DECLCALLBACK(int) drvAudioVideoRecHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 548 { 549 RT_NOREF(pInterface, pStream); 550 return VINF_SUCCESS; 551 } 552 553 554 /** 555 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable} 556 */ 557 static DECLCALLBACK(int) drvAudioVideoRecHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 558 { 559 RT_NOREF(pInterface, pStream); 560 return VINF_SUCCESS; 561 } 562 563 564 /** 565 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause} 566 */ 567 static DECLCALLBACK(int) drvAudioVideoRecHA_StreamPause(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 568 { 569 RT_NOREF(pInterface, pStream); 570 return VINF_SUCCESS; 571 } 572 573 574 /** 575 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume} 576 */ 577 static DECLCALLBACK(int) drvAudioVideoRecHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 578 { 579 RT_NOREF(pInterface, pStream); 580 return VINF_SUCCESS; 581 } 582 583 584 /** 585 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain} 586 */ 587 static DECLCALLBACK(int) drvAudioVideoRecHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) 588 { 589 RT_NOREF(pInterface, pStream); 589 590 return VINF_SUCCESS; 590 591 } … … 1114 1115 pThis->IHostAudio.pfnStreamDestroy = drvAudioVideoRecHA_StreamDestroy; 1115 1116 pThis->IHostAudio.pfnStreamNotifyDeviceChanged = NULL; 1116 pThis->IHostAudio.pfnStreamControl = drvAudioVideoRecHA_StreamControl; 1117 pThis->IHostAudio.pfnStreamEnable = drvAudioVideoRecHA_StreamEnable; 1118 pThis->IHostAudio.pfnStreamDisable = drvAudioVideoRecHA_StreamDisable; 1119 pThis->IHostAudio.pfnStreamPause = drvAudioVideoRecHA_StreamPause; 1120 pThis->IHostAudio.pfnStreamResume = drvAudioVideoRecHA_StreamResume; 1121 pThis->IHostAudio.pfnStreamDrain = drvAudioVideoRecHA_StreamDrain; 1117 1122 pThis->IHostAudio.pfnStreamGetState = drvAudioVideoRecHA_StreamGetState; 1118 1123 pThis->IHostAudio.pfnStreamGetPending = NULL; -
trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp
r89504 r89510 417 417 418 418 /** 419 * @ 419 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable} 420 420 */ 421 421 static DECLCALLBACK(int) drvAudioVrdeHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 451 451 452 452 /** 453 * @ 453 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable} 454 454 */ 455 455 static DECLCALLBACK(int) drvAudioVrdeHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 477 477 478 478 /** 479 * @ 479 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause} 480 480 */ 481 481 static DECLCALLBACK(int) drvAudioVrdeHA_StreamPause(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 495 495 496 496 /** 497 * @ 497 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume} 498 498 */ 499 499 static DECLCALLBACK(int) drvAudioVrdeHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 513 513 514 514 /** 515 * @ 515 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain} 516 516 */ 517 517 static DECLCALLBACK(int) drvAudioVrdeHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream) … … 520 520 LogFlowFunc(("returns VINF_SUCCESS\n")); 521 521 return VINF_SUCCESS; 522 }523 524 525 /**526 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamControl}527 */528 static DECLCALLBACK(int) drvAudioVrdeHA_StreamControl(PPDMIHOSTAUDIO pInterface,529 PPDMAUDIOBACKENDSTREAM pStream, PDMAUDIOSTREAMCMD enmStreamCmd)530 {531 /** @todo r=bird: I'd like to get rid of this pfnStreamControl method,532 * replacing it with individual StreamXxxx methods. That would save us533 * potentally huge switches and more easily see which drivers implement534 * which operations (grep for pfnStreamXxxx). */535 switch (enmStreamCmd)536 {537 case PDMAUDIOSTREAMCMD_ENABLE:538 return drvAudioVrdeHA_StreamEnable(pInterface, pStream);539 case PDMAUDIOSTREAMCMD_DISABLE:540 return drvAudioVrdeHA_StreamDisable(pInterface, pStream);541 case PDMAUDIOSTREAMCMD_PAUSE:542 return drvAudioVrdeHA_StreamPause(pInterface, pStream);543 case PDMAUDIOSTREAMCMD_RESUME:544 return drvAudioVrdeHA_StreamResume(pInterface, pStream);545 case PDMAUDIOSTREAMCMD_DRAIN:546 return drvAudioVrdeHA_StreamDrain(pInterface, pStream);547 548 case PDMAUDIOSTREAMCMD_END:549 case PDMAUDIOSTREAMCMD_32BIT_HACK:550 case PDMAUDIOSTREAMCMD_INVALID:551 /* no default*/552 break;553 }554 return VERR_NOT_SUPPORTED;555 522 } 556 523 … … 776 743 pThis->IHostAudio.pfnStreamDestroy = drvAudioVrdeHA_StreamDestroy; 777 744 pThis->IHostAudio.pfnStreamNotifyDeviceChanged = NULL; 778 pThis->IHostAudio.pfnStreamControl = drvAudioVrdeHA_StreamControl; 745 pThis->IHostAudio.pfnStreamEnable = drvAudioVrdeHA_StreamEnable; 746 pThis->IHostAudio.pfnStreamDisable = drvAudioVrdeHA_StreamDisable; 747 pThis->IHostAudio.pfnStreamPause = drvAudioVrdeHA_StreamPause; 748 pThis->IHostAudio.pfnStreamResume = drvAudioVrdeHA_StreamResume; 749 pThis->IHostAudio.pfnStreamDrain = drvAudioVrdeHA_StreamDrain; 779 750 pThis->IHostAudio.pfnStreamGetState = drvAudioVrdeHA_StreamGetState; 780 751 pThis->IHostAudio.pfnStreamGetPending = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.