VirtualBox

Changeset 68323 in vbox


Ignore:
Timestamp:
Aug 7, 2017 3:32:13 PM (7 years ago)
Author:
vboxsync
Message:

Main/DrvAudioVideoRec.cpp: Added define for Opus' maximum Hz rate.

File:
1 edited

Legend:

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

    r68322 r68323  
    5353# include <opus.h>
    5454#endif
     55
     56
     57/*********************************************************************************************************************************
     58*   Defines                                                                                                                      *
     59*********************************************************************************************************************************/
     60
     61#define AVREC_OPUS_HZ_MAX       48000           /** Maximum sample rate (in Hz) Opus can handle. */
     62
    5563
    5664/*********************************************************************************************************************************
     
    229237    /* Opus only supports certain input sample rates in an efficient manner.
    230238     * So make sure that we use those by resampling the data to the requested rate. */
    231     if      (uHz > 24000) uHz = 48000;
     239    if      (uHz > 24000) uHz = AVREC_OPUS_HZ_MAX;
    232240    else if (uHz > 16000) uHz = 24000;
    233241    else if (uHz > 12000) uHz = 16000;
     
    304312
    305313        /* Calculate the maximum frame size. */
    306         pSink->Codec.Opus.csFrameMax = 48000                   /* Maximum sample rate Opus can handle */
     314        pSink->Codec.Opus.csFrameMax = AVREC_OPUS_HZ_MAX       /* Maximum sample rate Opus can handle */
    307315                                     * pCodecParms->cChannels; /* Number of channels */
    308316    }
     
    489497
    490498    AVRECCODECPARMS CodecParms;
    491     CodecParms.uHz       = 48000;  /** @todo Make this configurable. */
    492     CodecParms.cChannels = 2;      /** @todo Make this configurable. */
    493     CodecParms.uBitrate  = 196000; /** @todo Make this configurable. */
     499    CodecParms.uHz       = AVREC_OPUS_HZ_MAX;  /** @todo Make this configurable. */
     500    CodecParms.cChannels = 2;                  /** @todo Make this configurable. */
     501    CodecParms.uBitrate  = 196000;             /** @todo Make this configurable. */
    494502
    495503    int rc = avRecSinkInit(pThis, &pThis->Sink, &ContainerParms, &CodecParms);
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