VirtualBox

Changeset 89510 in vbox


Ignore:
Timestamp:
Jun 4, 2021 1:20:02 PM (3 years ago)
Author:
vboxsync
Message:

Audio: Split up PDMIHOSTAUDIO::pfnStreamControl into individual methods for each command. bugref:9890

Location:
trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmaudioifs.h

    r89500 r89510  
    13001300
    13011301    /**
    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));
    13131368
    13141369    /**
     
    13291384     * @returns Number of pending bytes.
    13301385     * @param   pInterface          Pointer to this interface.
    1331      * @param   pStream             Pointer to audio stream.
     1386     * @param   pStream             Pointer to the audio stream.
    13321387     *
    13331388     * @todo This is no longer not used by DrvAudio and can probably be removed.
     
    13891444
    13901445/** PDMIHOSTAUDIO interface ID. */
    1391 #define PDMIHOSTAUDIO_IID                           "2d57627f-6f47-4669-a2fa-93a5f1cb6e51"
     1446#define PDMIHOSTAUDIO_IID                           "c0875b91-a4f9-48be-8595-31d27048432d"
    13921447
    13931448
  • trunk/src/VBox/Devices/Audio/DrvAudio.cpp

    r89500 r89510  
    24992499                || enmBackendState == PDMHOSTAUDIOSTREAMSTATE_DRAINING) )
    25002500        {
    2501             /** @todo Backend will change to explicit methods here, so please don't simplify
    2502              *        the switch. */
    25032501            switch (enmStreamCmd)
    25042502            {
    25052503                case PDMAUDIOSTREAMCMD_ENABLE:
    2506                     rc = pThis->pHostDrvAudio->pfnStreamControl(pThis->pHostDrvAudio, pStreamEx->pBackend,
    2507                                                                 PDMAUDIOSTREAMCMD_ENABLE);
     2504                    rc = pThis->pHostDrvAudio->pfnStreamEnable(pThis->pHostDrvAudio, pStreamEx->pBackend);
    25082505                    break;
    25092506
    25102507                case PDMAUDIOSTREAMCMD_DISABLE:
    2511                     rc = pThis->pHostDrvAudio->pfnStreamControl(pThis->pHostDrvAudio, pStreamEx->pBackend,
    2512                                                                 PDMAUDIOSTREAMCMD_DISABLE);
     2508                    rc = pThis->pHostDrvAudio->pfnStreamDisable(pThis->pHostDrvAudio, pStreamEx->pBackend);
    25132509                    break;
    25142510
    25152511                case PDMAUDIOSTREAMCMD_PAUSE:
    2516                     rc = pThis->pHostDrvAudio->pfnStreamControl(pThis->pHostDrvAudio, pStreamEx->pBackend,
    2517                                                                 PDMAUDIOSTREAMCMD_PAUSE);
     2512                    rc = pThis->pHostDrvAudio->pfnStreamPause(pThis->pHostDrvAudio, pStreamEx->pBackend);
    25182513                    break;
    25192514
    25202515                case PDMAUDIOSTREAMCMD_RESUME:
    2521                     rc = pThis->pHostDrvAudio->pfnStreamControl(pThis->pHostDrvAudio, pStreamEx->pBackend,
    2522                                                                 PDMAUDIOSTREAMCMD_RESUME);
     2516                    rc = pThis->pHostDrvAudio->pfnStreamResume(pThis->pHostDrvAudio, pStreamEx->pBackend);
    25232517                    break;
    25242518
    25252519                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;
    25282524                    break;
    25292525
     
    43054301    AssertPtrReturn(pIHostDrvAudio->pfnStreamDestroy, VERR_INVALID_POINTER);
    43064302    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);
    43084308    AssertPtrReturn(pIHostDrvAudio->pfnStreamGetReadable, VERR_INVALID_POINTER);
    43094309    AssertPtrReturn(pIHostDrvAudio->pfnStreamGetWritable, VERR_INVALID_POINTER);
  • trunk/src/VBox/Devices/Audio/DrvHostAudioAlsa.cpp

    r89508 r89510  
    836836
    837837/**
    838  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
     838 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
    839839 */
    840840static DECLCALLBACK(int) drvHstAudAlsaHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    880880
    881881/**
    882  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable}
     882 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable}
    883883 */
    884884static DECLCALLBACK(int) drvHstAudAlsaHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    901901
    902902/**
    903  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause}
     903 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause}
    904904 */
    905905static DECLCALLBACK(int) drvHstAudAlsaHA_StreamPause(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    913913
    914914/**
    915  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume}
     915 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume}
    916916 */
    917917static DECLCALLBACK(int) drvHstAudAlsaHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    923923
    924924/**
    925  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain}
     925 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain}
    926926 */
    927927static DECLCALLBACK(int) drvHstAudAlsaHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    982982
    983983/**
    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 us
    991      *        potentally huge switches and more easily see which drivers implement
    992      *        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 /**
    1017984 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetState}
    1018985 */
     
    15181485    pThis->IHostAudio.pfnStreamDestroy              = drvHstAudAlsaHA_StreamDestroy;
    15191486    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;
    15211492    pThis->IHostAudio.pfnStreamGetPending           = drvHstAudAlsaHA_StreamGetPending;
    15221493    pThis->IHostAudio.pfnStreamGetState             = drvHstAudAlsaHA_StreamGetState;
  • trunk/src/VBox/Devices/Audio/DrvHostAudioCoreAudio.cpp

    r89502 r89510  
    21082108
    21092109/**
    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 us
    2117      *        potentally huge switches and more easily see which drivers implement
    2118      *        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 /**
    21432110 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamGetReadable}
    21442111 */
     
    27822749    pThis->IHostAudio.pfnStreamDestroy              = drvHstAudCaHA_StreamDestroy;
    27832750    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;
    27852756    pThis->IHostAudio.pfnStreamGetReadable          = drvHstAudCaHA_StreamGetReadable;
    27862757    pThis->IHostAudio.pfnStreamGetWritable          = drvHstAudCaHA_StreamGetWritable;
  • trunk/src/VBox/Devices/Audio/DrvHostAudioDSound.cpp

    r89504 r89510  
    19101910
    19111911/**
    1912  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
     1912 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
    19131913 */
    19141914static DECLCALLBACK(int) drvHostDSoundHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    19731973
    19741974/**
    1975  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable}
     1975 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable}
    19761976 */
    19771977static DECLCALLBACK(int) drvHostDSoundHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    20262026
    20272027/**
    2028  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause}
     2028 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause}
    20292029 *
    20302030 * @note    Basically the same as drvHostDSoundHA_StreamDisable, just w/o the
     
    21142114
    21152115/**
    2116  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume}
     2116 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume}
    21172117 */
    21182118static DECLCALLBACK(int) drvHostDSoundHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    21422142
    21432143/**
    2144  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain}
     2144 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain}
    21452145 */
    21462146static DECLCALLBACK(int) drvHostDSoundHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    21912191    LogFlowFunc(("returns %Rrc {%s}\n", rc, drvHostDSoundStreamStatusString(pStreamDS)));
    21922192    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 us
    2204      *        potentally huge switches and more easily see which drivers implement
    2205      *        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;
    22262193}
    22272194
     
    27722739    pThis->IHostAudio.pfnStreamDestroy              = drvHostDSoundHA_StreamDestroy;
    27732740    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;
    27752746    pThis->IHostAudio.pfnStreamGetState             = drvHostDSoundHA_StreamGetState;
    27762747    pThis->IHostAudio.pfnStreamGetPending           = NULL;
  • trunk/src/VBox/Devices/Audio/DrvHostAudioDebug.cpp

    r89504 r89510  
    150150
    151151/**
    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 */
     154static 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 */
     164static 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 */
     174static 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 */
     184static 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 */
     194static DECLCALLBACK(int) drvHstAudDebugHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     195{
     196    RT_NOREF(pInterface, pStream);
     197    return VINF_SUCCESS;
    191198}
    192199
     
    326333    pThis->IHostAudio.pfnStreamDestroy              = drvHstAudDebugHA_StreamDestroy;
    327334    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;
    329340    pThis->IHostAudio.pfnStreamGetState             = drvHstAudDebugHA_StreamGetState;
    330341    pThis->IHostAudio.pfnStreamGetPending           = drvHstAudDebugHA_StreamGetPending;
  • trunk/src/VBox/Devices/Audio/DrvHostAudioNull.cpp

    r89504 r89510  
    107107
    108108/**
    109  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
     109 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
    110110 */
    111111static DECLCALLBACK(int) drvHstAudNullHA_StreamControlStub(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    113113    RT_NOREF(pInterface, pStream);
    114114    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 us
    126      *        potentally huge switches and more easily see which drivers implement
    127      *        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;
    148115}
    149116
     
    247214    /* .pfnStreamDestroy             =*/ drvHstAudNullHA_StreamDestroy,
    248215    /* .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,
    250221    /* .pfnStreamGetState            =*/ drvHstAudNullHA_StreamGetState,
    251222    /* .pfnStreamGetPending          =*/ drvHstAudNullHA_StreamGetPending,
  • trunk/src/VBox/Devices/Audio/DrvHostAudioOss.cpp

    r89504 r89510  
    457457
    458458/**
    459  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
     459 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
    460460 */
    461461static DECLCALLBACK(int) drvHstAudOssHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    488488
    489489/**
    490  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable}
     490 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable}
    491491 */
    492492static DECLCALLBACK(int) drvHstAudOssHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    540540
    541541/**
    542  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause}
     542 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause}
    543543 */
    544544static DECLCALLBACK(int) drvHstAudOssHA_StreamPause(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    549549
    550550/**
    551  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume}
     551 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume}
    552552 */
    553553static DECLCALLBACK(int) drvHstAudOssHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    601601
    602602/**
    603  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable}
     603 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain}
    604604 */
    605605static DECLCALLBACK(int) drvHstAudOssHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    638638
    639639    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 us
    651      *        potentally huge switches and more easily see which drivers implement
    652      *        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-ALSA
    666              *        implementation of OSS it is probably blocking.  Also, it comes with
    667              *        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;
    675640}
    676641
     
    912877    pThis->IHostAudio.pfnStreamDestroy              = drvHstAudOssHA_StreamDestroy;
    913878    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;
    915884    pThis->IHostAudio.pfnStreamGetState             = drvHstAudOssHA_StreamGetState;
    916885    pThis->IHostAudio.pfnStreamGetPending           = NULL;
  • trunk/src/VBox/Devices/Audio/DrvHostAudioPulseAudio.cpp

    r89504 r89510  
    13291329
    13301330/**
    1331  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
     1331 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
    13321332 */
    13331333static DECLCALLBACK(int) drvHstAudPaHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    13581358
    13591359/**
    1360  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable}
     1360 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable}
    13611361 */
    13621362static DECLCALLBACK(int) drvHstAudPaHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    14181418
    14191419/**
    1420  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause}
     1420 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause}
    14211421 */
    14221422static DECLCALLBACK(int) drvHstAudPaHA_StreamPause(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    14281428
    14291429/**
    1430  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume}
     1430 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume}
    14311431 */
    14321432static DECLCALLBACK(int) drvHstAudPaHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    14901490
    14911491/**
    1492  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain}
     1492 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain}
    14931493 */
    14941494static DECLCALLBACK(int) drvHstAudPaHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    15531553    LogFlowFunc(("returns %Rrc\n", rc));
    15541554    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 us
    1566      *        potentally huge switches and more easily see which drivers implement
    1567      *        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;
    15881555}
    15891556
     
    20422009    pThis->IHostAudio.pfnStreamDestroy              = drvHstAudPaHA_StreamDestroy;
    20432010    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;
    20452016    pThis->IHostAudio.pfnStreamGetState             = drvHstAudPaHA_StreamGetState;
    20462017    pThis->IHostAudio.pfnStreamGetPending           = NULL;
  • trunk/src/VBox/Devices/Audio/DrvHostAudioValidationKit.cpp

    r89487 r89510  
    368368
    369369/**
    370  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
    371  */
    372 static DECLCALLBACK(int) drvHostValKitAudioHA_StreamControlStub(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     370 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
     371 */
     372static DECLCALLBACK(int) drvHostValKitAudioHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
    373373{
    374374    RT_NOREF(pInterface, pStream);
     
    378378
    379379/**
    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 */
     382static DECLCALLBACK(int) drvHostValKitAudioHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     383{
     384    RT_NOREF(pInterface, pStream);
    389385    return VINF_SUCCESS;
    390386}
     
    392388
    393389/**
    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 */
     392static 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 */
     402static 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 */
     412static DECLCALLBACK(int) drvHostValKitAudioHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     413{
     414    RT_NOREF(pInterface, pStream);
     415    return VINF_SUCCESS;
    423416}
    424417
     
    697690    pThis->IHostAudio.pfnStreamDestroy              = drvHostValKitAudioHA_StreamDestroy;
    698691    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;
    700697    pThis->IHostAudio.pfnStreamGetReadable          = drvHostValKitAudioHA_StreamGetReadable;
    701698    pThis->IHostAudio.pfnStreamGetWritable          = drvHostValKitAudioHA_StreamGetWritable;
  • trunk/src/VBox/Devices/Audio/DrvHostAudioWasApi.cpp

    r89504 r89510  
    21212121
    21222122/**
    2123  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
     2123 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
    21242124 */
    21252125static DECLCALLBACK(int) drvHostAudioWasHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    21712171
    21722172/**
    2173  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable}
     2173 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable}
    21742174 */
    21752175static DECLCALLBACK(int) drvHostAudioWasHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    22102210
    22112211/**
    2212  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause}
     2212 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause}
    22132213 *
    22142214 * @note    Basically the same as drvHostAudioWasHA_StreamDisable, just w/o the
     
    22582258
    22592259/**
    2260  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume}
     2260 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume}
    22612261 */
    22622262static DECLCALLBACK(int) drvHostAudioWasHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    22842284
    22852285/**
    2286  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain}
     2286 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain}
    22872287 */
    22882288static DECLCALLBACK(int) drvHostAudioWasHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    23382338    LogFlowFunc(("returns %Rrc {%s}\n", rc, drvHostWasStreamStatusString(pStreamWas)));
    23392339    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 us
    2351      *        potentally huge switches and more easily see which drivers implement
    2352      *        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;
    23732340}
    23742341
     
    30292996    pThis->IHostAudio.pfnStreamDestroy              = drvHostAudioWasHA_StreamDestroy;
    30302997    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;
    30323003    pThis->IHostAudio.pfnStreamGetState             = drvHostAudioWasHA_StreamGetState;
    30333004    pThis->IHostAudio.pfnStreamGetPending           = drvHostAudioWasHA_StreamGetPending;
  • trunk/src/VBox/Main/src-client/DrvAudioRec.cpp

    r89504 r89510  
    543543
    544544/**
    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 */
     547static 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 */
     557static 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 */
     567static 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 */
     577static 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 */
     587static DECLCALLBACK(int) drvAudioVideoRecHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     588{
     589    RT_NOREF(pInterface, pStream);
    589590    return VINF_SUCCESS;
    590591}
     
    11141115    pThis->IHostAudio.pfnStreamDestroy              = drvAudioVideoRecHA_StreamDestroy;
    11151116    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;
    11171122    pThis->IHostAudio.pfnStreamGetState             = drvAudioVideoRecHA_StreamGetState;
    11181123    pThis->IHostAudio.pfnStreamGetPending           = NULL;
  • trunk/src/VBox/Main/src-client/DrvAudioVRDE.cpp

    r89504 r89510  
    417417
    418418/**
    419  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
     419 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamEnable}
    420420 */
    421421static DECLCALLBACK(int) drvAudioVrdeHA_StreamEnable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    451451
    452452/**
    453  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable}
     453 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDisable}
    454454 */
    455455static DECLCALLBACK(int) drvAudioVrdeHA_StreamDisable(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    477477
    478478/**
    479  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause}
     479 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamPause}
    480480 */
    481481static DECLCALLBACK(int) drvAudioVrdeHA_StreamPause(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    495495
    496496/**
    497  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume}
     497 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamResume}
    498498 */
    499499static DECLCALLBACK(int) drvAudioVrdeHA_StreamResume(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    513513
    514514/**
    515  * @ interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain}
     515 * @interface_method_impl{PDMIHOSTAUDIO,pfnStreamDrain}
    516516 */
    517517static DECLCALLBACK(int) drvAudioVrdeHA_StreamDrain(PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream)
     
    520520    LogFlowFunc(("returns VINF_SUCCESS\n"));
    521521    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 us
    533      *        potentally huge switches and more easily see which drivers implement
    534      *        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;
    555522}
    556523
     
    776743    pThis->IHostAudio.pfnStreamDestroy              = drvAudioVrdeHA_StreamDestroy;
    777744    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;
    779750    pThis->IHostAudio.pfnStreamGetState             = drvAudioVrdeHA_StreamGetState;
    780751    pThis->IHostAudio.pfnStreamGetPending           = NULL;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette