Kodi Documentation 18.0
Kodi is an open source media player and entertainment hub.
CAEUtil Class Reference

#include <AEUtil.h>

Static Public Member Functions

static CAEChannelInfo GuessChLayout (const unsigned int channels)
 
static const char * GetStdChLayoutName (const enum AEStdChLayout layout)
 
static unsigned int DataFormatToBits (const enum AEDataFormat dataFormat)
 
static unsigned int DataFormatToUsedBits (const enum AEDataFormat dataFormat)
 
static unsigned int DataFormatToDitherBits (const enum AEDataFormat dataFormat)
 
static const char * DataFormatToStr (const enum AEDataFormat dataFormat)
 
static const char * StreamTypeToStr (const enum CAEStreamInfo::DataType dataType)
 
static float PercentToGain (const float value)
 convert a volume percentage (as a proportion) to a dB gain We assume a dB range of 60dB, i.e. assume that 0% volume corresponds to a reduction of 60dB. More...
 
static float GainToPercent (const float gain)
 convert a dB gain to volume percentage (as a proportion) We assume a dB range of 60dB, i.e. assume that 0% volume corresponds to a reduction of 60dB. More...
 
static float GainToScale (const float dB)
 convert a dB gain to a scale factor for audio manipulation Inverts gain = 20 log_10(scale) More...
 
static float ScaleToGain (const float scale)
 convert a scale factor to dB gain for audio manipulation Inverts GainToScale result More...
 
static void ClampArray (float *data, uint32_t count)
 
static bool S16NeedsByteSwap (AEDataFormat in, AEDataFormat out)
 
static uint64_t GetAVChannelLayout (const CAEChannelInfo &info)
 
static CAEChannelInfo GetAEChannelLayout (uint64_t layout)
 
static AVSampleFormat GetAVSampleFormat (AEDataFormat format)
 
static uint64_t GetAVChannel (enum AEChannel aechannel)
 
static int GetAVChannelIndex (enum AEChannel aechannel, uint64_t layout)
 

Member Function Documentation

◆ ClampArray()

void CAEUtil::ClampArray ( float *  data,
uint32_t  count 
)
static

◆ DataFormatToBits()

unsigned int CAEUtil::DataFormatToBits ( const enum AEDataFormat  dataFormat)
static

◆ DataFormatToDitherBits()

unsigned int CAEUtil::DataFormatToDitherBits ( const enum AEDataFormat  dataFormat)
static

◆ DataFormatToStr()

const char * CAEUtil::DataFormatToStr ( const enum AEDataFormat  dataFormat)
static

◆ DataFormatToUsedBits()

unsigned int CAEUtil::DataFormatToUsedBits ( const enum AEDataFormat  dataFormat)
static

◆ GainToPercent()

static float CAEUtil::GainToPercent ( const float  gain)
inlinestatic

convert a dB gain to volume percentage (as a proportion) We assume a dB range of 60dB, i.e. assume that 0% volume corresponds to a reduction of 60dB.

Parameters
thecorresponding gain in dB from -60dB .. 0dB.
Returns
value the volume from 0..1
See also
ScaleToGain

◆ GainToScale()

static float CAEUtil::GainToScale ( const float  dB)
inlinestatic

convert a dB gain to a scale factor for audio manipulation Inverts gain = 20 log_10(scale)

Parameters
dBthe gain in decibels.
Returns
the scale factor (equivalent to a voltage multiplier).
See also
PercentToGain

◆ GetAEChannelLayout()

CAEChannelInfo CAEUtil::GetAEChannelLayout ( uint64_t  layout)
static

◆ GetAVChannel()

uint64_t CAEUtil::GetAVChannel ( enum AEChannel  aechannel)
static

◆ GetAVChannelIndex()

int CAEUtil::GetAVChannelIndex ( enum AEChannel  aechannel,
uint64_t  layout 
)
static

◆ GetAVChannelLayout()

uint64_t CAEUtil::GetAVChannelLayout ( const CAEChannelInfo info)
static

◆ GetAVSampleFormat()

AVSampleFormat CAEUtil::GetAVSampleFormat ( AEDataFormat  format)
static

◆ GetStdChLayoutName()

const char * CAEUtil::GetStdChLayoutName ( const enum AEStdChLayout  layout)
static

◆ GuessChLayout()

CAEChannelInfo CAEUtil::GuessChLayout ( const unsigned int  channels)
static

◆ PercentToGain()

static float CAEUtil::PercentToGain ( const float  value)
inlinestatic

convert a volume percentage (as a proportion) to a dB gain We assume a dB range of 60dB, i.e. assume that 0% volume corresponds to a reduction of 60dB.

Parameters
valuethe volume from 0..1
Returns
the corresponding gain in dB from -60dB .. 0dB.
See also
GainToScale

◆ S16NeedsByteSwap()

bool CAEUtil::S16NeedsByteSwap ( AEDataFormat  in,
AEDataFormat  out 
)
static

◆ ScaleToGain()

static float CAEUtil::ScaleToGain ( const float  scale)
inlinestatic

convert a scale factor to dB gain for audio manipulation Inverts GainToScale result

Parameters
thescale factor (equivalent to a voltage multiplier).
Returns
dB the gain in decibels.
See also
GainToScale

◆ StreamTypeToStr()

const char * CAEUtil::StreamTypeToStr ( const enum CAEStreamInfo::DataType  dataType)
static

The documentation for this class was generated from the following files: