VirtualBox

Changeset 58600 in vbox for trunk/include


Ignore:
Timestamp:
Nov 6, 2015 12:26:32 PM (9 years ago)
Author:
vboxsync
Message:

Audio: Introduced reference counting for guest audio streams; this should prevent that the audio connector interface is destroying streams which still are being used by other parties, e.g. the audio mixer (bugref:8054).

File:
1 edited

Legend:

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

    r58344 r58600  
    377377    /** Name of this stream. */
    378378    char                  *pszName;
     379    /** Number of references to this stream. Only can be
     380     *  destroyed if the reference count is reaching 0. */
     381    uint8_t                cRefs;
    379382} PDMAUDIOGSTSTRMSTATE, *PPDMAUDIOGSTSTRMSTATE;
    380383
     
    451454
    452455    /**
     456     * Checks whether a specific guest input stream is active or not.
     457     *
     458     * @returns Whether the specified stream is active or not.
     459     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
     460     * @param   pGstStrmIn      Pointer to guest input stream.
     461     */
     462    DECLR3CALLBACKMEMBER(bool, pfnIsActiveIn, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMIN pGstStrmIn));
     463
     464    /**
     465     * Checks whether a specific guest output stream is active or not.
     466     *
     467     * @returns Whether the specified stream is active or not.
     468     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
     469     * @param   pGstStrmOut     Pointer to guest output stream.
     470     */
     471    DECLR3CALLBACKMEMBER(bool, pfnIsActiveOut, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut));
     472
     473    /**
    453474     * Checks whether the specified guest input stream is in a working state.
    454475     *
     
    497518
    498519    /**
    499      * Closes a specific guest input stream.
    500      *
    501      * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    502      * @param   pGstStrmIn      Pointer to guest input stream.
    503      */
    504     DECLR3CALLBACKMEMBER(void, pfnCloseIn, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMIN pGstStrmIn));
    505 
    506     /**
    507      * Closes a specific guest output stream.
    508      *
    509      * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    510      * @param   pGstStrmOut     Pointer to guest output stream.
    511      */
    512     DECLR3CALLBACKMEMBER(void, pfnCloseOut, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut));
    513 
    514     /**
    515      * Opens an input audio channel.
     520     * Creates a guest input stream.
    516521     *
    517522     * @returns VBox status code.
     
    522527     * @param   ppGstStrmIn          Pointer where to return the guest guest input stream on success.
    523528     */
    524     DECLR3CALLBACKMEMBER(int, pfnOpenIn, (PPDMIAUDIOCONNECTOR pInterface, const char *pszName,
    525                                           PDMAUDIORECSOURCE enmRecSource, PPDMAUDIOSTREAMCFG pCfg,
    526                                           PPDMAUDIOGSTSTRMIN *ppGstStrmIn));
    527 
    528     /**
    529      * Opens an output audio channel.
     529    DECLR3CALLBACKMEMBER(int, pfnCreateIn, (PPDMIAUDIOCONNECTOR pInterface, const char *pszName,
     530                                            PDMAUDIORECSOURCE enmRecSource, PPDMAUDIOSTREAMCFG pCfg,
     531                                            PPDMAUDIOGSTSTRMIN *ppGstStrmIn));
     532
     533    /**
     534     * Creates a guest output stream.
    530535     *
    531536     * @returns VBox status code.
     
    535540     * @param   ppGstStrmOut         Pointer where to return the guest guest input stream on success.
    536541     */
    537     DECLR3CALLBACKMEMBER(int, pfnOpenOut, (PPDMIAUDIOCONNECTOR pInterface, const char *pszName,
    538                                            PPDMAUDIOSTREAMCFG pCfg, PPDMAUDIOGSTSTRMOUT *ppGstStrmOut));
     542    DECLR3CALLBACKMEMBER(int, pfnCreateOut, (PPDMIAUDIOCONNECTOR pInterface, const char *pszName,
     543                                             PPDMAUDIOSTREAMCFG pCfg, PPDMAUDIOGSTSTRMOUT *ppGstStrmOut));
     544
     545    /**
     546     * Destroys a guest input stream.
     547     *
     548     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
     549     * @param   pGstStrmIn      Pointer to guest input stream.
     550     */
     551    DECLR3CALLBACKMEMBER(void, pfnDestroyIn, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMIN pGstStrmIn));
     552
     553    /**
     554     * Destroys a guest output stream.
     555     *
     556     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
     557     * @param   pGstStrmOut     Pointer to guest output stream.
     558     */
     559    DECLR3CALLBACKMEMBER(void, pfnDestroyOut, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut));
    539560
    540561    /**
     
    547568    DECLR3CALLBACKMEMBER(int, pfnPlayOut, (PPDMIAUDIOCONNECTOR pInterface, uint32_t *pcSamplesPlayed));
    548569
    549     /**
    550      * Checks whether a specific guest input stream is active or not.
    551      *
    552      * @returns Whether the specified stream is active or not.
    553      * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    554      * @param   pGstStrmIn      Pointer to guest input stream.
    555      */
    556     DECLR3CALLBACKMEMBER(bool, pfnIsActiveIn, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMIN pGstStrmIn));
    557 
    558     /**
    559      * Checks whether a specific guest output stream is active or not.
    560      *
    561      * @returns Whether the specified stream is active or not.
    562      * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    563      * @param   pGstStrmOut     Pointer to guest output stream.
    564      */
    565     DECLR3CALLBACKMEMBER(bool, pfnIsActiveOut, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut));
    566 
    567570} PDMIAUDIOCONNECTOR;
    568571
    569572/** PDMIAUDIOCONNECTOR interface ID. */
    570 #define PDMIAUDIOCONNECTOR_IID                  "a41ca770-ed07-4f57-a0a6-41377d9d484f"
     573#define PDMIAUDIOCONNECTOR_IID                  "7bbb9565-8dd2-4fab-81d6-4d78985e5daa"
    571574
    572575
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