VirtualBox

Changeset 61352 in vbox for trunk/include


Ignore:
Timestamp:
Jun 1, 2016 12:58:14 AM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
107648
Message:

AudioMixBuffer,tstAudioMixBuffer,pdmaudioifs.h: Fixed buffer overflow in AudioMixBufWriteAtEx during testcase run due to incomplete checking. Fixed some coding convesion issues. Made the debug build of the testcsae always use the electric fence heap.

File:
1 edited

Legend:

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

    r61320 r61352  
    9292    int64_t i64LSample;
    9393    int64_t i64RSample;
    94 } PDMAUDIOSAMPLE, *PPDMAUDIOSAMPLE;
     94} PDMAUDIOSAMPLE;
     95/** Pointer to a single (stereo) audio sample.   */
     96typedef PDMAUDIOSAMPLE *PPDMAUDIOSAMPLE;
     97/** Pointer to a const single (stereo) audio sample.   */
     98typedef PDMAUDIOSAMPLE const *PCPDMAUDIOSAMPLE;
    9599
    96100typedef enum PDMAUDIOENDIANNESS
     
    344348 * the audioMixBufConvFromXXX / audioMixBufConvToXXX macros.
    345349 */
    346 typedef struct PDMAUDMIXBUF_CONVOPTS
     350typedef struct PDMAUDMIXBUFCONVOPTS
    347351{
    348352    /** Number of audio samples to convert. */
     
    352356     *  all conversion functions. */
    353357    PDMAUDIOVOLUME Volume;
    354 } PDMAUDMIXBUF_CONVOPTS, *PPDMAUDMIXBUF_CONVOPTS;
     358} PDMAUDMIXBUFCONVOPTS;
     359/** Pointer to conversion parameters for the audio mixer.   */
     360typedef PDMAUDMIXBUFCONVOPTS *PPDMAUDMIXBUFCONVOPTS;
     361/** Pointer to const conversion parameters for the audio mixer.   */
     362typedef PDMAUDMIXBUFCONVOPTS const *PCPDMAUDMIXBUFCONVOPTS;
    355363
    356364/**
     
    361369typedef PDMAUDIOMIXBUFFMT *PPDMAUDIOMIXBUFFMT;
    362370
    363 /** Function pointer definition for a conversion-from routine
    364  *  used by the PDM audio mixing buffer. */
    365 typedef uint32_t (PDMAUDMIXBUF_FN_CONVFROM) (PPDMAUDIOSAMPLE paDst, const void *pvSrc, uint32_t cbSrc, const PPDMAUDMIXBUF_CONVOPTS pOpts);
    366 typedef PDMAUDMIXBUF_FN_CONVFROM *PPDMAUDMIXBUF_FN_CONVFROM;
    367 
    368 /** Function definition for a conversion-to routine
    369  *  used by the PDM audio mixing buffer. */
    370 typedef void (PDMAUDMIXBUF_FN_CONVTO) (void *pvDst, const PPDMAUDIOSAMPLE paSrc, const PPDMAUDMIXBUF_CONVOPTS pOpts);
    371 typedef PDMAUDMIXBUF_FN_CONVTO *PPDMAUDMIXBUF_FN_CONVTO;
     371/**
     372 * Convertion-from function used by the PDM audio buffer mixer.
     373 *
     374 * @returns Number of samples returned.
     375 * @param   paDst           Where to return the converted samples.
     376 * @param   pvSrc           The source samples bytes.
     377 * @param   cbSrc           Number of bytes to convert.
     378 * @param   pOpts           Conversion options.
     379 */
     380typedef DECLCALLBACK(uint32_t) FNPDMAUDIOMIXBUFCONVFROM(PPDMAUDIOSAMPLE paDst, const void *pvSrc, uint32_t cbSrc,
     381                                                        PCPDMAUDMIXBUFCONVOPTS pOpts);
     382/** Pointer to a convertion-from function used by the PDM audio buffer mixer. */
     383typedef FNPDMAUDIOMIXBUFCONVFROM *PFNPDMAUDIOMIXBUFCONVFROM;
     384
     385/**
     386 * Convertion-to function used by the PDM audio buffer mixer.
     387 *
     388 * @param   pvDst           Output buffer.
     389 * @param   paSrc           The input samples.
     390 * @param   pOpts           Conversion options.
     391 */
     392typedef DECLCALLBACK(void) FNPDMAUDIOMIXBUFCONVTO(void *pvDst, PCPDMAUDIOSAMPLE paSrc, PCPDMAUDMIXBUFCONVOPTS pOpts);
     393/** Pointer to a convertion-to function used by the PDM audio buffer mixer. */
     394typedef FNPDMAUDIOMIXBUFCONVTO *PFNPDMAUDIOMIXBUFCONVTO;
    372395
    373396typedef struct PDMAUDIOMIXBUF *PPDMAUDIOMIXBUF;
     
    408431    PDMAUDIOMIXBUFFMT         AudioFmt;
    409432    /** Standard conversion-to function for set AudioFmt. */
    410     PPDMAUDMIXBUF_FN_CONVTO   pConvTo;
     433    PFNPDMAUDIOMIXBUFCONVTO   pfnConvTo;
    411434    /** Standard conversion-from function for set AudioFmt. */
    412     PPDMAUDMIXBUF_FN_CONVFROM pConvFrom;
     435    PFNPDMAUDIOMIXBUFCONVFROM pfnConvFrom;
    413436    /**
    414437     * Ratio of the associated parent stream's frequency by this stream's
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