diff options
author | Steve Kondik <steve@cyngn.com> | 2016-01-14 02:46:40 -0800 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2016-03-08 17:34:16 -0800 |
commit | 0479d7c79a7fd6f112e8dc7e45c009cf6602dbaa (patch) | |
tree | 6ad8d2cd4abd2f7f2fe6beb8348fd696426f76b2 /include/media/AudioSystem.h | |
parent | 51aee1e55bee9cf8e4fd30ecf19fccd7ab7bfc15 (diff) | |
download | frameworks_av-0479d7c79a7fd6f112e8dc7e45c009cf6602dbaa.zip frameworks_av-0479d7c79a7fd6f112e8dc7e45c009cf6602dbaa.tar.gz frameworks_av-0479d7c79a7fd6f112e8dc7e45c009cf6602dbaa.tar.bz2 |
audiopolicy: Add notification when default effects are updated
* In M, we now have the ability to define a default set of audio effect
on a per-stream basis. This allows us to get around the problem of
apps not sending the control intents so we can implement smart
global effects for specific media types.
* We still need a session id in order to get a handle and configure them
from an app like AudioFX, so we'll need to add some plumbing in
order to send an event to interested applications.
* This patch implements the native side of this. The Java layer will
call down thru AudioSystem and register a callback which will be
invoked by the audio policy when default effects are updated on
a stream. This callback will receive both the stream type as well
as the session id.
* Attaching this listener requires that the caller hold the
MODIFY_AUDIO_ROUTING permission.
Change-Id: I142b15f2585ffca6a953c3e828e2a7c07b24f56c
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..35b06ba 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 (*effect_session_callback)(int event, + audio_stream_type_t stream, audio_unique_id_t sessionId, 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 setEffectSessionCallback(effect_session_callback cb); // helper function to obtain AudioFlinger service handle static const sp<IAudioFlinger> get_audio_flinger(); @@ -419,6 +422,9 @@ private: virtual void onAudioPortListUpdate(); virtual void onAudioPatchListUpdate(); virtual void onDynamicPolicyMixStateUpdate(String8 regId, int32_t state); + virtual void onOutputSessionEffectsUpdate(audio_stream_type_t stream, + audio_unique_id_t sessionId, + 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 effect_session_callback gEffectSessionCallback; static size_t gInBuffSize; // previous parameters for recording buffer size queries |