VirtualBox

Changeset 89489 in vbox for trunk/include


Ignore:
Timestamp:
Jun 3, 2021 11:00:02 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144846
Message:

Audio: Simplified PDMIAUDIOCONNECTOR::pfnStreamCreate by moving the acquired configuration to the resulting stream (PDMAUDIOSTREAM::Cfg). bugref:9890

File:
1 edited

Legend:

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

    r89487 r89489  
    641641typedef struct PDMAUDIOSTREAMCFG
    642642{
     643    /** The stream's PCM properties. */
     644    PDMAUDIOPCMPROPS        Props;
    643645    /** Direction of the stream. */
    644646    PDMAUDIODIR             enmDir;
    645647    /** Destination / source path. */
    646648    PDMAUDIOPATH            enmPath;
    647     /** The stream's PCM properties. */
    648     PDMAUDIOPCMPROPS        Props;
    649649    /** Device emulation-specific data needed for the audio connector. */
    650650    struct
     
    874874     *          - Before DRVAUDIO::CritSectHotPlug. */
    875875    RTCRITSECT              CritSect;
     876    /** Stream configuration. */
     877    PDMAUDIOSTREAMCFG       Cfg;
    876878    /** Magic value (PDMAUDIOSTREAM_MAGIC). */
    877879    uint32_t                uMagic;
    878     /** Audio direction of this stream. */
    879     PDMAUDIODIR             enmDir;
    880880    /** Size (in bytes) of the backend-specific stream data. */
    881881    uint32_t                cbBackend;
     
    883883     *  See PDMAUDIOSTREAM_WARN_FLAGS_XXX. */
    884884    uint32_t                fWarningsShown;
    885     /** The stream properties. */
    886     PDMAUDIOPCMPROPS        Props;
    887 
    888     /** Name of this stream. */
    889     char                    szName[64];
    890885} PDMAUDIOSTREAM;
    891886/** Pointer to an audio stream. */
     
    960955     * configuring host audio.
    961956     *
    962      * @param   pInterface      Pointer to this interface.
    963      * @param   pCfg            The typical configuration.  Can be modified by the
    964      *                          drivers in unspecified ways.
     957     * @param   pInterface  Pointer to this interface.
     958     * @param   pCfg        The typical configuration.  Can be modified by the
     959     *                      drivers in unspecified ways.
    965960     */
    966961    DECLR3CALLBACKMEMBER(void, pfnStreamConfigHint, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOSTREAMCFG pCfg));
     
    970965     *
    971966     * @returns VBox status code.
    972      * @param   pInterface      Pointer to the interface structure containing the called function pointer.
    973      * @param   fFlags          PDMAUDIOSTREAM_CREATE_F_XXX.
    974      * @param   pCfgHost        Stream configuration for host side.
    975      * @param   pCfgGuest       Stream configuration for guest side.
    976      * @param   ppStream        Pointer where to return the created audio stream on success.
    977      * @todo r=bird: It is not documented how pCfgHost and pCfgGuest can be
    978      *       modified the DrvAudio...
    979      */
    980     DECLR3CALLBACKMEMBER(int, pfnStreamCreate, (PPDMIAUDIOCONNECTOR pInterface, uint32_t fFlags, PPDMAUDIOSTREAMCFG pCfgHost,
    981                                                 PPDMAUDIOSTREAMCFG pCfgGuest, PPDMAUDIOSTREAM *ppStream));
     967     * @param   pInterface  Pointer to this interface.
     968     * @param   fFlags      PDMAUDIOSTREAM_CREATE_F_XXX.
     969     * @param   pCfgReq     The requested stream configuration.  The actual stream
     970     *                      configuration can be found in pStream->Cfg on success.
     971     * @param   ppStream    Pointer where to return the created audio stream on
     972     *                      success.
     973     */
     974    DECLR3CALLBACKMEMBER(int, pfnStreamCreate, (PPDMIAUDIOCONNECTOR pInterface, uint32_t fFlags, PCPDMAUDIOSTREAMCFG pCfgReq,
     975                                                PPDMAUDIOSTREAM *ppStream));
    982976
    983977
     
    10971091
    10981092/** PDMIAUDIOCONNECTOR interface ID. */
    1099 #define PDMIAUDIOCONNECTOR_IID                  "ae82616d-0da7-489a-aa4c-3e74d112ca9c"
     1093#define PDMIAUDIOCONNECTOR_IID                  "2900fe2a-6aeb-4953-ac12-f8965612f446"
    11001094
    11011095
     
    13151309                                                 PDMAUDIOSTREAMCMD enmStreamCmd));
    13161310
    1317     /**
    1318      * Returns the amount which is readable from the audio (input) stream.
    1319      *
    1320      * @returns For non-raw layout streams: Number of readable bytes.
    1321      *          for raw layout streams    : Number of readable audio frames.
    1322      * @param   pInterface          Pointer to the interface structure containing the called function pointer.
    1323      * @param   pStream             Pointer to audio stream.
    1324      */
    1325     DECLR3CALLBACKMEMBER(uint32_t, pfnStreamGetReadable, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream));
    1326 
    1327     /**
    1328      * Returns the amount which is writable to the audio (output) stream.
    1329      *
    1330      * @returns Number of writable bytes.
    1331      * @param   pInterface          Pointer to the interface structure containing the called function pointer.
    1332      * @param   pStream             Pointer to audio stream.
    1333      */
    1334     DECLR3CALLBACKMEMBER(uint32_t, pfnStreamGetWritable, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream));
    1335 
    1336     /**
    1337      * Returns the number of buffered bytes that hasn't been played yet (optional).
    1338      *
    1339      * Is not valid on an input stream, implementions shall assert and return zero.
    1340      *
    1341      * @returns Number of pending bytes.
    1342      * @param   pInterface          Pointer to this interface.
    1343      * @param   pStream             Pointer to audio stream.
    1344      *
    1345      * @todo This is no longer not used by DrvAudio and can probably be removed.
    1346      */
    1347     DECLR3CALLBACKMEMBER(uint32_t, pfnStreamGetPending, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream));
    13481311
    13491312    /**
     
    13561319     */
    13571320    DECLR3CALLBACKMEMBER(PDMHOSTAUDIOSTREAMSTATE, pfnStreamGetState, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream));
     1321
     1322    /**
     1323     * Returns the number of buffered bytes that hasn't been played yet (optional).
     1324     *
     1325     * Is not valid on an input stream, implementions shall assert and return zero.
     1326     *
     1327     * @returns Number of pending bytes.
     1328     * @param   pInterface          Pointer to this interface.
     1329     * @param   pStream             Pointer to audio stream.
     1330     *
     1331     * @todo This is no longer not used by DrvAudio and can probably be removed.
     1332     */
     1333    DECLR3CALLBACKMEMBER(uint32_t, pfnStreamGetPending, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream));
     1334
     1335    /**
     1336     * Returns the amount which is writable to the audio (output) stream.
     1337     *
     1338     * @returns Number of writable bytes.
     1339     * @param   pInterface          Pointer to the interface structure containing the called function pointer.
     1340     * @param   pStream             Pointer to audio stream.
     1341     */
     1342    DECLR3CALLBACKMEMBER(uint32_t, pfnStreamGetWritable, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream));
    13581343
    13591344    /**
     
    13781363
    13791364    /**
     1365     * Returns the amount which is readable from the audio (input) stream.
     1366     *
     1367     * @returns For non-raw layout streams: Number of readable bytes.
     1368     *          for raw layout streams    : Number of readable audio frames.
     1369     * @param   pInterface          Pointer to the interface structure containing the called function pointer.
     1370     * @param   pStream             Pointer to audio stream.
     1371     */
     1372    DECLR3CALLBACKMEMBER(uint32_t, pfnStreamGetReadable, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOBACKENDSTREAM pStream));
     1373
     1374    /**
    13801375     * Captures (reads from) an audio (input) stream.
    13811376     *
     
    13921387
    13931388/** PDMIHOSTAUDIO interface ID. */
    1394 #define PDMIHOSTAUDIO_IID                           "0625ae75-491b-428b-836e-4f8a9869788f"
     1389#define PDMIHOSTAUDIO_IID                           "147dedd7-cac1-469b-b545-335dbe90abf6"
    13951390
    13961391
     
    14771472
    14781473/** PDMIHOSTAUDIOPORT interface ID. */
    1479 #define PDMIHOSTAUDIOPORT_IID                    "d42144e9-867e-4d1c-86d4-acb92b47f013"
     1474#define PDMIHOSTAUDIOPORT_IID                    "92ea5169-8271-402d-99a7-9de26a52acaf"
    14801475
    14811476/** @} */
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