VirtualBox

忽略:
時間撮記:
2016-4-6 上午11:54:39 (9 年 以前)
作者:
vboxsync
svn:sync-xref-src-repo-rev:
106428
訊息:

Audio: Added HDA support for newer Linux guests; more work on surround support (disabled by default).

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Devices/Audio/DevIchHdaCodec.h

    r59439 r60353  
    1616 */
    1717
    18 #ifndef DEV_CODEC_H
    19 #define DEV_CODEC_H
     18#ifndef DEV_HDA_CODEC_H
     19#define DEV_HDA_CODEC_H
    2020
    2121/** The ICH HDA (Intel) controller. */
     
    3939#define CODEC_RESPONSE_UNSOLICITED RT_BIT_64(34)
    4040
    41 
    42 #ifndef VBOX_WITH_HDA_CODEC_EMU
    4341typedef struct CODECVERB
    4442{
     
    4846    PFNHDACODECVERBPROCESSOR pfn;
    4947} CODECVERB;
    50 #endif
    5148
    52 #ifndef VBOX_WITH_HDA_CODEC_EMU
    53 # define TYPE union
    54 #else
    55 # define TYPE struct
    56 typedef struct CODECEMU CODECEMU;
    57 typedef CODECEMU *PCODECEMU;
    58 #endif
    59 TYPE CODECNODE;
    60 typedef TYPE CODECNODE CODECNODE;
    61 typedef TYPE CODECNODE *PCODECNODE;
     49union CODECNODE;
     50typedef union CODECNODE CODECNODE, *PCODECNODE;
    6251
    63 typedef enum
    64 {
    65     PI_INDEX = 0,    /**< PCM in */
    66     PO_INDEX,        /**< PCM out */
    67     MC_INDEX,        /**< Mic in */
    68     LAST_INDEX
    69 } ENMSOUNDSOURCE;
    70 
     52/**
     53 * Structure for keeping a HDA codec state.
     54 */
    7155typedef struct HDACODEC
    7256{
     
    7963     * A driver only can be assigned to one codec at a time. */
    8064    RTLISTANCHOR            lstDrv;
    81     /** The codec's current audio stream configuration. */
    82     PDMAUDIOSTREAMCFG       strmCfg;
    8365
    84 #ifndef VBOX_WITH_HDA_CODEC_EMU
    8566    CODECVERB const        *paVerbs;
    8667    int                     cVerbs;
    87 #else
    88     PCODECEMU               pCodecBackend;
    89 #endif
     68
    9069    PCODECNODE              paNodes;
    9170    /** Pointer to HDA state (controller) this
     
    9372    PHDASTATE               pHDAState;
    9473    bool                    fInReset;
    95 #ifndef VBOX_WITH_HDA_CODEC_EMU
     74
    9675    const uint8_t           cTotalNodes;
    9776    const uint8_t          *au8Ports;
     
    11089    const uint8_t           u8AdcVolsLineIn;
    11190    const uint8_t           u8DacLineOut;
    112 #endif
     91
    11392    /** Callbacks to the HDA controller, mostly used for multiplexing to the various host backends. */
    114     DECLR3CALLBACKMEMBER(void, pfnCloseIn, (PHDASTATE pThis, PDMAUDIORECSOURCE enmRecSource));
    115     DECLR3CALLBACKMEMBER(void, pfnCloseOut, (PHDASTATE pThis));
    116     DECLR3CALLBACKMEMBER(int, pfnOpenIn, (PHDASTATE pThis, const char *pszName, PDMAUDIORECSOURCE enmRecSource, PPDMAUDIOSTREAMCFG pCfg));
    117     DECLR3CALLBACKMEMBER(int, pfnOpenOut, (PHDASTATE pThis, const char *pszName, PPDMAUDIOSTREAMCFG pCfg));
    118     DECLR3CALLBACKMEMBER(int, pfnSetVolume, (PHDASTATE pThis, ENMSOUNDSOURCE enmSource, bool fMute, uint8_t uVolLeft, uint8_t uVolRight));
     93    DECLR3CALLBACKMEMBER(int, pfnMixerAddStream, (PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOSTREAMCFG pCfg));
     94    DECLR3CALLBACKMEMBER(int, pfnMixerRemoveStream, (PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl));
     95    DECLR3CALLBACKMEMBER(int, pfnMixerSetVolume, (PHDASTATE pThis, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOVOLUME pVol));
    11996    /** Callbacks by codec implementation. */
    12097    DECLR3CALLBACKMEMBER(int, pfnLookup, (PHDACODEC pThis, uint32_t verb, PPFNHDACODECVERBPROCESSOR));
     
    130107int hdaCodecSaveState(PHDACODEC pThis, PSSMHANDLE pSSM);
    131108int hdaCodecLoadState(PHDACODEC pThis, PSSMHANDLE pSSM, uint32_t uVersion);
    132 int hdaCodecOpenStream(PHDACODEC pThis, ENMSOUNDSOURCE enmSoundSource, PPDMAUDIOSTREAMCFG pCfg);
     109int hdaCodecAddStream(PHDACODEC pThis, PDMAUDIOMIXERCTL enmMixerCtl, PPDMAUDIOSTREAMCFG pCfg);
     110int hdaCodecRemoveStream(PHDACODEC pThis, PDMAUDIOMIXERCTL enmMixerCtl);
    133111
    134112#define HDA_SSM_VERSION   6
     
    143121#define HDA_SSM_VERSION_1 1
    144122
    145 # ifdef VBOX_WITH_HDA_CODEC_EMU
    146 /* */
    147 struct CODECEMU
    148 {
    149     DECLR3CALLBACKMEMBER(int, pfnCodecEmuConstruct,(PHDACODEC pThis));
    150     DECLR3CALLBACKMEMBER(int, pfnCodecEmuDestruct,(PHDACODEC pThis));
    151     DECLR3CALLBACKMEMBER(int, pfnCodecEmuReset,(PHDACODEC pThis, bool fInit));
    152 };
    153 # endif
    154 #endif
     123#endif /* DEV_HDA_CODEC_H */
    155124
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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