diff options
author | vivek mehta <mvivek@codeaurora.org> | 2015-09-03 18:25:56 -0700 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:25:00 -0600 |
commit | 831a6bb5319b51759b0b059c1f29635801102caa (patch) | |
tree | a5b55b387692ae1274462b7960607d8340df628a /services/audioflinger/Threads.cpp | |
parent | 562092cd2ad4cadc6555d582945c78465f613a12 (diff) | |
download | frameworks_av-831a6bb5319b51759b0b059c1f29635801102caa.zip frameworks_av-831a6bb5319b51759b0b059c1f29635801102caa.tar.gz frameworks_av-831a6bb5319b51759b0b059c1f29635801102caa.tar.bz2 |
audio: add support to enable Direct PCM output
allow effects in case outout is direct pcm
Change-Id: I2ad7eacf11642a4ca9f892b61124293d0dc503a9
Diffstat (limited to 'services/audioflinger/Threads.cpp')
-rw-r--r-- | services/audioflinger/Threads.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp index 926312e..bafc2da 100644 --- a/services/audioflinger/Threads.cpp +++ b/services/audioflinger/Threads.cpp @@ -544,6 +544,7 @@ AudioFlinger::ThreadBase::ThreadBase(const sp<AudioFlinger>& audioFlinger, audio mSystemReady(systemReady) { memset(&mPatch, 0, sizeof(struct audio_patch)); + mIsDirectPcm = false; } AudioFlinger::ThreadBase::~ThreadBase() @@ -1154,7 +1155,8 @@ sp<AudioFlinger::EffectHandle> AudioFlinger::ThreadBase::createEffect_l( // Reject any effect on Direct output threads for now, since the format of // mSinkBuffer is not guaranteed to be compatible with effect processing (PCM 16 stereo). - if (mType == DIRECT) { + // Exception: allow effects for Direct PCM + if (mType == DIRECT && !mIsDirectPcm) { ALOGW("createEffect_l() Cannot add effect %s on Direct output type thread %s", desc->name, mThreadName); lStatus = BAD_VALUE; @@ -1171,12 +1173,17 @@ sp<AudioFlinger::EffectHandle> AudioFlinger::ThreadBase::createEffect_l( } // Allow global effects only on offloaded and mixer threads + // Exception: allow effects for Direct PCM if (sessionId == AUDIO_SESSION_OUTPUT_MIX) { switch (mType) { case MIXER: case OFFLOAD: break; case DIRECT: + if (mIsDirectPcm) { + // Allow effects when direct PCM enabled on Direct output + break; + } case DUPLICATING: case RECORD: default: |