VirtualBox

Changeset 89338 in vbox


Ignore:
Timestamp:
May 28, 2021 8:57:49 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
144687
Message:

AudioMixer: Removed unused members from AUDIOMIXBUF and rearranged them for better locality. bugref:9890

Location:
trunk/src/VBox/Devices/Audio
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/AudioMixBuffer.cpp

    r89337 r89338  
    793793    pMixBuf->Volume.uRight = AUDIOMIXBUF_VOL_0DB;
    794794
    795     /* Prevent division by zero.
    796      * Do a 1:1 conversion according to AUDIOMIXBUF_S2B_RATIO. */
    797     pMixBuf->iFreqRatio = 1 << 20;
    798 
    799795    pMixBuf->Props       = *pProps;
    800796
  • trunk/src/VBox/Devices/Audio/AudioMixBuffer.h

    r89337 r89338  
    143143    /** Magic value (AUDIOMIXBUF_MAGIC). */
    144144    uint32_t                    uMagic;
    145     uint8_t                     abPadding[4];
    146     /* ???Undocumented??? */
    147     RTLISTNODE                  Node;
    148     /** Name of the buffer. */
    149     char                       *pszName;
     145    /** Size of the frame buffer (in audio frames). */
     146    uint32_t                    cFrames;
    150147    /** Frame buffer. */
    151148    PPDMAUDIOFRAME              pFrames;
    152     /** Size of the frame buffer (in audio frames). */
    153     uint32_t                    cFrames;
    154149    /** The current read position (in frames). */
    155150    uint32_t                    offRead;
     
    165160     * @note This also is known as the distance in ring buffer terms. */
    166161    uint32_t                    cUsed;
     162    /** Audio properties for the buffer content - for frequency and channel count.
     163     * (This is the guest side PCM properties.) */
     164    PDMAUDIOPCMPROPS            Props;
    167165    /** Internal representation of current volume used for mixing. */
    168166    AUDMIXBUFVOL                Volume;
    169     /** Audio input properties.
    170      * @note There is only one set of audio properties here because we have one
    171      *       mixer buffer for the guest side and a separate one for the host side.
    172      * @todo r=bird: Why exactly do we need to use separate mixer buffers?
    173      *       Couldn't we just have different conversion fuctions and save the
    174      *       extra copying? */
    175     PDMAUDIOPCMPROPS            Props;
    176 
    177     /** Ratio of the associated parent stream's frequency by this stream's
    178      * frequency (1<<32), represented as a signed 64 bit integer.
    179      *
    180      * For example, if the parent stream has a frequency of 44 khZ, and this
    181      * stream has a frequency of 11 kHz, the ration then would be
    182      * (44/11 * (1 << 32)).
    183      *
    184      * Currently this does not get changed once assigned. */
    185     int64_t                     iFreqRatio;
     167    /** Name of the buffer. */
     168    char                       *pszName;
    186169} AUDIOMIXBUF;
    187170
     
    196179 * @note Does *not* take the conversion ratio into account. */
    197180#define AUDIOMIXBUF_B2F(a_pMixBuf, a_cb)        PDMAUDIOPCMPROPS_B2F(&(a_pMixBuf)->Props, a_cb)
    198 
    199 /** Converts frames to bytes, respecting the conversion ratio to
    200  *  a linked buffer. */
    201 #define AUDIOMIXBUF_F2B_RATIO(a_pMixBuf, a_cFrames) AUDIOMIXBUF_F2B(a_pMixBuf, AUDIOMIXBUF_F2F_RATIO(a_pMixBuf, a_cFrames))
    202 /** Converts number of frames according to the buffer's ratio.
    203  * @todo r=bird: Why the *signed* cast?  */
    204 #define AUDIOMIXBUF_F2F_RATIO(a_pMixBuf, a_cFrames) (((int64_t)(a_cFrames) << 32) / (a_pMixBuf)->iFreqRatio)
    205181
    206182
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