VirtualBox

Changeset 68733 in vbox


Ignore:
Timestamp:
Sep 13, 2017 8:46:40 AM (7 years ago)
Author:
vboxsync
Message:

VideoRec/EbmlWriter.cpp: Renamed OpusPrivData -> WEBMOPUSPRIVDATA and moved it out of the WebM implementation scope.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/EbmlWriter.cpp

    r68724 r68733  
    321321 *  With signed 16-bit timecodes and a default timecode scale of 1ms per unit this makes 65536ms. */
    322322#define VBOX_WEBM_BLOCK_MAX_LEN_MS          UINT16_MAX
     323
     324#ifdef VBOX_WITH_LIBOPUS
     325# pragma pack(push)
     326# pragma pack(1)
     327    /** Opus codec private data within the MKV (WEBM) container.
     328     *  Taken from: https://wiki.xiph.org/MatroskaOpus */
     329    typedef struct WEBMOPUSPRIVDATA
     330    {
     331        WEBMOPUSPRIVDATA(uint32_t a_u32SampleRate, uint8_t a_u8Channels)
     332        {
     333            au64Head        = RT_MAKE_U64_FROM_U8('O', 'p', 'u', 's', 'H', 'e', 'a', 'd');
     334            u8Version       = 1;
     335            u8Channels      = a_u8Channels;
     336            u16PreSkip      = 0;
     337            u32SampleRate   = a_u32SampleRate;
     338            u16Gain         = 0;
     339            u8MappingFamily = 0;
     340        }
     341
     342        uint64_t au64Head;          /**< Defaults to "OpusHead". */
     343        uint8_t  u8Version;         /**< Must be set to 1. */
     344        uint8_t  u8Channels;
     345        uint16_t u16PreSkip;
     346        /** Sample rate *before* encoding to Opus.
     347         *  Note: This rate has nothing to do with the playback rate later! */
     348        uint32_t u32SampleRate;
     349        uint16_t u16Gain;
     350        /** Must stay 0 -- otherwise a mapping table must be appended
     351         *  right after this header. */
     352        uint8_t  u8MappingFamily;
     353    } WEBMOPUSPRIVDATA, *PWEBMOPUSPRIVDATA;
     354    AssertCompileSize(WEBMOPUSPRIVDATA, 19);
     355# pragma pack(pop)
     356#endif /* VBOX_WITH_LIBOPUS */
    323357
    324358class WebMWriter_Impl
     
    490524    } CurSeg;
    491525
    492 #ifdef VBOX_WITH_LIBOPUS
    493 # pragma pack(push)
    494 # pragma pack(1)
    495     /** Opus codec private data.
    496      *  Taken from: https://wiki.xiph.org/MatroskaOpus */
    497     struct OpusPrivData
    498     {
    499         OpusPrivData(uint32_t a_u32SampleRate, uint8_t a_u8Channels)
    500         {
    501             au64Head        = RT_MAKE_U64_FROM_U8('O', 'p', 'u', 's', 'H', 'e', 'a', 'd');
    502             u8Version       = 1;
    503             u8Channels      = a_u8Channels;
    504             u16PreSkip      = 0;
    505             u32SampleRate   = a_u32SampleRate;
    506             u16Gain         = 0;
    507             u8MappingFamily = 0;
    508         }
    509 
    510         uint64_t au64Head;          /**< Defaults to "OpusHead". */
    511         uint8_t  u8Version;         /**< Must be set to 1. */
    512         uint8_t  u8Channels;
    513         uint16_t u16PreSkip;
    514         /** Sample rate *before* encoding to Opus.
    515          *  Note: This rate has nothing to do with the playback rate later! */
    516         uint32_t u32SampleRate;
    517         uint16_t u16Gain;
    518         /** Must stay 0 -- otherwise a mapping table must be appended
    519          *  right after this header. */
    520         uint8_t  u8MappingFamily;
    521     };
    522     AssertCompileSize(OpusPrivData, 19);
    523 # pragma pack(pop)
    524 #endif /* VBOX_WITH_LIBOPUS */
    525 
    526526    /** Audio codec to use. */
    527527    WebMWriter::AudioCodec      m_enmAudioCodec;
     
    611611        pTrack->Audio.framesPerBlock = uHz / (1000 /* s in ms */ / pTrack->Audio.msPerBlock);
    612612
    613         OpusPrivData opusPrivData(uHz, cChannels);
     613        WEBMOPUSPRIVDATA opusPrivData(uHz, cChannels);
    614614
    615615        LogFunc(("Opus @ %RU16Hz (%RU16ms + %RU16 frames per block)\n",
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