diff options
author | Eric Laurent <elaurent@google.com> | 2010-09-08 16:06:18 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2010-09-08 16:06:18 -0700 |
commit | 54c38fdcff502ab3502c55dd314a954dd60c0183 (patch) | |
tree | 262ae2c34f5eb7e695994ccc3d79c8da097d12d5 /media/libeffects | |
parent | f9c0ae8474dc7180a561ed1e7a8ba3d0d31f6d38 (diff) | |
download | frameworks_av-54c38fdcff502ab3502c55dd314a954dd60c0183.zip frameworks_av-54c38fdcff502ab3502c55dd314a954dd60c0183.tar.gz frameworks_av-54c38fdcff502ab3502c55dd314a954dd60c0183.tar.bz2 |
Modify type of some environmental reverb parameters
Changed type of decay time, reverb delay and reflections delay parameters
from signed to unsigned int to match OpenSL ES interface definition.
Also fixed some type casts in lvm reverb wrapper.
Change-Id: I5ca5e76a87c2590f01f031f3168355586ef22556
Diffstat (limited to 'media/libeffects')
-rwxr-xr-x | media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp b/media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp index 45ef416..b3e1531 100755 --- a/media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp +++ b/media/libeffects/lvm/wrapper/Reverb/EffectReverb.cpp @@ -1133,7 +1133,7 @@ void ReverbSetDecayTime(ReverbContext *pContext, uint32_t time){ //LOGV("\tReverbSetDecayTime() just Got -> %d\n", ActiveParams.T60); if (time <= LVREV_MAX_T60) { - ActiveParams.T60 = time; + ActiveParams.T60 = (LVM_UINT16)time; } else { ActiveParams.T60 = LVREV_MAX_T60; @@ -1146,7 +1146,7 @@ void ReverbSetDecayTime(ReverbContext *pContext, uint32_t time){ pContext->SamplesToExitCount = (ActiveParams.T60 * pContext->config.inputCfg.samplingRate)/1000; //LOGV("\tReverbSetDecayTime() just Set SamplesToExitCount-> %d\n",pContext->SamplesToExitCount); - pContext->SavedDecayTime = time; + pContext->SavedDecayTime = (int16_t)time; //LOGV("\tReverbSetDecayTime end"); return; } @@ -1162,7 +1162,7 @@ void ReverbSetDecayTime(ReverbContext *pContext, uint32_t time){ // //---------------------------------------------------------------------------- -int32_t ReverbGetDecayTime(ReverbContext *pContext){ +uint32_t ReverbGetDecayTime(ReverbContext *pContext){ //LOGV("\tReverbGetDecayTime start"); LVREV_ControlParams_st ActiveParams; /* Current control Parameters */ @@ -1181,7 +1181,7 @@ int32_t ReverbGetDecayTime(ReverbContext *pContext){ } //LOGV("\tReverbGetDecayTime end"); - return ActiveParams.T60; + return (uint32_t)ActiveParams.T60; } //---------------------------------------------------------------------------- @@ -1606,7 +1606,7 @@ int Reverb_getParameter(ReverbContext *pContext, // *(int16_t *)pValue); break; case REVERB_PARAM_DECAY_TIME: - *(int32_t *)pValue = ReverbGetDecayTime(pContext); + *(uint32_t *)pValue = ReverbGetDecayTime(pContext); //LOGV("\tReverb_getParameter() REVERB_PARAM_DECAY_TIME Value is %d", // *(int32_t *)pValue); @@ -1671,6 +1671,7 @@ int Reverb_getParameter(ReverbContext *pContext, int Reverb_setParameter (ReverbContext *pContext, void *pParam, void *pValue){ int status = 0; int16_t level; + int16_t ratio; uint32_t time; t_reverb_settings *pProperties; int32_t *pParamTemp = (int32_t *)pParam; @@ -1688,6 +1689,7 @@ int Reverb_setParameter (ReverbContext *pContext, void *pParam, void *pValue){ return -EINVAL; } pContext->nextPreset = preset; + return 0; } switch (param){ @@ -1724,10 +1726,10 @@ int Reverb_setParameter (ReverbContext *pContext, void *pParam, void *pValue){ //LOGV("\tReverb_setParameter() Called ReverbSetDecayTime"); break; case REVERB_PARAM_DECAY_HF_RATIO: - time = *(int16_t *)pValue; - //LOGV("\tReverb_setParameter() REVERB_PARAM_DECAY_HF_RATIO value is %d", time); + ratio = *(int16_t *)pValue; + //LOGV("\tReverb_setParameter() REVERB_PARAM_DECAY_HF_RATIO value is %d", ratio); //LOGV("\tReverb_setParameter() Calling ReverbSetDecayHfRatio"); - ReverbSetDecayHfRatio(pContext, time); + ReverbSetDecayHfRatio(pContext, ratio); //LOGV("\tReverb_setParameter() Called ReverbSetDecayHfRatio"); break; case REVERB_PARAM_REVERB_LEVEL: @@ -1738,17 +1740,17 @@ int Reverb_setParameter (ReverbContext *pContext, void *pParam, void *pValue){ //LOGV("\tReverb_setParameter() Called ReverbSetReverbLevel"); break; case REVERB_PARAM_DIFFUSION: - time = *(int16_t *)pValue; - //LOGV("\tReverb_setParameter() REVERB_PARAM_DECAY_DIFFUSION value is %d", time); + ratio = *(int16_t *)pValue; + //LOGV("\tReverb_setParameter() REVERB_PARAM_DECAY_DIFFUSION value is %d", ratio); //LOGV("\tReverb_setParameter() Calling ReverbSetDiffusion"); - ReverbSetDiffusion(pContext, time); + ReverbSetDiffusion(pContext, ratio); //LOGV("\tReverb_setParameter() Called ReverbSetDiffusion"); break; case REVERB_PARAM_DENSITY: - time = *(int16_t *)pValue; - //LOGV("\tReverb_setParameter() REVERB_PARAM_DECAY_DENSITY value is %d", time); + ratio = *(int16_t *)pValue; + //LOGV("\tReverb_setParameter() REVERB_PARAM_DECAY_DENSITY value is %d", ratio); //LOGV("\tReverb_setParameter() Calling ReverbSetDensity"); - ReverbSetDensity(pContext, time); + ReverbSetDensity(pContext, ratio); //LOGV("\tReverb_setParameter() Called ReverbSetDensity"); break; break; |