summaryrefslogtreecommitdiffstats
path: root/services/audiopolicy/service/AudioPolicyEffects.h
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2016-04-22 18:32:39 -0700
committerSteve Kondik <steve@cyngn.com>2016-04-27 13:28:15 -0700
commit3f9eb321481de3e118632a594bf1b0c9001c281c (patch)
treea5a0f5a1771e780f32aa4212eeac20e68ba8857c /services/audiopolicy/service/AudioPolicyEffects.h
parent244deea89aaf3c5dfa8bd369a845276ae501cb5a (diff)
downloadframeworks_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 'services/audiopolicy/service/AudioPolicyEffects.h')
-rw-r--r--services/audiopolicy/service/AudioPolicyEffects.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/services/audiopolicy/service/AudioPolicyEffects.h b/services/audiopolicy/service/AudioPolicyEffects.h
index 3845050..a95d49f 100644
--- a/services/audiopolicy/service/AudioPolicyEffects.h
+++ b/services/audiopolicy/service/AudioPolicyEffects.h
@@ -31,6 +31,8 @@
namespace android {
+class AudioPolicyService;
+
// ----------------------------------------------------------------------------
// AudioPolicyEffects class
@@ -44,7 +46,7 @@ public:
// The constructor will parse audio_effects.conf
// First it will look whether vendor specific file exists,
// otherwise it will parse the system default file.
- AudioPolicyEffects();
+ AudioPolicyEffects(AudioPolicyService *audioPolicyService);
virtual ~AudioPolicyEffects();
// NOTE: methods on AudioPolicyEffects should never be called with the AudioPolicyService
@@ -84,6 +86,19 @@ public:
audio_stream_type_t stream,
int audioSession);
+ status_t updateOutputAudioSessionInfo(audio_io_handle_t output,
+ audio_stream_type_t stream,
+ int audioSession,
+ audio_output_flags_t flags,
+ audio_channel_mask_t channelMask, uid_t uid);
+
+ status_t releaseOutputAudioSessionInfo(audio_io_handle_t output,
+ audio_stream_type_t stream,
+ int audioSession);
+
+ status_t listAudioSessions(audio_stream_type_t streams,
+ Vector< sp<AudioSessionInfo>> &sessions);
+
private:
// class to store the description of an effects and its parameters
@@ -192,6 +207,10 @@ private:
KeyedVector< audio_stream_type_t, EffectDescVector* > mOutputStreams;
// Automatic output effects are unique for audiosession ID
KeyedVector< int32_t, EffectVector* > mOutputSessions;
+ // Stream info for session events
+ KeyedVector< int32_t, sp<AudioSessionInfo> > mOutputAudioSessionInfo;
+
+ AudioPolicyService *mAudioPolicyService;
};
}; // namespace android