VirtualBox

Changeset 89386 in vbox for trunk/include/iprt


Ignore:
Timestamp:
May 31, 2021 9:52:54 AM (4 years ago)
Author:
vboxsync
Message:

iprt/formats/riff.h: Added extensible wave format structures and defines. bugref:10008

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/formats/riff.h

    r89078 r89386  
    126126typedef RTRIFFWAVEFMT *PRTRIFFWAVEFMT;
    127127
    128 /** RTRIFFWAVEFMT::uFormatTag value for PCM. */
    129 #define RTRIFFWAVEFMT_TAG_PCM       1
     128/**
     129 * Extensible wave file format (WAVEFORMATEXTENSIBLE).
     130 * @see RTRIFFWAVEFMTEXTCHUNK.
     131 */
     132#pragma pack(4) /* Override the uint64_t effect from RTUUID, so we can safely put it after RTRIFFHDR in a structure.   */
     133typedef struct RTRIFFWAVEFMTEXT
     134{
     135    /** The coreformat structure. */
     136    RTRIFFWAVEFMT       Core;
     137    /** Number of bytes of extra information after the core. */
     138    uint16_t            cbExtra;
     139    /** Number of valid bits per sample. */
     140    uint16_t            cValidBitsPerSample;
     141    /** The channel mask. */
     142    uint32_t            fChannelMask;
     143    /** The GUID of the sub-format. */
     144    RTUUID              SubFormat;
     145} RTRIFFWAVEFMTEXT;
     146#pragma pack()
     147AssertCompileSize(RTRIFFWAVEFMTEXT, 16+2+22);
     148/** Pointer to an extensible wave file format structure. */
     149typedef RTRIFFWAVEFMTEXT *PRTRIFFWAVEFMTEXT;
     150
     151/** RTRIFFWAVEFMT::uFormatTag value for PCM (WDK: WAVE_FORMAT_PCM). */
     152#define RTRIFFWAVEFMT_TAG_PCM           UINT16_C(0x0001)
     153/** RTRIFFWAVEFMT::uFormatTag value for extensible wave files (WDK: WAVE_FORMAT_EXTENSIBLE). */
     154#define RTRIFFWAVEFMT_TAG_EXTENSIBLE    UINT16_C(0xfffe)
     155
     156/** Typical RTRIFFWAVEFMTEXT::cbExtra value (min). */
     157#define RTRIFFWAVEFMTEXT_EXTRA_SIZE     UINT16_C(22)
     158
     159/** @name Channel IDs for RTRIFFWAVEFMTEXT::fChannelMask.
     160 * @{ */
     161#define RTRIFFWAVEFMTEXT_CH_ID_FL       RT_BIT_32(0)    /**< Front left. */
     162#define RTRIFFWAVEFMTEXT_CH_ID_FR       RT_BIT_32(1)    /**< Front right. */
     163#define RTRIFFWAVEFMTEXT_CH_ID_FC       RT_BIT_32(2)    /**< Front center */
     164#define RTRIFFWAVEFMTEXT_CH_ID_LFE      RT_BIT_32(3)    /**< Low frequency */
     165#define RTRIFFWAVEFMTEXT_CH_ID_BL       RT_BIT_32(4)    /**< Back left. */
     166#define RTRIFFWAVEFMTEXT_CH_ID_BR       RT_BIT_32(5)    /**< Back right. */
     167#define RTRIFFWAVEFMTEXT_CH_ID_FLC      RT_BIT_32(6)    /**< Front left of center. */
     168#define RTRIFFWAVEFMTEXT_CH_ID_FLR      RT_BIT_32(7)    /**< Front right of center. */
     169#define RTRIFFWAVEFMTEXT_CH_ID_BC       RT_BIT_32(8)    /**< Back center. */
     170#define RTRIFFWAVEFMTEXT_CH_ID_SL       RT_BIT_32(9)    /**< Side left. */
     171#define RTRIFFWAVEFMTEXT_CH_ID_SR       RT_BIT_32(10)   /**< Side right. */
     172#define RTRIFFWAVEFMTEXT_CH_ID_TC       RT_BIT_32(11)   /**< Top center. */
     173#define RTRIFFWAVEFMTEXT_CH_ID_TFL      RT_BIT_32(12)   /**< Top front left. */
     174#define RTRIFFWAVEFMTEXT_CH_ID_TFC      RT_BIT_32(13)   /**< Top front center. */
     175#define RTRIFFWAVEFMTEXT_CH_ID_TFR      RT_BIT_32(14)   /**< Top front right. */
     176#define RTRIFFWAVEFMTEXT_CH_ID_TBL      RT_BIT_32(15)   /**< Top back left. */
     177#define RTRIFFWAVEFMTEXT_CH_ID_TBC      RT_BIT_32(16)   /**< Top back center. */
     178#define RTRIFFWAVEFMTEXT_CH_ID_TBR      RT_BIT_32(17)   /**< Top back right. */
     179/** @} */
     180
     181/** RTRIFFWAVEFMTEXT::SubFormat UUID string for PCM. */
     182#define RTRIFFWAVEFMTEXT_SUBTYPE_PCM "00000001-0000-0010-8000-00aa00389b71"
     183
    130184
    131185/**
     
    142196/** Pointer to a wave file format chunk.   */
    143197typedef RTRIFFWAVEFMTCHUNK *PRTRIFFWAVEFMTCHUNK;
    144 /** Magic value for RTRIFFWAVEFMTCHUNK::uMagic ('fmt '). */
     198/** Magic value for RTRIFFWAVEFMTCHUNK and RTRIFFWAVEFMTEXTCHUNK ('fmt '). */
    145199#define RTRIFFWAVEFMT_MAGIC RT_BE2H_U32_C(0x666d7420)
     200
     201/**
     202 * Extensible wave file format chunk.
     203 */
     204typedef struct RTRIFFWAVEFMTEXTCHUNK
     205{
     206    /** Chunk header with RTRIFFWAVEFMT_MAGIC as magic. */
     207    RTRIFFCHUNK         Chunk;
     208    /** The wave file format. */
     209    RTRIFFWAVEFMTEXT    Data;
     210} RTRIFFWAVEFMTEXTCHUNK;
     211AssertCompileSize(RTRIFFWAVEFMTEXTCHUNK, 8+16+2+22);
     212/** Pointer to a wave file format chunk.   */
     213typedef RTRIFFWAVEFMTEXTCHUNK *PRTRIFFWAVEFMTEXTCHUNK;
     214
    146215
    147216/**
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