summaryrefslogtreecommitdiffstats
path: root/media/libmedia/AudioEffect.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2011-06-17 21:29:58 -0700
committerEric Laurent <elaurent@google.com>2011-07-18 09:42:57 -0700
commit7c7f10bd4fda9a084e5e7f0eb3a040dfcbf01745 (patch)
treeeb67cd14e679d97a9b866a0410d8e582f4639274 /media/libmedia/AudioEffect.cpp
parent67a124dcac0578aed94aebf451675a5f4c8a1e4e (diff)
downloadframeworks_av-7c7f10bd4fda9a084e5e7f0eb3a040dfcbf01745.zip
frameworks_av-7c7f10bd4fda9a084e5e7f0eb3a040dfcbf01745.tar.gz
frameworks_av-7c7f10bd4fda9a084e5e7f0eb3a040dfcbf01745.tar.bz2
Audio framework: support for audio pre processing
Audio effect framework is extended to suport effects on output and input audio path. AudioFlinger: Support for audio effects and effect chains is moved from PlaybackThread class to ThreadBase class so that RecordThread can manage effects. Effects of type pre processing are allowed on record thread only. When a pre processing is enabled, the effect interface handle is passed down to the input stream so that the audio HAL can call the process function. The record thread loop calls the effect chain process function that will only manage the effect state and commands and skip the process function. AudioRecord: The audio session is allocated before calling getInput() into audio policy serice so that the session is known before the input theead is created and pre processings can be created on the correct session. AudioPolicyService: default pre processing for a given input source are loaded from audio_effects.conf file. When an input is created, corresponding effects are created and enabled. Change-Id: Id17119e0979b4dcf189b5c7957fec30dc3478790
Diffstat (limited to 'media/libmedia/AudioEffect.cpp')
-rw-r--r--media/libmedia/AudioEffect.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/media/libmedia/AudioEffect.cpp b/media/libmedia/AudioEffect.cpp
index 8d98900..3919551 100644
--- a/media/libmedia/AudioEffect.cpp
+++ b/media/libmedia/AudioEffect.cpp
@@ -47,11 +47,11 @@ AudioEffect::AudioEffect(const effect_uuid_t *type,
effect_callback_t cbf,
void* user,
int sessionId,
- audio_io_handle_t output
+ audio_io_handle_t io
)
: mStatus(NO_INIT)
{
- mStatus = set(type, uuid, priority, cbf, user, sessionId, output);
+ mStatus = set(type, uuid, priority, cbf, user, sessionId, io);
}
AudioEffect::AudioEffect(const char *typeStr,
@@ -60,7 +60,7 @@ AudioEffect::AudioEffect(const char *typeStr,
effect_callback_t cbf,
void* user,
int sessionId,
- audio_io_handle_t output
+ audio_io_handle_t io
)
: mStatus(NO_INIT)
{
@@ -83,7 +83,7 @@ AudioEffect::AudioEffect(const char *typeStr,
}
}
- mStatus = set(pType, pUuid, priority, cbf, user, sessionId, output);
+ mStatus = set(pType, pUuid, priority, cbf, user, sessionId, io);
}
status_t AudioEffect::set(const effect_uuid_t *type,
@@ -92,13 +92,13 @@ status_t AudioEffect::set(const effect_uuid_t *type,
effect_callback_t cbf,
void* user,
int sessionId,
- audio_io_handle_t output)
+ audio_io_handle_t io)
{
sp<IEffect> iEffect;
sp<IMemory> cblk;
int enabled;
- LOGV("set %p mUserData: %p", this, user);
+ LOGV("set %p mUserData: %p uuid: %p timeLow %08x", this, user, type, type ? type->timeLow : 0);
if (mIEffect != 0) {
LOGW("Effect already in use");
@@ -135,7 +135,7 @@ status_t AudioEffect::set(const effect_uuid_t *type,
mIEffectClient = new EffectClient(this);
iEffect = audioFlinger->createEffect(getpid(), (effect_descriptor_t *)&mDescriptor,
- mIEffectClient, priority, output, mSessionId, &mStatus, &mId, &enabled);
+ mIEffectClient, priority, io, mSessionId, &mStatus, &mId, &enabled);
if (iEffect == 0 || (mStatus != NO_ERROR && mStatus != ALREADY_EXISTS)) {
LOGE("set(): AudioFlinger could not create effect, status: %d", mStatus);