VirtualBox

Changeset 73467 in vbox for trunk/include


Ignore:
Timestamp:
Aug 3, 2018 9:49:55 AM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
124094
Message:

DrvAudio: Cleaned up the internal stream organization by not duplicating stuff like the status and the like by having two PDMAUDIOSTREAMs (on for the guest side and one for the host side). Instead, only use PDMAUDIOSTREAM and keep the guest and host specifics in PDMAUDIOSTREAMCTX. Should help simplifying things a lot.

File:
1 edited

Legend:

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

    r73433 r73467  
    348348    /** Size (in bytes) of the host backend's audio input stream structure. */
    349349    size_t   cbStreamIn;
    350     /** Number of concurrent output streams supported on the host.
     350    /** Number of concurrent output (playback) streams supported on the host.
    351351     *  UINT32_MAX for unlimited concurrent streams, 0 if no concurrent input streams are supported. */
    352352    uint32_t cMaxStreamsOut;
    353     /** Number of concurrent input streams supported on the host.
     353    /** Number of concurrent input (recording) streams supported on the host.
    354354     *  UINT32_MAX for unlimited concurrent streams, 0 if no concurrent input streams are supported. */
    355355    uint32_t cMaxStreamsIn;
     
    953953
    954954/**
    955  * Audio stream context.
    956  */
    957 typedef enum PDMAUDIOSTREAMCTX
    958 {
    959     /** No context set / invalid. */
    960     PDMAUDIOSTREAMCTX_UNKNOWN = 0,
    961     /** Host stream, connected to a backend. */
    962     PDMAUDIOSTREAMCTX_HOST,
    963     /** Guest stream, connected to the device emulation. */
    964     PDMAUDIOSTREAMCTX_GUEST,
    965     /** Hack to blow the type up to 32-bit. */
    966     PDMAUDIOSTREAMCTX_32BIT_HACK = 0x7fffffff
    967 } PDMAUDIOSTREAMCTX;
    968 
    969 /**
    970955 * Structure for keeping audio input stream specifics.
    971956 * Do not use directly. Instead, use PDMAUDIOSTREAM.
     
    10151000} PDMAUDIOSTREAMOUT, *PPDMAUDIOSTREAMOUT;
    10161001
     1002/** Pointer to an audio stream. */
    10171003typedef struct PDMAUDIOSTREAM *PPDMAUDIOSTREAM;
    10181004
    10191005/**
    1020  * Structure for maintaining an nput/output audio stream.
     1006 * Audio stream context.
     1007 * Needed for separating data from the guest and host side (per stream).
     1008 */
     1009typedef struct PDMAUDIOSTREAMCTX
     1010{
     1011    /** The stream's audio configuration. */
     1012    PDMAUDIOSTREAMCFG      Cfg;
     1013    /** This stream's mixing buffer. */
     1014    PDMAUDIOMIXBUF         MixBuf;
     1015} PDMAUDIOSTREAMCTX;
     1016
     1017/** Pointer to an audio stream context. */
     1018typedef struct PDMAUDIOSTREAM *PPDMAUDIOSTREAMCTX;
     1019
     1020/**
     1021 * Structure for maintaining an input/output audio stream.
    10211022 */
    10221023typedef struct PDMAUDIOSTREAM
     
    10241025    /** List node. */
    10251026    RTLISTNODE             Node;
    1026     /** Pointer to the other pair of this stream.
    1027      *  This might be the host or guest side. */
    1028     PPDMAUDIOSTREAM        pPair;
    10291027    /** Name of this stream. */
    10301028    char                   szName[64];
     
    10321030     *  destroyed if the reference count is reaching 0. */
    10331031    uint32_t               cRefs;
    1034     /** The stream's audio configuration. */
    1035     PDMAUDIOSTREAMCFG      Cfg;
    10361032    /** Stream status flag. */
    10371033    PDMAUDIOSTREAMSTS      fStatus;
    1038     /** This stream's mixing buffer. */
    1039     PDMAUDIOMIXBUF         MixBuf;
    10401034    /** Audio direction of this stream. */
    10411035    PDMAUDIODIR            enmDir;
    1042     /** Context of this stream. */
    1043     PDMAUDIOSTREAMCTX      enmCtx;
     1036    /** The guest side of the stream. */
     1037    PDMAUDIOSTREAMCTX      Guest;
     1038    /** The host side of the stream. */
     1039    PDMAUDIOSTREAMCTX      Host;
     1040    /** Union for input/output specifics (based on enmDir). */
     1041    union
     1042    {
     1043        PDMAUDIOSTREAMIN   In;
     1044        PDMAUDIOSTREAMOUT  Out;
     1045    } RT_UNION_NM(u);
    10441046    /** Timestamp (in ns) since last iteration. */
    10451047    uint64_t               tsLastIteratedNs;
     
    10541056     *  data to actually start reading audio. */
    10551057    bool                   fThresholdReached;
    1056     /** Union for input/output specifics. */
    1057     union
    1058     {
    1059         PDMAUDIOSTREAMIN   In;
    1060         PDMAUDIOSTREAMOUT  Out;
    1061     } RT_UNION_NM(u);
    10621058    /** Data to backend-specific stream data.
    10631059     *  This data block will be casted by the backend to access its backend-dependent data.
Note: See TracChangeset for help on using the changeset viewer.

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