diff options
author | Steve Kondik <steve@cyngn.com> | 2016-04-22 18:32:39 -0700 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2016-04-27 13:28:15 -0700 |
commit | 3f9eb321481de3e118632a594bf1b0c9001c281c (patch) | |
tree | a5a0f5a1771e780f32aa4212eeac20e68ba8857c /include/media/AudioSystem.h | |
parent | 244deea89aaf3c5dfa8bd369a845276ae501cb5a (diff) | |
download | frameworks_av-3f9eb321481de3e118632a594bf1b0c9001c281c.zip frameworks_av-3f9eb321481de3e118632a594bf1b0c9001c281c.tar.gz frameworks_av-3f9eb321481de3e118632a594bf1b0c9001c281c.tar.bz2 |
audiopolicy: Add AudioSessionInfo API
* This patch introduces a new API which allows applications to
query the state of the audio effects system, and receive
callbacks with the necessary information to attach effects
to any stream.
* In the future, this may come as part of the AudioPort system,
but since that's an active area of development by Google, we
will dodge it for now.
* The policy now simply keeps a refcounted list of objects which
hold various bits of stream metadata. Callbacks are sent on
stream open/close to applications which might be listening
for them.
Change-Id: I2d554d36e1378f4eb7b276010a3bfe8345c22ecd
Diffstat (limited to 'include/media/AudioSystem.h')
-rw-r--r-- | include/media/AudioSystem.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/media/AudioSystem.h b/include/media/AudioSystem.h index 26a0bb2..3f4a610 100644 --- a/include/media/AudioSystem.h +++ b/include/media/AudioSystem.h @@ -31,6 +31,8 @@ namespace android { typedef void (*audio_error_callback)(status_t err); typedef void (*dynamic_policy_callback)(int event, String8 regId, int val); +typedef void (*audio_session_callback)(int event, + sp<AudioSessionInfo>& session, bool added); class IAudioFlinger; class IAudioPolicyService; @@ -92,6 +94,7 @@ public: static void setErrorCallback(audio_error_callback cb); static void setDynPolicyCallback(dynamic_policy_callback cb); + static status_t setAudioSessionCallback(audio_session_callback cb); // helper function to obtain AudioFlinger service handle static const sp<IAudioFlinger> get_audio_flinger(); @@ -319,6 +322,8 @@ public: audio_io_handle_t *handle); static status_t stopAudioSource(audio_io_handle_t handle); + static status_t listAudioSessions(audio_stream_type_t streams, + Vector< sp<AudioSessionInfo>> &sessions); // ---------------------------------------------------------------------------- @@ -419,6 +424,7 @@ private: virtual void onAudioPortListUpdate(); virtual void onAudioPatchListUpdate(); virtual void onDynamicPolicyMixStateUpdate(String8 regId, int32_t state); + virtual void onOutputSessionEffectsUpdate(sp<AudioSessionInfo>& info, bool added); private: Mutex mLock; @@ -438,6 +444,7 @@ private: static sp<IAudioFlinger> gAudioFlinger; static audio_error_callback gAudioErrorCallback; static dynamic_policy_callback gDynPolicyCallback; + static audio_session_callback gAudioSessionCallback; static size_t gInBuffSize; // previous parameters for recording buffer size queries |