Loading api/current.xml +2 −2 Original line number Original line Diff line number Diff line Loading @@ -91791,7 +91791,7 @@ type="int" type="int" transient="false" transient="false" volatile="false" volatile="false" value="1" value="0" static="true" static="true" final="true" final="true" deprecated="not deprecated" deprecated="not deprecated" Loading @@ -91802,7 +91802,7 @@ type="int" type="int" transient="false" transient="false" volatile="false" volatile="false" value="0" value="1" static="true" static="true" final="true" final="true" deprecated="not deprecated" deprecated="not deprecated" media/java/android/media/AudioEffect.java +6 −7 Original line number Original line Diff line number Diff line Loading @@ -101,15 +101,15 @@ public class AudioEffect { public static final int STATE_INITIALIZED = 1; public static final int STATE_INITIALIZED = 1; // to keep in sync with // to keep in sync with // frameworks/base/media/jni/audioeffect/android_media_AudioEffect.cpp // frameworks/base/include/media/AudioEffect.h /** /** * Event id for engine state change notification. * Event id for engine control ownership change notification. */ */ public static final int NATIVE_EVENT_ENABLED_STATUS = 0; public static final int NATIVE_EVENT_CONTROL_STATUS = 0; /** /** * Event id for engine control ownership change notification. * Event id for engine state change notification. */ */ public static final int NATIVE_EVENT_CONTROL_STATUS = 1; public static final int NATIVE_EVENT_ENABLED_STATUS = 1; /** /** * Event id for engine parameter change notification. * Event id for engine parameter change notification. */ */ Loading Loading @@ -795,7 +795,7 @@ public class AudioEffect { // Interface definitions // Interface definitions // -------------------- // -------------------- /** /** * The OnParameterChangeListener interface defines a method called by the AudioEffect * The OnEnableStatusChangeListener interface defines a method called by the AudioEffect * when a the enabled state of the effect engine was changed by the controlling application. * when a the enabled state of the effect engine was changed by the controlling application. */ */ public interface OnEnableStatusChangeListener { public interface OnEnableStatusChangeListener { Loading Loading @@ -922,7 +922,6 @@ public class AudioEffect { if (effect == null) { if (effect == null) { return; return; } } if (effect.mNativeEventHandler != null) { if (effect.mNativeEventHandler != null) { Message m = effect.mNativeEventHandler.obtainMessage(what, arg1, Message m = effect.mNativeEventHandler.obtainMessage(what, arg1, arg2, obj); arg2, obj); Loading media/libmedia/AudioEffect.cpp +22 −3 Original line number Original line Diff line number Diff line Loading @@ -218,7 +218,7 @@ status_t AudioEffect::setEnabled(bool enabled) return mIEffect->disable(); return mIEffect->disable(); } } } } return INVALID_OPERATION; return NO_ERROR; } } status_t AudioEffect::command(uint32_t cmdCode, status_t AudioEffect::command(uint32_t cmdCode, Loading @@ -231,7 +231,22 @@ status_t AudioEffect::command(uint32_t cmdCode, return INVALID_OPERATION; return INVALID_OPERATION; } } return mIEffect->command(cmdCode, cmdSize, cmdData, replySize, replyData); status_t status = mIEffect->command(cmdCode, cmdSize, cmdData, replySize, replyData); if (status != NO_ERROR) { return status; } status = *(status_t *)replyData; if (status != NO_ERROR) { return status; } if (cmdCode == EFFECT_CMD_ENABLE) { android_atomic_or(1, &mEnabled); } if (cmdCode == EFFECT_CMD_DISABLE) { android_atomic_and(~1, &mEnabled); } return status; } } Loading Loading @@ -347,7 +362,11 @@ void AudioEffect::enableStatusChanged(bool enabled) { { LOGV("enableStatusChanged %p enabled %d mCbf %p", this, enabled, mCbf); LOGV("enableStatusChanged %p enabled %d mCbf %p", this, enabled, mCbf); if (mStatus == ALREADY_EXISTS) { if (mStatus == ALREADY_EXISTS) { mEnabled = enabled; if (enabled) { android_atomic_or(1, &mEnabled); } else { android_atomic_and(~1, &mEnabled); } if (mCbf) { if (mCbf) { mCbf(EVENT_ENABLE_STATUS_CHANGED, mUserData, &enabled); mCbf(EVENT_ENABLE_STATUS_CHANGED, mUserData, &enabled); } } Loading services/audioflinger/AudioFlinger.cpp +8 −5 Original line number Original line Diff line number Diff line Loading @@ -1696,7 +1696,10 @@ uint32_t AudioFlinger::MixerThread::prepareTracks_l(const SortedVector< wp<Track // Delegate master volume control to effect in output mix effect chain if needed // Delegate master volume control to effect in output mix effect chain if needed sp<EffectChain> chain = getEffectChain_l(AudioSystem::SESSION_OUTPUT_MIX); sp<EffectChain> chain = getEffectChain_l(AudioSystem::SESSION_OUTPUT_MIX); if (chain != 0) { if (chain != 0) { uint32_t v = (uint32_t)(masterVolume * (1 << 24)); uint32_t v = 0; if (!masterMute) { v = (uint32_t)(masterVolume * (1 << 24)); } chain->setVolume_l(&v, &v); chain->setVolume_l(&v, &v); masterVolume = (float)((v + (1 << 23)) >> 24); masterVolume = (float)((v + (1 << 23)) >> 24); chain.clear(); chain.clear(); Loading Loading @@ -1750,7 +1753,7 @@ uint32_t AudioFlinger::MixerThread::prepareTracks_l(const SortedVector< wp<Track // compute volume for this track // compute volume for this track int16_t left, right, aux; int16_t left, right, aux; if (track->isMuted() || masterMute || track->isPausing() || if (track->isMuted() || track->isPausing() || mStreamTypes[track->type()].mute) { mStreamTypes[track->type()].mute) { left = right = aux = 0; left = right = aux = 0; if (track->isPausing()) { if (track->isPausing()) { Loading Loading @@ -5351,7 +5354,7 @@ void AudioFlinger::EffectModule::process() return; return; } } if (mState == ACTIVE || mState == STOPPING || mState == STOPPED) { if (mState == ACTIVE || mState == STOPPING || mState == STOPPED || mState == RESTART) { // do 32 bit to 16 bit conversion for auxiliary effect input buffer // do 32 bit to 16 bit conversion for auxiliary effect input buffer if ((mDescriptor.flags & EFFECT_FLAG_TYPE_MASK) == EFFECT_FLAG_TYPE_AUXILIARY) { if ((mDescriptor.flags & EFFECT_FLAG_TYPE_MASK) == EFFECT_FLAG_TYPE_AUXILIARY) { AudioMixer::ditherAndClamp(mConfig.inputCfg.buffer.s32, AudioMixer::ditherAndClamp(mConfig.inputCfg.buffer.s32, Loading Loading @@ -6032,8 +6035,8 @@ void AudioFlinger::EffectHandle::dump(char* buffer, size_t size) AudioFlinger::EffectChain::EffectChain(const wp<ThreadBase>& wThread, AudioFlinger::EffectChain::EffectChain(const wp<ThreadBase>& wThread, int sessionId) int sessionId) : mThread(wThread), mSessionId(sessionId), mActiveTrackCnt(0), mOwnInBuffer(false), : mThread(wThread), mSessionId(sessionId), mActiveTrackCnt(0), mOwnInBuffer(false), mVolumeCtrlIdx(-1), mLeftVolume(0), mRightVolume(0), mVolumeCtrlIdx(-1), mLeftVolume(UINT_MAX), mRightVolume(UINT_MAX), mNewLeftVolume(0), mNewRightVolume(0) mNewLeftVolume(UINT_MAX), mNewRightVolume(UINT_MAX) { { mStrategy = AudioSystem::getStrategyForStream(AudioSystem::MUSIC); mStrategy = AudioSystem::getStrategyForStream(AudioSystem::MUSIC); } } Loading Loading
api/current.xml +2 −2 Original line number Original line Diff line number Diff line Loading @@ -91791,7 +91791,7 @@ type="int" type="int" transient="false" transient="false" volatile="false" volatile="false" value="1" value="0" static="true" static="true" final="true" final="true" deprecated="not deprecated" deprecated="not deprecated" Loading @@ -91802,7 +91802,7 @@ type="int" type="int" transient="false" transient="false" volatile="false" volatile="false" value="0" value="1" static="true" static="true" final="true" final="true" deprecated="not deprecated" deprecated="not deprecated"
media/java/android/media/AudioEffect.java +6 −7 Original line number Original line Diff line number Diff line Loading @@ -101,15 +101,15 @@ public class AudioEffect { public static final int STATE_INITIALIZED = 1; public static final int STATE_INITIALIZED = 1; // to keep in sync with // to keep in sync with // frameworks/base/media/jni/audioeffect/android_media_AudioEffect.cpp // frameworks/base/include/media/AudioEffect.h /** /** * Event id for engine state change notification. * Event id for engine control ownership change notification. */ */ public static final int NATIVE_EVENT_ENABLED_STATUS = 0; public static final int NATIVE_EVENT_CONTROL_STATUS = 0; /** /** * Event id for engine control ownership change notification. * Event id for engine state change notification. */ */ public static final int NATIVE_EVENT_CONTROL_STATUS = 1; public static final int NATIVE_EVENT_ENABLED_STATUS = 1; /** /** * Event id for engine parameter change notification. * Event id for engine parameter change notification. */ */ Loading Loading @@ -795,7 +795,7 @@ public class AudioEffect { // Interface definitions // Interface definitions // -------------------- // -------------------- /** /** * The OnParameterChangeListener interface defines a method called by the AudioEffect * The OnEnableStatusChangeListener interface defines a method called by the AudioEffect * when a the enabled state of the effect engine was changed by the controlling application. * when a the enabled state of the effect engine was changed by the controlling application. */ */ public interface OnEnableStatusChangeListener { public interface OnEnableStatusChangeListener { Loading Loading @@ -922,7 +922,6 @@ public class AudioEffect { if (effect == null) { if (effect == null) { return; return; } } if (effect.mNativeEventHandler != null) { if (effect.mNativeEventHandler != null) { Message m = effect.mNativeEventHandler.obtainMessage(what, arg1, Message m = effect.mNativeEventHandler.obtainMessage(what, arg1, arg2, obj); arg2, obj); Loading
media/libmedia/AudioEffect.cpp +22 −3 Original line number Original line Diff line number Diff line Loading @@ -218,7 +218,7 @@ status_t AudioEffect::setEnabled(bool enabled) return mIEffect->disable(); return mIEffect->disable(); } } } } return INVALID_OPERATION; return NO_ERROR; } } status_t AudioEffect::command(uint32_t cmdCode, status_t AudioEffect::command(uint32_t cmdCode, Loading @@ -231,7 +231,22 @@ status_t AudioEffect::command(uint32_t cmdCode, return INVALID_OPERATION; return INVALID_OPERATION; } } return mIEffect->command(cmdCode, cmdSize, cmdData, replySize, replyData); status_t status = mIEffect->command(cmdCode, cmdSize, cmdData, replySize, replyData); if (status != NO_ERROR) { return status; } status = *(status_t *)replyData; if (status != NO_ERROR) { return status; } if (cmdCode == EFFECT_CMD_ENABLE) { android_atomic_or(1, &mEnabled); } if (cmdCode == EFFECT_CMD_DISABLE) { android_atomic_and(~1, &mEnabled); } return status; } } Loading Loading @@ -347,7 +362,11 @@ void AudioEffect::enableStatusChanged(bool enabled) { { LOGV("enableStatusChanged %p enabled %d mCbf %p", this, enabled, mCbf); LOGV("enableStatusChanged %p enabled %d mCbf %p", this, enabled, mCbf); if (mStatus == ALREADY_EXISTS) { if (mStatus == ALREADY_EXISTS) { mEnabled = enabled; if (enabled) { android_atomic_or(1, &mEnabled); } else { android_atomic_and(~1, &mEnabled); } if (mCbf) { if (mCbf) { mCbf(EVENT_ENABLE_STATUS_CHANGED, mUserData, &enabled); mCbf(EVENT_ENABLE_STATUS_CHANGED, mUserData, &enabled); } } Loading
services/audioflinger/AudioFlinger.cpp +8 −5 Original line number Original line Diff line number Diff line Loading @@ -1696,7 +1696,10 @@ uint32_t AudioFlinger::MixerThread::prepareTracks_l(const SortedVector< wp<Track // Delegate master volume control to effect in output mix effect chain if needed // Delegate master volume control to effect in output mix effect chain if needed sp<EffectChain> chain = getEffectChain_l(AudioSystem::SESSION_OUTPUT_MIX); sp<EffectChain> chain = getEffectChain_l(AudioSystem::SESSION_OUTPUT_MIX); if (chain != 0) { if (chain != 0) { uint32_t v = (uint32_t)(masterVolume * (1 << 24)); uint32_t v = 0; if (!masterMute) { v = (uint32_t)(masterVolume * (1 << 24)); } chain->setVolume_l(&v, &v); chain->setVolume_l(&v, &v); masterVolume = (float)((v + (1 << 23)) >> 24); masterVolume = (float)((v + (1 << 23)) >> 24); chain.clear(); chain.clear(); Loading Loading @@ -1750,7 +1753,7 @@ uint32_t AudioFlinger::MixerThread::prepareTracks_l(const SortedVector< wp<Track // compute volume for this track // compute volume for this track int16_t left, right, aux; int16_t left, right, aux; if (track->isMuted() || masterMute || track->isPausing() || if (track->isMuted() || track->isPausing() || mStreamTypes[track->type()].mute) { mStreamTypes[track->type()].mute) { left = right = aux = 0; left = right = aux = 0; if (track->isPausing()) { if (track->isPausing()) { Loading Loading @@ -5351,7 +5354,7 @@ void AudioFlinger::EffectModule::process() return; return; } } if (mState == ACTIVE || mState == STOPPING || mState == STOPPED) { if (mState == ACTIVE || mState == STOPPING || mState == STOPPED || mState == RESTART) { // do 32 bit to 16 bit conversion for auxiliary effect input buffer // do 32 bit to 16 bit conversion for auxiliary effect input buffer if ((mDescriptor.flags & EFFECT_FLAG_TYPE_MASK) == EFFECT_FLAG_TYPE_AUXILIARY) { if ((mDescriptor.flags & EFFECT_FLAG_TYPE_MASK) == EFFECT_FLAG_TYPE_AUXILIARY) { AudioMixer::ditherAndClamp(mConfig.inputCfg.buffer.s32, AudioMixer::ditherAndClamp(mConfig.inputCfg.buffer.s32, Loading Loading @@ -6032,8 +6035,8 @@ void AudioFlinger::EffectHandle::dump(char* buffer, size_t size) AudioFlinger::EffectChain::EffectChain(const wp<ThreadBase>& wThread, AudioFlinger::EffectChain::EffectChain(const wp<ThreadBase>& wThread, int sessionId) int sessionId) : mThread(wThread), mSessionId(sessionId), mActiveTrackCnt(0), mOwnInBuffer(false), : mThread(wThread), mSessionId(sessionId), mActiveTrackCnt(0), mOwnInBuffer(false), mVolumeCtrlIdx(-1), mLeftVolume(0), mRightVolume(0), mVolumeCtrlIdx(-1), mLeftVolume(UINT_MAX), mRightVolume(UINT_MAX), mNewLeftVolume(0), mNewRightVolume(0) mNewLeftVolume(UINT_MAX), mNewRightVolume(UINT_MAX) { { mStrategy = AudioSystem::getStrategyForStream(AudioSystem::MUSIC); mStrategy = AudioSystem::getStrategyForStream(AudioSystem::MUSIC); } } Loading