diff options
author | Eric Laurent <elaurent@google.com> | 2015-04-01 13:06:28 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2015-04-01 16:53:33 -0700 |
commit | b28753e19550e5051cd02e6af72ab06e4eff04e0 (patch) | |
tree | 5c9b7dabb3d4abe6aa20bf512ec025eb23d1ca04 /include | |
parent | d4d55cdf31a3faa619bfa043f5b0f170f6ffd139 (diff) | |
download | frameworks_av-b28753e19550e5051cd02e6af72ab06e4eff04e0.zip frameworks_av-b28753e19550e5051cd02e6af72ab06e4eff04e0.tar.gz frameworks_av-b28753e19550e5051cd02e6af72ab06e4eff04e0.tar.bz2 |
audio port: support multiple clients
Add support for more than one audio port callback client per process.
Change-Id: I657c4fc28d5d2d993307551e3e69567dc60196cb
Diffstat (limited to 'include')
-rw-r--r-- | include/media/AudioSystem.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h index ad5d6ed..f5db1bb 100644 --- a/include/media/AudioSystem.h +++ b/include/media/AudioSystem.h @@ -346,7 +346,8 @@ public: }; - static void setAudioPortCallback(sp<AudioPortCallback> callBack); + static status_t addAudioPortCallback(const sp<AudioPortCallback>& callBack); + static status_t removeAudioPortCallback(const sp<AudioPortCallback>& callBack); private: @@ -373,12 +374,19 @@ private: AudioPolicyServiceClient() { } + status_t addAudioPortCallback(const sp<AudioPortCallback>& callBack); + status_t removeAudioPortCallback(const sp<AudioPortCallback>& callBack); + // DeathRecipient virtual void binderDied(const wp<IBinder>& who); // IAudioPolicyServiceClient virtual void onAudioPortListUpdate(); virtual void onAudioPatchListUpdate(); + + private: + Mutex mLock; + Vector <sp <AudioPortCallback> > mAudioPortCallbacks; }; static sp<AudioFlingerClient> gAudioFlingerClient; @@ -390,7 +398,6 @@ private: static Mutex gLockCache; // protects gOutputs, gPrevInSamplingRate, gPrevInFormat, // gPrevInChannelMask and gInBuffSize static Mutex gLockAPS; // protects gAudioPolicyService and gAudioPolicyServiceClient - static Mutex gLockAPC; // protects gAudioPortCallback static sp<IAudioFlinger> gAudioFlinger; static audio_error_callback gAudioErrorCallback; @@ -405,8 +412,6 @@ private: // list of output descriptors containing cached parameters // (sampling rate, framecount, channel count...) static DefaultKeyedVector<audio_io_handle_t, OutputDescriptor *> gOutputs; - - static sp<AudioPortCallback> gAudioPortCallback; }; }; // namespace android |