diff options
author | Eric Laurent <elaurent@google.com> | 2014-05-09 23:18:47 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-05-09 23:18:48 +0000 |
commit | 26d5ff926fa3323b39ae4408bcd29826a9523c9b (patch) | |
tree | 6abb6b28dfeffa2f5c602d350021dd8b4e6bd460 /services/audioflinger/AudioFlinger.cpp | |
parent | 16821ec9e1619f4edcc87f21ea1537580109b14d (diff) | |
parent | 1035194cee4fbd57e35ea15c56e66cd09b63d56e (diff) | |
download | frameworks_av-26d5ff926fa3323b39ae4408bcd29826a9523c9b.zip frameworks_av-26d5ff926fa3323b39ae4408bcd29826a9523c9b.tar.gz frameworks_av-26d5ff926fa3323b39ae4408bcd29826a9523c9b.tar.bz2 |
Merge "audioflinger: refactor thread config events"
Diffstat (limited to 'services/audioflinger/AudioFlinger.cpp')
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp index c1c95f8..e256f32 100644 --- a/services/audioflinger/AudioFlinger.cpp +++ b/services/audioflinger/AudioFlinger.cpp @@ -1195,12 +1195,17 @@ void AudioFlinger::removeNotificationClient(pid_t pid) } // audioConfigChanged_l() must be called with AudioFlinger::mLock held -void AudioFlinger::audioConfigChanged_l(int event, audio_io_handle_t ioHandle, const void *param2) +void AudioFlinger::audioConfigChanged_l( + const DefaultKeyedVector< pid_t,sp<NotificationClient> >& notificationClients, + int event, + audio_io_handle_t ioHandle, + const void *param2) { - size_t size = mNotificationClients.size(); + size_t size = notificationClients.size(); for (size_t i = 0; i < size; i++) { - mNotificationClients.valueAt(i)->audioFlingerClient()->ioConfigChanged(event, ioHandle, - param2); + notificationClients.valueAt(i)->audioFlingerClient()->ioConfigChanged(event, + ioHandle, + param2); } } @@ -1633,7 +1638,7 @@ audio_io_handle_t AudioFlinger::openOutput(audio_module_handle_t module, } // notify client processes of the new output creation - thread->audioConfigChanged_l(AudioSystem::OUTPUT_OPENED); + thread->audioConfigChanged_l(mNotificationClients, AudioSystem::OUTPUT_OPENED); // the first primary output opened designates the primary hw device if ((mPrimaryHardwareDev == NULL) && (flags & AUDIO_OUTPUT_FLAG_PRIMARY)) { @@ -1669,7 +1674,7 @@ audio_io_handle_t AudioFlinger::openDuplicateOutput(audio_io_handle_t output1, thread->addOutputTrack(thread2); mPlaybackThreads.add(id, thread); // notify client processes of the new output creation - thread->audioConfigChanged_l(AudioSystem::OUTPUT_OPENED); + thread->audioConfigChanged_l(mNotificationClients, AudioSystem::OUTPUT_OPENED); return id; } @@ -1719,7 +1724,7 @@ status_t AudioFlinger::closeOutput_nonvirtual(audio_io_handle_t output) } } } - audioConfigChanged_l(AudioSystem::OUTPUT_CLOSED, output, NULL); + audioConfigChanged_l(mNotificationClients, AudioSystem::OUTPUT_CLOSED, output, NULL); } thread->exit(); // The thread entity (active unit of execution) is no longer running here, @@ -1899,7 +1904,7 @@ audio_io_handle_t AudioFlinger::openInput(audio_module_handle_t module, } // notify client processes of the new input creation - thread->audioConfigChanged_l(AudioSystem::INPUT_OPENED); + thread->audioConfigChanged_l(mNotificationClients, AudioSystem::INPUT_OPENED); return id; } @@ -1924,7 +1929,7 @@ status_t AudioFlinger::closeInput_nonvirtual(audio_io_handle_t input) } ALOGV("closeInput() %d", input); - audioConfigChanged_l(AudioSystem::INPUT_CLOSED, input, NULL); + audioConfigChanged_l(mNotificationClients, AudioSystem::INPUT_CLOSED, input, NULL); mRecordThreads.removeItem(input); } thread->exit(); |