VirtualBox

Changeset 54230 in vbox for trunk/include/VBox/vmm


Ignore:
Timestamp:
Feb 17, 2015 1:13:02 PM (10 years ago)
Author:
vboxsync
Message:

PDM/Audio: Update.

File:
1 edited

Legend:

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

    r53831 r54230  
    44
    55/*
    6  * Copyright (C) 2006-2014 Oracle Corporation
     6 * Copyright (C) 2006-2015 Oracle Corporation
    77 *
    88 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    6464
    6565/**
    66  * Function pointer for device emulation callback.
    67  */
    68 typedef void (*PDMAUDIOCALLBACK_FN) (void *pvContext, uint32_t cbData);
    69 
    70 /**
    71  * Structure holding all necessary callback data to communicate
    72  * with the sound device emulation, e.g. for reading or writing
    73  * audio data.
    74  */
    75 typedef struct PDMAUDIOCALLBACK
    76 {
    77     /** Callback function to use in the device emulation. */
    78     PDMAUDIOCALLBACK_FN fn;
    79     /** Opaque pointer to context data given on callback
    80      *  creation. Set by the device emulation. */
    81     void *pvContext;
    82 } PDMAUDIOCALLBACK, *PPDMAUDIOCALLBACK;
    83 
    84 /**
    8566 * Audio configuration of a certain backend.
    8667 */
     
    142123#endif
    143124
    144 typedef enum
     125typedef enum PDMAUDIODIR
     126{
     127    PDMAUDIODIR_UNKNOWN = 0,
     128    PDMAUDIODIR_IN      = 1,
     129    PDMAUDIODIR_OUT     = 2,
     130    PDMAUDIODIR_BOTH    = 3
     131} PDMAUDIODIR;
     132
     133typedef enum PDMAUDIOMIXERCTL
    145134{
    146135    PDMAUDIOMIXERCTL_UNKNOWN = 0,
     
    152141} PDMAUDIOMIXERCTL;
    153142
    154 typedef enum
     143typedef enum PDMAUDIORECSOURCE
    155144{
    156145    PDMAUDIORECSOURCE_UNKNOWN = 0,
     
    372361    /** Pointer to associated host input stream. */
    373362    PPDMAUDIOHSTSTRMIN     pHstStrmIn;
    374     /**
    375      * Callback set by the device emulation on creation.
    376      * This function is used to mix the guest input samples into the target
    377      * host input recording buffer. */
    378     PDMAUDIOCALLBACK       Callback;
    379363} PDMAUDIOGSTSTRMIN, *PPDMAUDIOGSTSTRMIN;
    380364
     
    397381    /** Pointer to the associated host output stream. */
    398382    PPDMAUDIOHSTSTRMOUT    pHstStrmOut;
    399     /**
    400      * Callback set by the device emulation on creation.
    401      * This function is used to tell the device emulation that we're ready to
    402      * process new samples.
    403      */
    404     PDMAUDIOCALLBACK       Callback;
    405383} PDMAUDIOGSTSTRMOUT, *PPDMAUDIOGSTSTRMOUT;
    406384
     
    414392typedef struct PDMIAUDIOCONNECTOR
    415393{
    416     DECLR3CALLBACKMEMBER(int, pfnQueryData, (PPDMIAUDIOCONNECTOR pInterface, uint32_t *pcbAvailIn, uint32_t *pcbFreeOut, uint32_t *pcSamplesLive));
     394    DECLR3CALLBACKMEMBER(int, pfnQueryStatus, (PPDMIAUDIOCONNECTOR pInterface, uint32_t *pcbAvailIn, uint32_t *pcbFreeOut, uint32_t *pcSamplesLive));
    417395
    418396    /**
     
    476454     * @param   uVolRight       Right audio stream volume.
    477455     */
    478     DECLR3CALLBACKMEMBER(int, pfnIsSetOutVolume, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut,
    479                                                   bool fMute, uint8_t uVolLeft, uint8_t uVolRight));
     456    DECLR3CALLBACKMEMBER(int, pfnSetVolumeOut, (PPDMIAUDIOCONNECTOR pInterface, PPDMAUDIOGSTSTRMOUT pGstStrmOut,
     457                                                bool fMute, uint8_t uVolLeft, uint8_t uVolRight));
    480458
    481459    /**
     
    534512     * @param   pszName              Name of the audio channel.
    535513     * @param   enmRecSource         Specifies the type of recording source to be opened.
    536      * @param   fnCallback           Callback function to be assigned to this input stream.
    537      * @param   pvCallback           Pointer to parameters assigned to the callback function.
    538514     * @param   pCfg                 Pointer to PDMAUDIOSTREAMCFG to use.
    539515     * @param   ppGstStrmIn          Pointer where to return the guest guest input stream on success.
    540516     */
    541517    DECLR3CALLBACKMEMBER(int, pfnOpenIn, (PPDMIAUDIOCONNECTOR pInterface, const char *pszName,
    542                                           PDMAUDIORECSOURCE enmRecSource,
    543                                           PDMAUDIOCALLBACK_FN fnCallback, void *pvCallback,
    544                                           PPDMAUDIOSTREAMCFG pCfg,
     518                                          PDMAUDIORECSOURCE enmRecSource, PPDMAUDIOSTREAMCFG pCfg,
    545519                                          PPDMAUDIOGSTSTRMIN *ppGstStrmIn));
    546520
     
    551525     * @param   pInterface           Pointer to the interface structure containing the called function pointer.
    552526     * @param   pszName              Name of the audio channel.
    553      * @param   fnCallback           Callback function to be assigned to this input stream.
    554      * @param   pvCallback           Pointer to parameters assigned to the callback function.
    555527     * @param   pCfg                 Pointer to PDMAUDIOSTREAMCFG to use.
    556528     * @param   ppGstStrmOut         Pointer where to return the guest guest input stream on success.
    557529     */
    558530    DECLR3CALLBACKMEMBER(int, pfnOpenOut, (PPDMIAUDIOCONNECTOR pInterface, const char *pszName,
    559                                            PDMAUDIOCALLBACK_FN fnCallback, void *pvCallback,
    560                                            PPDMAUDIOSTREAMCFG pCfg,
    561                                            PPDMAUDIOGSTSTRMOUT *ppGstStrmOut));
    562 
    563     DECLR3CALLBACKMEMBER(int, pfnPlayOut, (PPDMIAUDIOCONNECTOR pInterface));
     531                                           PPDMAUDIOSTREAMCFG pCfg, PPDMAUDIOGSTSTRMOUT *ppGstStrmOut));
     532
     533    DECLR3CALLBACKMEMBER(int, pfnPlayOut, (PPDMIAUDIOCONNECTOR pInterface, uint32_t *pcSamplesPlayed));
    564534
    565535    /**
     
    585555/** PDMIAUDIOCONNECTOR interface ID. */
    586556#define PDMIAUDIOCONNECTOR_IID                  "a41ca770-ed07-4f57-a0a6-41377d9d484f"
     557
     558/** Defines all needed interface callbacks for an audio backend. */
     559#define PDMAUDIO_IHOSTAUDIOR3_CALLBACKS(_aDrvName) \
     560    pThis->IHostAudioR3.pfnCaptureIn  = _aDrvName##CaptureIn;  \
     561    pThis->IHostAudioR3.pfnControlIn  = _aDrvName##ControlIn;  \
     562    pThis->IHostAudioR3.pfnControlOut = _aDrvName##ControlOut; \
     563    pThis->IHostAudioR3.pfnFiniIn     = _aDrvName##FiniIn;     \
     564    pThis->IHostAudioR3.pfnFiniOut    = _aDrvName##FiniOut;    \
     565    pThis->IHostAudioR3.pfnGetConf    = _aDrvName##GetConf;    \
     566    pThis->IHostAudioR3.pfnInit       = _aDrvName##Init;       \
     567    pThis->IHostAudioR3.pfnInitIn     = _aDrvName##InitIn;     \
     568    pThis->IHostAudioR3.pfnInitOut    = _aDrvName##InitOut;    \
     569    pThis->IHostAudioR3.pfnIsEnabled  = _aDrvName##IsEnabled;  \
     570    pThis->IHostAudioR3.pfnPlayOut    = _aDrvName##PlayOut;
    587571
    588572/** Pointer to a host audio interface. */
     
    661645    DECLR3CALLBACKMEMBER(int, pfnFiniOut, (PPDMIHOSTAUDIO pInterface, PPDMAUDIOHSTSTRMOUT pHstStrmOut));
    662646
    663     /**
    664      * Plays an audio stream.
     647    DECLR3CALLBACKMEMBER(bool, pfnIsEnabled, (PPDMIHOSTAUDIO pInterface, PDMAUDIODIR enmDir));
     648
     649    /**
     650     * Plays a host audio stream.
    665651     *
    666652     * @returns VBox status code.
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