VirtualBox

Changeset 68076 in vbox


Ignore:
Timestamp:
Jul 21, 2017 10:02:51 AM (7 years ago)
Author:
vboxsync
Message:

Audio: Implemented optional callbacks StreamPlayBegin / StreamPlayEnd + StreamCaptureBegin / StreamCaptureEnd. Not (yet) used but handy to have.

Location:
trunk
Files:
2 edited

Legend:

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

    r67695 r68076  
    12131213
    12141214    /**
     1215     * Signals the backend that the host wants to begin playing for this iteration. Optional.
     1216     *
     1217     * @param   pInterface          Pointer to the interface structure containing the called function pointer.
     1218     * @param   pStream             Pointer to audio stream.
     1219     */
     1220    DECLR3CALLBACKMEMBER(void, pfnStreamPlayBegin, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream));
     1221
     1222    /**
    12151223     * Plays (writes to) an audio (output) stream.
    12161224     *
     
    12251233
    12261234    /**
     1235     * Signals the backend that the host finished playing for this iteration. Optional.
     1236     *
     1237     * @param   pInterface          Pointer to the interface structure containing the called function pointer.
     1238     * @param   pStream             Pointer to audio stream.
     1239     */
     1240    DECLR3CALLBACKMEMBER(void, pfnStreamPlayEnd, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream));
     1241
     1242    /**
     1243     * Signals the backend that the host wants to begin capturing for this iteration. Optional.
     1244     *
     1245     * @param   pInterface          Pointer to the interface structure containing the called function pointer.
     1246     * @param   pStream             Pointer to audio stream.
     1247     */
     1248    DECLR3CALLBACKMEMBER(void, pfnStreamCaptureBegin, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream));
     1249
     1250    /**
    12271251     * Captures (reads from) an audio (input) stream.
    12281252     *
     
    12361260    DECLR3CALLBACKMEMBER(int, pfnStreamCapture, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream, void *pvBuf, uint32_t cbBuf, uint32_t *pcbRead));
    12371261
     1262    /**
     1263     * Signals the backend that the host finished capturing for this iteration. Optional.
     1264     *
     1265     * @param   pInterface          Pointer to the interface structure containing the called function pointer.
     1266     * @param   pStream             Pointer to audio stream.
     1267     */
     1268    DECLR3CALLBACKMEMBER(void, pfnStreamCaptureEnd, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream));
     1269
    12381270} PDMIHOSTAUDIO;
    12391271
    12401272/** PDMIHOSTAUDIO interface ID. */
    1241 #define PDMIHOSTAUDIO_IID                           "12DF859E-416A-4332-9980-A049AC70D187"
     1273#define PDMIHOSTAUDIO_IID                           "378A5C7F-A45A-4B8B-C1DA-CB49E84894AA"
    12421274
    12431275/** @} */
  • trunk/src/VBox/Devices/Audio/DrvAudio.cpp

    r68067 r68076  
    15031503        uint32_t csToPlay = AudioMixBufLive(&pHstStream->MixBuf);
    15041504
     1505        if (pThis->pHostDrvAudio->pfnStreamPlayBegin)
     1506            pThis->pHostDrvAudio->pfnStreamPlayBegin(pThis->pHostDrvAudio, pHstStream->pvBackend);
     1507
    15051508        if (RT_LIKELY(pHstStream->Cfg.enmLayout == PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED))
    15061509        {
     
    15131516        else
    15141517            AssertFailedStmt(rc = VERR_NOT_IMPLEMENTED);
     1518
     1519        if (pThis->pHostDrvAudio->pfnStreamPlayEnd)
     1520            pThis->pHostDrvAudio->pfnStreamPlayEnd(pThis->pHostDrvAudio, pHstStream->pvBackend);
    15151521
    15161522        uint32_t csLive = 0;
     
    17891795         */
    17901796
     1797        if (pThis->pHostDrvAudio->pfnStreamCaptureBegin)
     1798            pThis->pHostDrvAudio->pfnStreamCaptureBegin(pThis->pHostDrvAudio, pHstStream->pvBackend);
     1799
    17911800        if (RT_LIKELY(pHstStream->Cfg.enmLayout == PDMAUDIOSTREAMLAYOUT_NON_INTERLEAVED))
    17921801        {
     
    17991808        else
    18001809            AssertFailedStmt(rc = VERR_NOT_IMPLEMENTED);
     1810
     1811        if (pThis->pHostDrvAudio->pfnStreamCaptureEnd)
     1812            pThis->pHostDrvAudio->pfnStreamCaptureEnd(pThis->pHostDrvAudio, pHstStream->pvBackend);
    18011813
    18021814#ifdef LOG_ENABLED
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