summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy/service/AudioPolicyService.cpp
diff options
context:
space:
mode:
authorHaynes Mathew George <hgeorge@codeaurora.org>2015-12-08 15:11:51 -0800
committerSteve Kondik <steve@cyngn.com>2015-12-23 14:27:58 -0800
commitde3b1c01146d2103f6bf56e2659a9c650734945a (patch)
tree0aa0b5965b39e8b2900e669adb8586b69cd0f7f0 /services/audiopolicy/service/AudioPolicyService.cpp
parent8a0d50583fc6a376816333d781a709d26742226d (diff)
downloadframeworks_av-de3b1c01146d2103f6bf56e2659a9c650734945a.zip
frameworks_av-de3b1c01146d2103f6bf56e2659a9c650734945a.tar.gz
frameworks_av-de3b1c01146d2103f6bf56e2659a9c650734945a.tar.bz2
audiopolicy: Handle startOutput on output command thread
Handle startOutput on AudioPolicyService output command thread to serialize with concurrent releaseOutput/stopOutput calls. CRs-Fixed: 944129 Change-Id: Ie333c736750c7dfb31d3036d79dfff13cd0486fc
Diffstat (limited to 'services/audiopolicy/service/AudioPolicyService.cpp')
-rw-r--r--services/audiopolicy/service/AudioPolicyService.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/services/audiopolicy/service/AudioPolicyService.cpp b/services/audiopolicy/service/AudioPolicyService.cpp
index 41dd40c..12cca65 100644
--- a/services/audiopolicy/service/AudioPolicyService.cpp
+++ b/services/audiopolicy/service/AudioPolicyService.cpp
@@ -478,6 +478,19 @@ bool AudioPolicyService::AudioCommandThread::threadLoop()
data->mVolume);
command->mStatus = AudioSystem::setVoiceVolume(data->mVolume);
}break;
+ case START_OUTPUT: {
+ StartOutputData *data = (StartOutputData *)command->mParam.get();
+ ALOGV("AudioCommandThread() processing start output %d",
+ data->mIO);
+ svc = mService.promote();
+ if (svc == 0) {
+ command->mStatus = UNKNOWN_ERROR;
+ break;
+ }
+ mLock.unlock();
+ command->mStatus = svc->doStartOutput(data->mIO, data->mStream, data->mSession);
+ mLock.lock();
+ }break;
case STOP_OUTPUT: {
StopOutputData *data = (StopOutputData *)command->mParam.get();
ALOGV("AudioCommandThread() processing stop output %d",
@@ -714,6 +727,22 @@ status_t AudioPolicyService::AudioCommandThread::voiceVolumeCommand(float volume
return sendCommand(command, delayMs);
}
+status_t AudioPolicyService::AudioCommandThread::startOutputCommand(audio_io_handle_t output,
+ audio_stream_type_t stream,
+ audio_session_t session)
+{
+ sp<AudioCommand> command = new AudioCommand();
+ command->mCommand = START_OUTPUT;
+ sp<StartOutputData> data = new StartOutputData();
+ data->mIO = output;
+ data->mStream = stream;
+ data->mSession = session;
+ command->mParam = data;
+ command->mWaitStatus = true;
+ ALOGV("AudioCommandThread() adding start output %d", output);
+ return sendCommand(command);
+}
+
void AudioPolicyService::AudioCommandThread::stopOutputCommand(audio_io_handle_t output,
audio_stream_type_t stream,
audio_session_t session)